about summary refs log tree commit diff
path: root/pkgs/os-specific/bsd/netbsd/pkgs/include.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/bsd/netbsd/pkgs/include.nix')
-rw-r--r--pkgs/os-specific/bsd/netbsd/pkgs/include.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/include.nix b/pkgs/os-specific/bsd/netbsd/pkgs/include.nix
new file mode 100644
index 0000000000000..ec316a63174fd
--- /dev/null
+++ b/pkgs/os-specific/bsd/netbsd/pkgs/include.nix
@@ -0,0 +1,54 @@
+{
+  lib,
+  mkDerivation,
+  bsdSetupHook,
+  netbsdSetupHook,
+  makeMinimal,
+  install,
+  mandoc,
+  groff,
+  rsync,
+  nbperf,
+  rpcgen,
+  common,
+  defaultMakeFlags,
+  stdenv,
+}:
+
+mkDerivation {
+  path = "include";
+  version = "9.2";
+  sha256 = "0nxnmj4c8s3hb9n3fpcmd0zl3l1nmhivqgi9a35sis943qvpgl9h";
+  nativeBuildInputs = [
+    bsdSetupHook
+    netbsdSetupHook
+    makeMinimal
+    install
+    mandoc
+    groff
+    rsync
+    nbperf
+    rpcgen
+  ];
+
+  # The makefiles define INCSDIR per subdirectory, so we have to set
+  # something else on the command line so those definitions aren't
+  # overridden.
+  postPatch = ''
+    find "$BSDSRCDIR" -name Makefile -exec \
+      sed -i -E \
+        -e 's_/usr/include_''${INCSDIR0}_' \
+        {} \;
+  '';
+
+  # multiple header dirs, see above
+  postConfigure = ''
+    makeFlags=''${makeFlags/INCSDIR/INCSDIR0}
+  '';
+
+  extraPaths = [ common ];
+  headersOnly = true;
+  noCC = true;
+  meta.platforms = lib.platforms.netbsd;
+  makeFlags = defaultMakeFlags ++ [ "RPCGEN_CPP=${stdenv.cc.cc}/bin/cpp" ];
+}