Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mk: Initial support for NixOS (Linux variant)
A particular challenge for pkgsrc on NixOS is that it usurps all Unix conventions and stores its system binaries and libraries in a crazy system of hashed sub-directories: $ which ls /run/current-system/sw/bin/ls $ ls -l /run/current-system/sw/bin/ls Lrwxrwxrwx 1 root root 65 Jan 1 1970 /run/current-system/sw/bin/ls -> /nix/store/xs02fpnpkq frhqqfsxx3lpj48wrapd00-coreutils-8.32/bin/ls We can make a "best effort" attempt to accomodate this by invoking the compiler to figure out where libc is. In general, it's required to adjust the Linux files to make fewer assumptions about the layout of the filesystem. However, since using a compiler and libc from NixOS results in /nix/store paths being embedded in binaries, running the NixOS "garbage collector" can result in binaries installed from pkgsrc becoming unusable. Use with care: $ readelf -a ~/pkg/bin/perl | grep nix [Requesting program interpreter: /nix/store/p5sam91qwz995pi0160rfr7dkh6pibil-glibc-2.32 -39/lib/ld-linux-aarch64.so.1] 0x000000000000001d (RUNPATH) Library runpath: [/home/nia/pkg/lib:/home/nia/pkg/li b/perl5/5.32.0/aarch64-linux/CORE:/nix/store/p5sam91qwz995pi0160rfr7dkh6pibil-glibc-2.32-39/l ib:/nix/store/vv9nz0bwv1pfl70w14k7dgz6yx7hjwxk-gcc-9.3.0-lib/lib] Apparently, the "stdenv.cc" package must be installed prior to bootstrapping pkgsrc. I worked on this patch last year for a friend who wanted to test something on pkgsrc but had no other system available.
- Loading branch information