From 80d3b5dbf95feb3a968b890886fd8f18b549dae8 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 18 Jun 2024 17:57:33 -0400 Subject: [PATCH 1/4] netbsd: No `_mainLibcExtraPaths` These didn't actually affect `netbsd.compat`, so I inlined the variable back to `libc` again. --- pkgs/os-specific/bsd/netbsd/default.nix | 13 ------------- .../bsd/netbsd/pkgs/compat/package.nix | 3 +-- pkgs/os-specific/bsd/netbsd/pkgs/libc.nix | 16 ++++++++++++++-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 16b231781e49..15e93de1f1ef 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -138,19 +138,6 @@ makeScopeWithSplicing' { inherit (buildPackages.buildPackages) rsync; }; - _mainLibcExtraPaths = [ - "common" - "lib/i18n_module" - "lib/libcrypt" - "lib/libm" - "lib/libpthread" - "lib/libresolv" - "lib/librpcsvc" - "lib/librt" - "lib/libutil" - "libexec/ld.elf_so" - "sys" - ]; libc = self.callPackage ./pkgs/libc.nix { inherit (self) headers csu librt; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix index 1965c966cb9a..10431eb64048 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix @@ -11,7 +11,6 @@ netbsdSetupHook, makeMinimal, rsync, - _mainLibcExtraPaths, version, }: @@ -134,6 +133,6 @@ mkDerivation ( "external/bsd/flex" "sys" "common/include/rpc/types.h" - ] ++ _mainLibcExtraPaths; + ]; } ) diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix index d6b14445acd4..8f86691a4413 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix @@ -2,7 +2,6 @@ lib, mkDerivation, defaultMakeFlags, - _mainLibcExtraPaths, bsdSetupHook, netbsdSetupHook, makeMinimal, @@ -28,7 +27,20 @@ mkDerivation { path = "lib/libc"; USE_FORT = "yes"; MKPROFILE = "no"; - extraPaths = _mainLibcExtraPaths ++ [ "external/bsd/jemalloc" ]; + extraPaths = [ + "common" + "lib/i18n_module" + "lib/libcrypt" + "lib/libm" + "lib/libpthread" + "lib/libresolv" + "lib/librpcsvc" + "lib/librt" + "lib/libutil" + "libexec/ld.elf_so" + "sys" + "external/bsd/jemalloc" + ]; nativeBuildInputs = [ bsdSetupHook netbsdSetupHook From 94424da4fcf5f9f1b7be9ca529c708c07e5f2161 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 20 Jun 2024 12:09:25 -0400 Subject: [PATCH 2/4] netbsd: Remove a bunch of unneeded `rsync` deps Now that we assemble the source code per each package in a separate prep derivation since b6727bbeac10eba4b4b157b51a8521390fc94f3c, we don't need rsync in the package proper derivations. --- pkgs/os-specific/bsd/netbsd/default.nix | 10 ---------- pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/config.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/csu.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/fts/package.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/include.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/install/package.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/libc.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/libterminfo.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/lorder.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/makeMinimal.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix | 1 - pkgs/os-specific/bsd/netbsd/pkgs/stat/package.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/sys/package.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/tic.nix | 2 -- pkgs/os-specific/bsd/netbsd/pkgs/tsort.nix | 2 -- 20 files changed, 47 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 15e93de1f1ef..25deeebec63b 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -53,7 +53,6 @@ makeScopeWithSplicing' { compat = self.callPackage ./pkgs/compat/package.nix { inherit (buildPackages) coreutils; inherit (buildPackages.darwin) cctools-port; - inherit (buildPackages.buildPackages) rsync; inherit (buildPackages.netbsd) makeMinimal; inherit (self) install; }; @@ -65,14 +64,12 @@ makeScopeWithSplicing' { make compatIfNeeded ; - inherit (buildPackages.buildPackages) rsync; inherit (buildPackages.netbsd) makeMinimal; }; # See note in pkgs/stat/package.nix stat = self.callPackage ./pkgs/stat/package.nix { inherit (buildPackages.netbsd) makeMinimal install; - inherit (buildPackages.buildPackages) rsync; }; # See note in pkgs/stat/hook.nix @@ -80,17 +77,14 @@ makeScopeWithSplicing' { tsort = self.callPackage ./pkgs/tsort.nix { inherit (buildPackages.netbsd) makeMinimal install; - inherit (buildPackages.buildPackages) rsync; }; lorder = self.callPackage ./pkgs/lorder.nix { inherit (buildPackages.netbsd) makeMinimal install; - inherit (buildPackages.buildPackages) rsync; }; config = self.callPackage ./pkgs/config.nix { inherit (buildPackages.netbsd) makeMinimal install; - inherit (buildPackages.buildPackages) rsync; inherit (self) cksum; }; @@ -102,7 +96,6 @@ makeScopeWithSplicing' { rpcgen ; inherit (buildPackages) stdenv; - inherit (buildPackages.buildPackages) rsync; }; sys-headers = self.callPackage ./pkgs/sys/headers.nix { @@ -116,7 +109,6 @@ makeScopeWithSplicing' { config genassym ; - inherit (buildPackages.buildPackages) rsync; }; libutil = self.callPackage ./pkgs/libutil.nix { inherit (self) libc sys; }; @@ -135,7 +127,6 @@ makeScopeWithSplicing' { tsort statHook ; - inherit (buildPackages.buildPackages) rsync; }; @@ -152,7 +143,6 @@ makeScopeWithSplicing' { statHook rpcgen ; - inherit (buildPackages.buildPackages) rsync; }; mtree = self.callPackage ./pkgs/mtree.nix { inherit (self) mknod; }; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix index 10431eb64048..aed7846e421f 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix @@ -10,7 +10,6 @@ bsdSetupHook, netbsdSetupHook, makeMinimal, - rsync, version, }: @@ -48,7 +47,6 @@ mkDerivation ( bsdSetupHook netbsdSetupHook makeMinimal - rsync ]; buildInputs = commonDeps; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/config.nix b/pkgs/os-specific/bsd/netbsd/pkgs/config.nix index 272e9065b29b..94a014a189cf 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/config.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/config.nix @@ -7,7 +7,6 @@ mandoc, byacc, flex, - rsync, compatIfNeeded, cksum, }: @@ -22,7 +21,6 @@ mkDerivation { mandoc byacc flex - rsync ]; buildInputs = compatIfNeeded; extraPaths = [ cksum.path ]; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/csu.nix b/pkgs/os-specific/bsd/netbsd/pkgs/csu.nix index ea78f338c533..c6e0de8edd11 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/csu.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/csu.nix @@ -14,7 +14,6 @@ lorder, tsort, statHook, - rsync, headers, sys-headers, ld_elf_so, @@ -38,7 +37,6 @@ mkDerivation { lorder tsort statHook - rsync ]; buildInputs = [ headers ]; extraPaths = [ diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/fts/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/fts/package.nix index 57fc0633b088..3201a1c0e082 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/fts/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/fts/package.nix @@ -2,7 +2,6 @@ mkDerivation, bsdSetupHook, netbsdSetupHook, - rsync, compatIfNeeded, }: @@ -12,7 +11,6 @@ mkDerivation { nativeBuildInputs = [ bsdSetupHook netbsdSetupHook - rsync ]; propagatedBuildInputs = compatIfNeeded; extraPaths = [ diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/include.nix b/pkgs/os-specific/bsd/netbsd/pkgs/include.nix index a43a93847b23..1048016b81e2 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/include.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/include.nix @@ -7,7 +7,6 @@ install, mandoc, groff, - rsync, nbperf, rpcgen, defaultMakeFlags, @@ -24,7 +23,6 @@ mkDerivation { install mandoc groff - rsync nbperf rpcgen ]; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/install/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/install/package.nix index 2dbec08f15e8..fa8bb690075f 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/install/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/install/package.nix @@ -8,7 +8,6 @@ makeMinimal, mandoc, groff, - rsync, compatIfNeeded, fts, @@ -36,7 +35,6 @@ mkDerivation { makeMinimal mandoc groff - rsync ]; skipIncludesPhase = true; buildInputs = diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix index 8f86691a4413..8d590e5f0790 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix @@ -15,7 +15,6 @@ lorder, tsort, statHook, - rsync, rpcgen, csu, headers, @@ -55,7 +54,6 @@ mkDerivation { lorder tsort statHook - rsync rpcgen ]; buildInputs = [ diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libterminfo.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libterminfo.nix index 6e7b59df2ed5..c02410a52ed2 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libterminfo.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libterminfo.nix @@ -10,7 +10,6 @@ statHook, nbperf, tic, - rsync, compatIfNeeded, }: @@ -27,7 +26,6 @@ mkDerivation { statHook nbperf tic - rsync ]; buildInputs = compatIfNeeded; SHLIBINSTALLDIR = "$(out)/lib"; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix index cce0a1b997d8..49ecb8e4a36a 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix @@ -11,7 +11,6 @@ lorder, mandoc, statHook, - rsync, headers, }: @@ -32,7 +31,6 @@ mkDerivation { lorder mandoc statHook - rsync ]; buildInputs = [ headers ]; SHLIBINSTALLDIR = "$(out)/lib"; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/lorder.nix b/pkgs/os-specific/bsd/netbsd/pkgs/lorder.nix index 836fa7500e57..b10b8caee2ff 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/lorder.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/lorder.nix @@ -6,7 +6,6 @@ install, mandoc, groff, - rsync, }: mkDerivation { @@ -18,6 +17,5 @@ mkDerivation { install mandoc groff - rsync ]; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix b/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix index a1e8d1482c21..e16027b535fc 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix @@ -4,7 +4,6 @@ stdenv, bsdSetupHook, netbsdSetupHook, - rsync, }: mkDerivation { @@ -15,7 +14,6 @@ mkDerivation { nativeBuildInputs = [ bsdSetupHook netbsdSetupHook - rsync ]; dontBuild = true; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/makeMinimal.nix b/pkgs/os-specific/bsd/netbsd/pkgs/makeMinimal.nix index ad70b6b8cd07..aab6e7f2b0df 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/makeMinimal.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/makeMinimal.nix @@ -2,7 +2,6 @@ mkDerivation, bsdSetupHook, netbsdSetupHook, - rsync, make, make-rules, }: @@ -14,7 +13,6 @@ mkDerivation { nativeBuildInputs = [ bsdSetupHook netbsdSetupHook - rsync ]; skipIncludesPhase = true; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix index f9b31ee6fed8..b12c92826607 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix @@ -59,7 +59,6 @@ lib.makeOverridable ( mandoc groff statHook - rsync ]; buildInputs = compatIfNeeded; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/stat/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/stat/package.nix index 522a7a1837b1..f55bab160bc2 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/stat/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/stat/package.nix @@ -6,7 +6,6 @@ install, mandoc, groff, - rsync, }: # Don't add this to nativeBuildInputs directly. @@ -21,6 +20,5 @@ mkDerivation { install mandoc groff - rsync ]; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix b/pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix index 6a6f8a503276..116aa46e7350 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix @@ -9,7 +9,6 @@ tsort, lorder, statHook, - rsync, uudecode, config, genassym, @@ -53,7 +52,6 @@ tsort lorder statHook - rsync uudecode config genassym diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix b/pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix index 65fabedfcb45..d19d9d86cb38 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix @@ -9,7 +9,6 @@ tsort, lorder, statHook, - rsync, uudecode, config, genassym, @@ -28,7 +27,6 @@ let tsort lorder statHook - rsync uudecode config genassym diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/sys/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/sys/package.nix index cb691dc87855..0bdd83126bcf 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/sys/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/sys/package.nix @@ -9,7 +9,6 @@ tsort, lorder, statHook, - rsync, uudecode, config, genassym, @@ -28,7 +27,6 @@ let tsort lorder statHook - rsync uudecode config genassym diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/tic.nix b/pkgs/os-specific/bsd/netbsd/pkgs/tic.nix index f71df930ce1c..42772d1d7128 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/tic.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/tic.nix @@ -7,7 +7,6 @@ mandoc, groff, nbperf, - rsync, compatIfNeeded, defaultMakeFlags, libterminfo, @@ -25,7 +24,6 @@ mkDerivation { mandoc groff nbperf - rsync ]; makeFlags = defaultMakeFlags ++ [ "TOOLDIR=$(out)" ]; extraPaths = [ diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/tsort.nix b/pkgs/os-specific/bsd/netbsd/pkgs/tsort.nix index b1ab320da0c8..c844e48b4412 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/tsort.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/tsort.nix @@ -6,7 +6,6 @@ install, mandoc, groff, - rsync, }: mkDerivation { @@ -18,6 +17,5 @@ mkDerivation { install mandoc groff - rsync ]; } From 8cc7430d51e70a8aed0df60dd1590611e9c81262 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 20 Jun 2024 12:34:35 -0400 Subject: [PATCH 3/4] netbsd.libc: Use multiple outputs Generally good practice. --- pkgs/os-specific/bsd/netbsd/pkgs/libc.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix index 8d590e5f0790..e0f9cf46bea8 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix @@ -24,6 +24,12 @@ mkDerivation { noLibc = true; path = "lib/libc"; + outputs = [ + "out" + "dev" + "man" + "tags" + ]; USE_FORT = "yes"; MKPROFILE = "no"; extraPaths = [ @@ -68,17 +74,17 @@ mkDerivation { makeFlags = defaultMakeFlags ++ [ "FILESDIR=$(out)/var/db" ]; postInstall = '' pushd ${headers} - find . -type d -exec mkdir -p $out/\{} \; - find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \; + find include -type d -exec mkdir -p "$dev/{}" ';' + find include '(' -type f -o -type l ')' -exec cp -pr "{}" "$dev/{}" ';' popd pushd ${csu} - find . -type d -exec mkdir -p $out/\{} \; - find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \; + find lib -type d -exec mkdir -p "$out/{}" ';' + find lib '(' -type f -o -type l ')' -exec cp -pr "{}" "$out/{}" ';' popd NIX_CFLAGS_COMPILE+=" -B$out/lib" - NIX_CFLAGS_COMPILE+=" -I$out/include" + NIX_CFLAGS_COMPILE+=" -I$dev/include" NIX_LDFLAGS+=" -L$out/lib" make -C $BSDSRCDIR/lib/libpthread $makeFlags @@ -104,6 +110,8 @@ mkDerivation { make -C $BSDSRCDIR/lib/libcrypt $makeFlags make -C $BSDSRCDIR/lib/libcrypt $makeFlags install + + moveToOutput var/db/libc.tags "$tags" ''; postPatch = '' sed -i 's,/usr\(/include/sys/syscall.h\),${headers}\1,g' \ From e34c3f785631eb4f613e344677c97de3e72d594d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 18 Jun 2024 19:14:38 -0400 Subject: [PATCH 4/4] netbsd.libc: Create from constituent pkgs not hack The old `postInstall` was ugly, and made for a needlessly course-grained package. This makes more smaller derivations, and ones that additionally can be built in parallel. --- pkgs/os-specific/bsd/netbsd/default.nix | 47 ++++-- .../bsd/netbsd/pkgs/compat/libbsd-overlay.pc | 2 +- .../bsd/netbsd/pkgs/compat/package.nix | 59 +++---- .../bsd/netbsd/pkgs/i18n_module.nix | 13 +- .../os-specific/bsd/netbsd/pkgs/ld_elf_so.nix | 11 +- pkgs/os-specific/bsd/netbsd/pkgs/libc.nix | 148 +++++------------- .../bsd/netbsd/pkgs/libcMinimal.nix | 85 ++++++++++ pkgs/os-specific/bsd/netbsd/pkgs/libcrypt.nix | 8 + pkgs/os-specific/bsd/netbsd/pkgs/libm.nix | 18 ++- .../bsd/netbsd/pkgs/libpthread/package.nix | 28 ++-- .../os-specific/bsd/netbsd/pkgs/libresolv.nix | 8 +- .../os-specific/bsd/netbsd/pkgs/librpcsvc.nix | 14 +- pkgs/os-specific/bsd/netbsd/pkgs/librt.nix | 17 +- pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix | 29 +++- .../bsd/netbsd/pkgs/mkDerivation.nix | 3 + 15 files changed, 308 insertions(+), 182 deletions(-) create mode 100644 pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal.nix diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 25deeebec63b..1a00128dcb5b 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -1,5 +1,6 @@ { lib, + crossLibcStdenv, stdenvNoCC, makeScopeWithSplicing', generateSplicesForMkScope, @@ -31,6 +32,16 @@ makeScopeWithSplicing' { compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isNetBSD) self.compat; + stdenvLibcMinimal = crossLibcStdenv.override (old: { + cc = old.cc.override { + libc = self.libcMinimal; + bintools = old.cc.bintools.override { + libc = self.libcMinimal; + sharedLibraryLoader = null; + }; + }; + }); + # The manual callPackages below should in principle be unnecessary because # they're just selecting arguments that would be selected anyway. However, # if we don't perform these manual calls, we get infinite recursion issues @@ -75,13 +86,9 @@ makeScopeWithSplicing' { # See note in pkgs/stat/hook.nix statHook = self.callPackage ./pkgs/stat/hook.nix { inherit (self) stat; }; - tsort = self.callPackage ./pkgs/tsort.nix { - inherit (buildPackages.netbsd) makeMinimal install; - }; + tsort = self.callPackage ./pkgs/tsort.nix { inherit (buildPackages.netbsd) makeMinimal install; }; - lorder = self.callPackage ./pkgs/lorder.nix { - inherit (buildPackages.netbsd) makeMinimal install; - }; + lorder = self.callPackage ./pkgs/lorder.nix { inherit (buildPackages.netbsd) makeMinimal install; }; config = self.callPackage ./pkgs/config.nix { inherit (buildPackages.netbsd) makeMinimal install; @@ -111,7 +118,16 @@ makeScopeWithSplicing' { ; }; - libutil = self.callPackage ./pkgs/libutil.nix { inherit (self) libc sys; }; + libutil = self.callPackage ./pkgs/libutil.nix { + inherit (buildPackages.netbsd) + netbsdSetupHook + makeMinimal + install + lorder + tsort + statHook + ; + }; libpthread-headers = self.callPackage ./pkgs/libpthread/headers.nix { }; @@ -129,9 +145,8 @@ makeScopeWithSplicing' { ; }; - - libc = self.callPackage ./pkgs/libc.nix { - inherit (self) headers csu librt; + libcMinimal = self.callPackage ./pkgs/libcMinimal.nix { + inherit (self) headers csu; inherit (buildPackages.netbsd) netbsdSetupHook makeMinimal @@ -145,6 +160,18 @@ makeScopeWithSplicing' { ; }; + librpcsvc = self.callPackage ./pkgs/librpcsvc.nix { + inherit (buildPackages.netbsd) + netbsdSetupHook + makeMinimal + install + lorder + tsort + statHook + rpcgen + ; + }; + mtree = self.callPackage ./pkgs/mtree.nix { inherit (self) mknod; }; } ); diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/compat/libbsd-overlay.pc b/pkgs/os-specific/bsd/netbsd/pkgs/compat/libbsd-overlay.pc index 3aadabe50882..086dd62303e9 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/compat/libbsd-overlay.pc +++ b/pkgs/os-specific/bsd/netbsd/pkgs/compat/libbsd-overlay.pc @@ -1,7 +1,7 @@ prefix=@out@ exec_prefix=${prefix} libdir=${exec_prefix}/lib -includedir=${prefix}/include +includedir=@includedir@ Name: nbcompat Description: NetBSD compatibility framework diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix index aed7846e421f..0f7483ce55ad 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix @@ -20,6 +20,11 @@ mkDerivation ( { path = "tools/compat"; + outputs = [ + "out" + "dev" + ]; + setupHooks = [ ../../../../../build-support/setup-hooks/role.bash ./compat-setup-hook.sh @@ -57,7 +62,7 @@ mkDerivation ( defaultMakeFlags ++ [ "INSTALL=${coreutils}/bin/install" - "DATADIR=$(out)/share" + "DATADIR=$(dev)/share" # Can't sort object files yet "LORDER=echo" "TSORT=cat" @@ -90,37 +95,38 @@ mkDerivation ( postInstall = '' # why aren't these installed by netbsd? - install -D compat_defs.h $out/include/compat_defs.h - install -D $BSDSRCDIR/include/cdbw.h $out/include/cdbw.h - install -D $BSDSRCDIR/sys/sys/cdbr.h $out/include/cdbr.h + install -D compat_defs.h $dev/include/compat_defs.h + install -D $BSDSRCDIR/include/cdbw.h $dev/include/cdbw.h + install -D $BSDSRCDIR/sys/sys/cdbr.h $dev/include/cdbr.h install -D $BSDSRCDIR/sys/sys/featuretest.h \ - $out/include/sys/featuretest.h - install -D $BSDSRCDIR/sys/sys/md5.h $out/include/md5.h - install -D $BSDSRCDIR/sys/sys/rmd160.h $out/include/rmd160.h - install -D $BSDSRCDIR/sys/sys/sha1.h $out/include/sha1.h - install -D $BSDSRCDIR/sys/sys/sha2.h $out/include/sha2.h - install -D $BSDSRCDIR/sys/sys/queue.h $out/include/sys/queue.h - install -D $BSDSRCDIR/include/vis.h $out/include/vis.h - install -D $BSDSRCDIR/include/db.h $out/include/db.h - install -D $BSDSRCDIR/include/netconfig.h $out/include/netconfig.h - install -D $BSDSRCDIR/include/utmpx.h $out/include/utmpx.h - install -D $BSDSRCDIR/include/tzfile.h $out/include/tzfile.h - install -D $BSDSRCDIR/sys/sys/tree.h $out/include/sys/tree.h - install -D $BSDSRCDIR/include/nl_types.h $out/include/nl_types.h - install -D $BSDSRCDIR/include/stringlist.h $out/include/stringlist.h + $dev/include/sys/featuretest.h + install -D $BSDSRCDIR/sys/sys/md5.h $dev/include/md5.h + install -D $BSDSRCDIR/sys/sys/rmd160.h $dev/include/rmd160.h + install -D $BSDSRCDIR/sys/sys/sha1.h $dev/include/sha1.h + install -D $BSDSRCDIR/sys/sys/sha2.h $dev/include/sha2.h + install -D $BSDSRCDIR/sys/sys/queue.h $dev/include/sys/queue.h + install -D $BSDSRCDIR/include/vis.h $dev/include/vis.h + install -D $BSDSRCDIR/include/db.h $dev/include/db.h + install -D $BSDSRCDIR/include/netconfig.h $dev/include/netconfig.h + install -D $BSDSRCDIR/include/utmpx.h $dev/include/utmpx.h + install -D $BSDSRCDIR/include/tzfile.h $dev/include/tzfile.h + install -D $BSDSRCDIR/sys/sys/tree.h $dev/include/sys/tree.h + install -D $BSDSRCDIR/include/nl_types.h $dev/include/nl_types.h + install -D $BSDSRCDIR/include/stringlist.h $dev/include/stringlist.h # Collapse includes slightly to fix dangling reference - install -D $BSDSRCDIR/common/include/rpc/types.h $out/include/rpc/types.h - sed -i '1s;^;#include "nbtool_config.h"\n;' $out/include/rpc/types.h + install -D $BSDSRCDIR/common/include/rpc/types.h $dev/include/rpc/types.h + sed -i '1s;^;#include "nbtool_config.h"\n;' $dev/include/rpc/types.h '' + lib.optionalString stdenv.isDarwin '' - mkdir -p $out/include/ssp - touch $out/include/ssp/ssp.h + mkdir -p $dev/include/ssp + touch $dev/include/ssp/ssp.h '' + '' - mkdir -p $out/lib/pkgconfig - substitute ${./libbsd-overlay.pc} $out/lib/pkgconfig/libbsd-overlay.pc \ - --subst-var-by out $out \ + mkdir -p $dev/lib/pkgconfig + substitute ${./libbsd-overlay.pc} $dev/lib/pkgconfig/libbsd-overlay.pc \ + --subst-var-by out "$out" \ + --subst-var-by includedir "$dev/include" \ --subst-var-by version ${version} ''; extraPaths = [ @@ -129,8 +135,7 @@ mkDerivation ( "lib/libc" "lib/libutil" "external/bsd/flex" - "sys" - "common/include/rpc/types.h" + "sys/sys" ]; } ) diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/i18n_module.nix b/pkgs/os-specific/bsd/netbsd/pkgs/i18n_module.nix index 066d9f236f9b..9504ac22a74e 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/i18n_module.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/i18n_module.nix @@ -1,11 +1,20 @@ { lib, + stdenvLibcMinimal, mkDerivation, - libc, + libcMinimal, }: mkDerivation { path = "lib/i18n_module"; + + libcMinimal = true; + + # Hack around GCC's limits.h missing the include_next we want See + # https://gcc.gnu.org/legacy-ml/gcc/2003-10/msg01278.html + NIX_CFLAGS_COMPILE_BEFORE = "-isystem ${stdenvLibcMinimal.cc.libc.dev}/include"; + + extraPaths = [ libcMinimal.path ]; + meta.platforms = lib.platforms.netbsd; - extraPaths = [ libc.path ]; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/ld_elf_so.nix b/pkgs/os-specific/bsd/netbsd/pkgs/ld_elf_so.nix index 4116312b9625..900b87967927 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/ld_elf_so.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/ld_elf_so.nix @@ -1,7 +1,7 @@ { lib, mkDerivation, - libc, + libcMinimal, defaultMakeFlags, }: @@ -9,13 +9,16 @@ mkDerivation { noLibc = true; path = "libexec/ld.elf_so"; meta.platforms = lib.platforms.netbsd; - LIBC_PIC = "${libc}/lib/libc_pic.a"; + LIBC_PIC = "${libcMinimal}/lib/libc_pic.a"; # Hack to prevent a symlink being installed here for compatibility. SHLINKINSTALLDIR = "/usr/libexec"; USE_FORT = "yes"; makeFlags = defaultMakeFlags ++ [ "BINDIR=$(out)/libexec" - "CLIBOBJ=${libc}/lib" + "CLIBOBJ=${libcMinimal}/lib" + ]; + extraPaths = [ + libcMinimal.path + "sys" ]; - extraPaths = [ libc.path ] ++ libc.extraPaths; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix index e0f9cf46bea8..665c9ce8ec8b 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libc.nix @@ -1,120 +1,52 @@ { lib, - mkDerivation, - defaultMakeFlags, - bsdSetupHook, - netbsdSetupHook, - makeMinimal, - install, - mandoc, - groff, - flex, - byacc, - genassym, - gencat, - lorder, - tsort, - statHook, - rpcgen, - csu, - headers, + symlinkJoin, + libcMinimal, + libpthread, + libm, + libresolv, + librpcsvc, + i18n_module, + libutil, librt, + libcrypt, + version, }: -mkDerivation { - noLibc = true; - path = "lib/libc"; +symlinkJoin rec { + name = "${pname}-${version}"; + pname = "libc-netbsd"; + inherit version; + outputs = [ "out" "dev" "man" - "tags" ]; - USE_FORT = "yes"; - MKPROFILE = "no"; - extraPaths = [ - "common" - "lib/i18n_module" - "lib/libcrypt" - "lib/libm" - "lib/libpthread" - "lib/libresolv" - "lib/librpcsvc" - "lib/librt" - "lib/libutil" - "libexec/ld.elf_so" - "sys" - "external/bsd/jemalloc" - ]; - nativeBuildInputs = [ - bsdSetupHook - netbsdSetupHook - makeMinimal - install - mandoc - groff - flex - byacc - genassym - gencat - lorder - tsort - statHook - rpcgen - ]; - buildInputs = [ - headers - csu - ]; - env.NIX_CFLAGS_COMPILE = "-B${csu}/lib -fcommon"; + + paths = + lib.concatMap + (p: [ + (lib.getDev p) + (lib.getLib p) + (lib.getMan p) + ]) + [ + libcMinimal + libm + libpthread + libresolv + librpcsvc + i18n_module + libutil + librt + libcrypt + ]; + + postBuild = '' + rm -r "$out/nix-support" + fixupPhase + ''; + meta.platforms = lib.platforms.netbsd; - SHLIBINSTALLDIR = "$(out)/lib"; - MKPICINSTALL = "yes"; - NLSDIR = "$(out)/share/nls"; - makeFlags = defaultMakeFlags ++ [ "FILESDIR=$(out)/var/db" ]; - postInstall = '' - pushd ${headers} - find include -type d -exec mkdir -p "$dev/{}" ';' - find include '(' -type f -o -type l ')' -exec cp -pr "{}" "$dev/{}" ';' - popd - - pushd ${csu} - find lib -type d -exec mkdir -p "$out/{}" ';' - find lib '(' -type f -o -type l ')' -exec cp -pr "{}" "$out/{}" ';' - popd - - NIX_CFLAGS_COMPILE+=" -B$out/lib" - NIX_CFLAGS_COMPILE+=" -I$dev/include" - NIX_LDFLAGS+=" -L$out/lib" - - make -C $BSDSRCDIR/lib/libpthread $makeFlags - make -C $BSDSRCDIR/lib/libpthread $makeFlags install - - make -C $BSDSRCDIR/lib/libm $makeFlags - make -C $BSDSRCDIR/lib/libm $makeFlags install - - make -C $BSDSRCDIR/lib/libresolv $makeFlags - make -C $BSDSRCDIR/lib/libresolv $makeFlags install - - make -C $BSDSRCDIR/lib/librpcsvc $makeFlags - make -C $BSDSRCDIR/lib/librpcsvc $makeFlags install - - make -C $BSDSRCDIR/lib/i18n_module $makeFlags - make -C $BSDSRCDIR/lib/i18n_module $makeFlags install - - make -C $BSDSRCDIR/lib/libutil $makeFlags - make -C $BSDSRCDIR/lib/libutil $makeFlags install - - make -C $BSDSRCDIR/lib/librt $makeFlags - make -C $BSDSRCDIR/lib/librt $makeFlags install - - make -C $BSDSRCDIR/lib/libcrypt $makeFlags - make -C $BSDSRCDIR/lib/libcrypt $makeFlags install - - moveToOutput var/db/libc.tags "$tags" - ''; - postPatch = '' - sed -i 's,/usr\(/include/sys/syscall.h\),${headers}\1,g' \ - $BSDSRCDIR/lib/{libc,librt}/sys/Makefile.inc - ''; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal.nix new file mode 100644 index 000000000000..bbab20d53d51 --- /dev/null +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal.nix @@ -0,0 +1,85 @@ +{ + lib, + mkDerivation, + defaultMakeFlags, + bsdSetupHook, + netbsdSetupHook, + makeMinimal, + install, + mandoc, + groff, + flex, + byacc, + genassym, + gencat, + lorder, + tsort, + statHook, + rpcgen, + csu, + headers, +}: + +mkDerivation { + noLibc = true; + path = "lib/libc"; + pname = "libcMinimal-netbsd"; + outputs = [ + "out" + "dev" + "man" + "tags" + ]; + USE_FORT = "yes"; + MKPROFILE = "no"; + extraPaths = [ + "common" + "lib/i18n_module" + "libexec/ld.elf_so" + "sys" + "external/bsd/jemalloc" + ]; + nativeBuildInputs = [ + bsdSetupHook + netbsdSetupHook + makeMinimal + install + mandoc + groff + flex + byacc + genassym + gencat + lorder + tsort + statHook + rpcgen + ]; + buildInputs = [ + headers + csu + ]; + env.NIX_CFLAGS_COMPILE = "-B${csu}/lib -fcommon"; + meta.platforms = lib.platforms.netbsd; + SHLIBINSTALLDIR = "$(out)/lib"; + MKPICINSTALL = "yes"; + NLSDIR = "$(out)/share/nls"; + makeFlags = defaultMakeFlags ++ [ "FILESDIR=$(out)/var/db" ]; + postInstall = '' + pushd ${headers} + find include -type d -exec mkdir -p "$dev/{}" ';' + find include '(' -type f -o -type l ')' -exec cp -pr "{}" "$dev/{}" ';' + popd + + pushd ${csu} + find lib -type d -exec mkdir -p "$out/{}" ';' + find lib '(' -type f -o -type l ')' -exec cp -pr "{}" "$out/{}" ';' + popd + + moveToOutput var/db/libc.tags "$tags" + ''; + + postPatch = '' + sed -i 's,/usr\(/include/sys/syscall.h\),${headers}\1,g' lib/lib*/sys/Makefile.inc + ''; +} diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libcrypt.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libcrypt.nix index abcb2cfb14fb..f51dec0f68af 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libcrypt.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libcrypt.nix @@ -2,6 +2,14 @@ mkDerivation { path = "lib/libcrypt"; + + libcMinimal = true; + + outputs = [ + "out" + "man" + ]; + SHLIBINSTALLDIR = "$(out)/lib"; meta.platforms = lib.platforms.netbsd; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libm.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libm.nix index 8a2304cacbca..f010c808c484 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libm.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libm.nix @@ -1,12 +1,18 @@ -{ - lib, - mkDerivation, - sys, -}: +{ lib, mkDerivation }: mkDerivation { path = "lib/libm"; + + libcMinimal = true; + + outputs = [ + "out" + "man" + ]; + SHLIBINSTALLDIR = "$(out)/lib"; + + extraPaths = [ "sys" ]; + meta.platforms = lib.platforms.netbsd; - extraPaths = [ sys.path ]; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/package.nix index 28665b351f88..2aa5a8f54066 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/package.nix @@ -1,27 +1,37 @@ { lib, + stdenvLibcMinimal, mkDerivation, headers, - libc, + libcMinimal, librt, - sys, }: mkDerivation ( import ./base.nix // { - pname = "libpthread"; - installPhase = null; - noCC = false; - dontBuild = false; - buildInputs = [ headers ]; + + libcMinimal = true; + + outputs = [ + "out" + "dev" + "man" + ]; + SHLIBINSTALLDIR = "$(out)/lib"; + + # Hack around GCC's limits.h missing the include_next we want See + # https://gcc.gnu.org/legacy-ml/gcc/2003-10/msg01278.html + NIX_CFLAGS_COMPILE_BEFORE = "-isystem ${stdenvLibcMinimal.cc.libc.dev}/include"; + extraPaths = [ "common" - libc.path + libcMinimal.path librt.path - sys.path + "sys" ]; + meta.platforms = lib.platforms.netbsd; } ) diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libresolv.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libresolv.nix index 7db4948e6939..63e95de850c0 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libresolv.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libresolv.nix @@ -1,11 +1,15 @@ { lib, mkDerivation, - libc, + libcMinimal, }: mkDerivation { path = "lib/libresolv"; + + libcMinimal = true; + + extraPaths = [ libcMinimal.path ]; + meta.platforms = lib.platforms.netbsd; - extraPaths = [ libc.path ]; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/librpcsvc.nix b/pkgs/os-specific/bsd/netbsd/pkgs/librpcsvc.nix index 3f2d392ba8c5..60609ed134fb 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/librpcsvc.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/librpcsvc.nix @@ -14,8 +14,14 @@ mkDerivation { path = "lib/librpcsvc"; - makeFlags = defaultMakeFlags ++ [ "INCSDIR=$(out)/include/rpcsvc" ]; - meta.platforms = lib.platforms.netbsd; + + libcMinimal = true; + + outputs = [ + "out" + "dev" + ]; + nativeBuildInputs = [ bsdSetupHook netbsdSetupHook @@ -26,4 +32,8 @@ mkDerivation { rpcgen statHook ]; + + makeFlags = defaultMakeFlags ++ [ "INCSDIR=$(dev)/include/rpcsvc" ]; + + meta.platforms = lib.platforms.netbsd; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/librt.nix b/pkgs/os-specific/bsd/netbsd/pkgs/librt.nix index 87cd3092f1b1..c69062d9e87d 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/librt.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/librt.nix @@ -1,13 +1,22 @@ { lib, mkDerivation, - libc, - headers, + libcMinimal, }: mkDerivation { path = "lib/librt"; + + libcMinimal = true; + + outputs = [ + "out" + "man" + ]; + + extraPaths = [ libcMinimal.path ] ++ libcMinimal.extraPaths; + + inherit (libcMinimal) postPatch; + meta.platforms = lib.platforms.netbsd; - extraPaths = [ libc.path ] ++ libc.extraPaths; - inherit (libc) postPatch; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix index 49ecb8e4a36a..c217f6a7ce46 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix @@ -1,7 +1,7 @@ { + lib, + stdenvLibcMinimal, mkDerivation, - libc, - sys, bsdSetupHook, netbsdSetupHook, makeMinimal, @@ -16,11 +16,14 @@ mkDerivation { path = "lib/libutil"; - extraPaths = [ - "common" - "lib/libc" - "sys" + + libcMinimal = true; + + outputs = [ + "out" + "man" ]; + nativeBuildInputs = [ bsdSetupHook netbsdSetupHook @@ -32,6 +35,18 @@ mkDerivation { mandoc statHook ]; - buildInputs = [ headers ]; + SHLIBINSTALLDIR = "$(out)/lib"; + + # Hack around GCC's limits.h missing the include_next we want See + # https://gcc.gnu.org/legacy-ml/gcc/2003-10/msg01278.html + NIX_CFLAGS_COMPILE_BEFORE = "-isystem ${stdenvLibcMinimal.cc.libc.dev}/include"; + + extraPaths = [ + "common" + "lib/libc" + "sys" + ]; + + meta.platforms = lib.platforms.netbsd; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix index b12c92826607..8605bfbfcebe 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix @@ -3,6 +3,7 @@ stdenv, stdenvNoCC, crossLibcStdenv, + stdenvLibcMinimal, runCommand, rsync, source, @@ -28,6 +29,8 @@ lib.makeOverridable ( stdenvNoCC else if attrs.noLibc or false then crossLibcStdenv + else if attrs.libcMinimal or false then + stdenvLibcMinimal else stdenv; in