I have a screenshot somewhere of pkgsrc bootstrap in actual Android Terminal, no Debian in the middle) But it needed musl and toybox, and was very basic, too many apps failed to build because their build systems err out in absence /usr.
woahh nice, how did you get an android terminal without the debian stuff? this was pre-installed on my pixel.
Note: this is from way, way back and is more of a historic curiosity than a recommendation to try the same steps.
At the time I used:
a) Jack Palevich’s jackpal.androidterm app, called just Terminal or Android Terminal; b) adb shell -
trying to get pkgsrc to work in both.
First I downloaded a musl+GCC toolchain from https://musl.cc/, and cloned https://github.com/NetBSD/pkgsrc and https://github.com/landley/toybox repos.
I built a static toybox with CFLAGS=-static and CC set to the musl GCC. Created bin directory in Android Terminal’s home dir. Symlinked sbin to bin and usr to
.(controversial decision, but for simplicity why not). And also made a symlink to my toybox copy from every command it provided.I added to PATH my bin and musl GCC dirs. I built a static pdksh from the sources provided by pkgsrc, and put it as ./bin/sh.
Then I had to patch pkgsrc configs to avoid defaulting to system binaries (outdated, buggy) but use my copy of toybox from bin directory instead.
And kept trying to bootstrap pkgsrc, build various packages and patch their sources until things like Python didn’t crash.
Unfortunately the copy of my build scripts and patches died with my old phone.
But I can share something else - a 2019 script that built an entire Linux “distro” from just pkgsrc on my laptop. The script was written in a state of mind that I’m not very proud about, and looks more code-golf’y than readable, but… it worked, I daily-drove it for a couple of months before going back to ordinary Gentoo.

