--- - branch: MAIN date: Sun May 1 08:03:41 UTC 2022 files: - new: '1.421' old: '1.420' path: pkgsrc/mk/bsd.prefs.mk pathrev: pkgsrc/mk/bsd.prefs.mk@1.421 type: modified - new: '1.89' old: '1.88' path: pkgsrc/mk/platform/Linux.mk pathrev: pkgsrc/mk/platform/Linux.mk@1.89 type: modified - new: '1.66' old: '1.65' path: pkgsrc/mk/tools/tools.Linux.mk pathrev: pkgsrc/mk/tools/tools.Linux.mk@1.66 type: modified id: 20220501T080341Z.251ca2a0eae7fbc5c6f235a4ae98ad99e764a6c4 log: | 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. module: pkgsrc subject: 'CVS commit: pkgsrc/mk' unixtime: '1651392221' user: nia