From 529b5394941305e39b3b3bb116d4928e3421ac4a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 10:50:14 +0000 Subject: [PATCH 1/5] netbsd.mkDerivation: popd in moveUsrDir Permanently changing the directory here was breaking the kernel build, which needs to do other things after moveUsrDir. --- pkgs/os-specific/bsd/netbsd/builder.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/bsd/netbsd/builder.sh b/pkgs/os-specific/bsd/netbsd/builder.sh index 925001567f79..332e5c2098f6 100644 --- a/pkgs/os-specific/bsd/netbsd/builder.sh +++ b/pkgs/os-specific/bsd/netbsd/builder.sh @@ -105,9 +105,10 @@ moveUsrDir() { if [ -d $prefix ]; then # Remove lingering /usr references if [ -d $prefix/usr ]; then - cd $prefix/usr + pushd $prefix/usr find . -type d -exec mkdir -p $out/\{} \; find . \( -type f -o -type l \) -exec mv \{} $out/\{} \; + popd fi find $prefix -type d -empty -delete From 05e8b0de1a94d47ef073ae791f7494bd0b3fc5e5 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 10:47:35 +0000 Subject: [PATCH 2/5] netbsd.uuencode: init at 8.0 Required to build the NetBSD kernel. --- pkgs/os-specific/bsd/netbsd/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 4e4d5bb1b7fe..7576d4a75cb9 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -379,6 +379,13 @@ let (fetchNetBSD "tools/Makefile.host" "8.0" "1p23dsc4qrv93vc6gzid9w2479jwswry9qfn88505s0pdd7h6nvp") ]; }; + + uudecode = mkDerivation { + path = "usr.bin/uudecode"; + version = "8.0"; + sha256 = "00a3zmh15pg4vx6hz0kaa5mi8d2b1sj4h512d7p6wbvxq6mznwcn"; + NIX_CFLAGS_COMPILE = lib.optional stdenv.isLinux "-DNO_BASE64"; + }; ## ## END COMMAND LINE TOOLS ## From 8603012521b9ef7e758580de25e5e70ae650b045 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 11:44:47 +0000 Subject: [PATCH 3/5] netbsd.sys: add missing uudecode dependency --- pkgs/os-specific/bsd/netbsd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 7576d4a75cb9..7688f7db5da8 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -417,6 +417,7 @@ let version = "8.0"; sha256 = "123ilg8fqmp69bw6bs6nh98fpi1v2n9lamrzar61p27ji6sj7g0w"; propagatedBuildInputs = [ include ]; + nativeBuildInputs = [ makeMinimal install tsort lorder statHook uudecode ]; #meta.platforms = lib.platforms.netbsd; extraPaths = [ common.src ]; MKKMOD = "no"; From f7e988de8c2adb81c4b76305a79343273899aaff Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 11:46:28 +0000 Subject: [PATCH 4/5] netbsd.sys: set FIRMWAREDIR Otherwise, would try to install firmware to /libdata/firmware. --- pkgs/os-specific/bsd/netbsd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 7688f7db5da8..fae11237964b 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -421,6 +421,7 @@ let #meta.platforms = lib.platforms.netbsd; extraPaths = [ common.src ]; MKKMOD = "no"; + makeFlags = [ "FIRMWAREDIR=$(out)/libdata/firmware" ]; }; headers = symlinkJoin { From bdb8ec0ce6223a4cb81ba0a396d4aa777683ab07 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 16:42:48 +0000 Subject: [PATCH 5/5] netbsd.sys: set platforms I don't think there's any reason for this not to be set. Maybe it was from before netbsd.headers overrode meta.platforms for its constituents. --- pkgs/os-specific/bsd/netbsd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index fae11237964b..e3259cee7141 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -418,7 +418,7 @@ let sha256 = "123ilg8fqmp69bw6bs6nh98fpi1v2n9lamrzar61p27ji6sj7g0w"; propagatedBuildInputs = [ include ]; nativeBuildInputs = [ makeMinimal install tsort lorder statHook uudecode ]; - #meta.platforms = lib.platforms.netbsd; + meta.platforms = lib.platforms.netbsd; extraPaths = [ common.src ]; MKKMOD = "no"; makeFlags = [ "FIRMWAREDIR=$(out)/libdata/firmware" ];