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.nix17
1 files changed, 17 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..e38c53a3aac57
--- /dev/null
+++ b/pkgs/os-specific/bsd/netbsd/pkgs/stat/hook.nix
@@ -0,0 +1,17 @@
+{
+  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)
+  ''
+)