tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc on alpine linux (non-gnu userland) - trip report



"Thomas Mueller" <mueller6725%twc.com@localhost> 1 June 2020, 05:31:20:
> How did you build musl.cc+toybox+pkgsrc ?
> 
> Did you cross-compile from NetBSD, FreeBSD or other non-Linux?
> 
> I am trying to do that, hitting snags.
> 
> I was successful building musl-cross-make on NetBSD and FreeBSD.

I use a Gentoo Linux host with bash, curl and git. Native, no
cross. Any distro, on VM or bare metal, should suffice as long as
it boots and gives you a root shell with network. The prebuilt
musl-cross-make I use is from musl.cc, but of course a native
toolchain resulting from your own cross build should work too!
Once you have that, see if my script is of any interest:
https://github.com/nykula/acmd/blob/ebd5086/world

Note that I depend on michaelforney's oasislinux patches to pkgsrc,
because of my http://gnats.netbsd.org/54910 unresolved issue.

> I notice toybox source has many scripts beginning with #!/bin/bash,
> one bugaboo of non-linux users and even Linux users who use a shell
> other than bash (such as dash).

That's intentional, as the author is writing a drop-in bash replacement
and uses own build scripts as real-world test cases. Once he finishes
the shell, it will be bootstrappable with my small POSIX C tool and
continue to build the rest of toybox:
https://github.com/landley/toybox/pull/190/files

In the meantime you can run toybox build scripts with mksh, dummying
out the one cache invalidation condition in make.sh that uses
bash-only syntax: sed -i 's/<(.*)/:/' scripts/make.sh

> How do mksh and pdksh compare to bash? OpenADK (openadk.org) likes
> mksh. I am curious, would like to build mksh and pdksh on my next
> upgrade of NetBSD and possibly FreeBSD.

Pdksh from pkgsrc source is the first thing I build once I have the
toolchain and toybox. In the script above you can see how I do it
without make or another shell in the chroot. Then I do nawk, and
pkgsrc does the rest (awesome work y'all!)

While pdksh is good for initial use as it's easy to build, many
third-party scripts, especially for graphical apps, want something
closer to bash in terms of features (here strings, substitution
anywhere in the string). So once I have pkgsrc I have it build
mksh and replace my pdksh with that, before I proceed with more
software builds.


Home | Main Index | Thread Index | Old Index