about summary refs log tree commit diff
path: root/pkgs/os-specific/bsd/netbsd/pkgs/stat/hook.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/bsd/netbsd/pkgs/stat/hook.nix')
-rw-r--r--pkgs/os-specific/bsd/netbsd/pkgs/stat/hook.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/stat/hook.nix b/pkgs/os-specific/bsd/netbsd/pkgs/stat/hook.nix
new file mode 100644
index 0000000000000..78186f55cd455
--- /dev/null
+++ b/pkgs/os-specific/bsd/netbsd/pkgs/stat/hook.nix
@@ -0,0 +1,14 @@
+{ makeSetupHook, writeText, stat }:
+
+# stat isn't in POSIX, and NetBSD stat supports a completely
+# different range of flags than GNU stat, so including it in PATH
+# breaks stdenv.  Work around that with a hook that will point
+# NetBSD's build system and NetBSD stat without including it in
+# PATH.
+
+makeSetupHook {
+  name = "netbsd-stat-hook";
+} (writeText "netbsd-stat-hook-impl" ''
+  makeFlagsArray+=(TOOL_STAT=${stat}/bin/stat)
+'')
+