depot/third_party/nixpkgs/pkgs/development/tools/build-managers/waf/hook.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

24 lines
634 B
Nix

{ 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