summary refs log tree commit diff
path: root/pkgs/os-specific/bsd/netbsd/default.nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-09-01 21:38:38 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-09-03 03:09:05 +0000
commitaf58c2cc0c9ebaf5e3c3efced11935f8ca70e6bb (patch)
tree0503e363c094437d5409c63b60b9c44201ef70bd /pkgs/os-specific/bsd/netbsd/default.nix
parent2810201833ae619818179f11a225b2d584d25ec9 (diff)
downloadnixpkgs-af58c2cc0c9ebaf5e3c3efced11935f8ca70e6bb.tar
nixpkgs-af58c2cc0c9ebaf5e3c3efced11935f8ca70e6bb.tar.gz
nixpkgs-af58c2cc0c9ebaf5e3c3efced11935f8ca70e6bb.tar.bz2
nixpkgs-af58c2cc0c9ebaf5e3c3efced11935f8ca70e6bb.tar.lz
nixpkgs-af58c2cc0c9ebaf5e3c3efced11935f8ca70e6bb.tar.xz
nixpkgs-af58c2cc0c9ebaf5e3c3efced11935f8ca70e6bb.tar.zst
nixpkgs-af58c2cc0c9ebaf5e3c3efced11935f8ca70e6bb.zip
netbsd.compat: Don't configure twice
Diffstat (limited to 'pkgs/os-specific/bsd/netbsd/default.nix')
-rw-r--r--pkgs/os-specific/bsd/netbsd/default.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix
index b903bc46156..0e6526c1834 100644
--- a/pkgs/os-specific/bsd/netbsd/default.nix
+++ b/pkgs/os-specific/bsd/netbsd/default.nix
@@ -166,6 +166,15 @@ in lib.makeScopeWithSplicing
       ./compat-setup-hook.sh
     ];
 
+    preConfigure = ''
+      make include/.stamp configure nbtool_config.h.in defs.mk.in
+    '';
+
+    configurePlatforms = [ "build" "host" ];
+    configureFlags = [
+      "--cache-file=config.cache"
+    ];
+
     # the build system re-runs `./configure` with `HOST_CC` (which is their
     # name for Build CC) as a compiler to make `defs.mk`, which is installed
     depsBuildBuild = [ buildPackages.stdenv.cc ] ++ commonDeps;
@@ -187,7 +196,10 @@ in lib.makeScopeWithSplicing
     ];
     RENAME = "-D";
 
-    patches = [ ./compat.patch ];
+    patches = [
+      ./compat-cxx-safe-header.patch
+      ./compat-dont-configure-twice.patch
+    ];
 
     postInstall = ''
       mv $out/include/compat/* $out/include