about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/wa/waf/hook.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/wa/waf/hook.nix')
-rw-r--r--nixpkgs/pkgs/by-name/wa/waf/hook.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/wa/waf/hook.nix b/nixpkgs/pkgs/by-name/wa/waf/hook.nix
new file mode 100644
index 000000000000..ac497d227831
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/wa/waf/hook.nix
@@ -0,0 +1,24 @@
+{ lib
+, stdenv
+, pkgs
+, makeSetupHook
+, waf
+}:
+
+makeSetupHook {
+  name = "waf-setup-hook";
+
+  substitutions = {
+    # Sometimes the upstream provides its own waf file; in order to honor it,
+    # waf is not inserted into propagatedBuildInputs, rather it is inserted
+    # directly
+    inherit waf;
+    wafCrossFlags = lib.optionalString (stdenv.hostPlatform.system != stdenv.targetPlatform.system)
+      ''--cross-compile "--cross-execute=${stdenv.targetPlatform.emulator pkgs}"'';
+  };
+
+  meta = {
+    description = "A setup hook for using Waf in Nixpkgs";
+    inherit (waf.meta) maintainers platforms broken;
+  };
+} ./setup-hook.sh