Files
nixpkgs/pkgs/by-name/wa/waf/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

91 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
callPackage,
ensureNewerSourcesForZipFilesHook,
python3,
makeWrapper,
# optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]`
extraTools ? [ ],
}:
stdenv.mkDerivation (finalAttrs: {
pname = "waf";
version = "2.1.6";
src = fetchFromGitLab {
owner = "ita1024";
repo = "waf";
rev = "waf-${finalAttrs.version}";
hash = "sha256-srBBRe7OLNM86OVJYYk6A0EYJi+rdJ/xG7f+YBdrclE=";
};
nativeBuildInputs = [
ensureNewerSourcesForZipFilesHook
python3
makeWrapper
];
buildInputs = [
# waf executable uses `#!/usr/bin/env python`
python3
];
strictDeps = true;
configurePhase = ''
runHook preConfigure
python waf-light configure
runHook postConfigure
'';
buildPhase =
let
extraToolsList = lib.optionalString (
extraTools != [ ]
) "--tools=\"${lib.concatStringsSep "," extraTools}\"";
in
''
runHook preBuild
python waf-light build ${extraToolsList}
substituteInPlace waf \
--replace "w = test(i + '/lib/' + dirname)" \
"w = test('$out/${python3.sitePackages}')"
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D waf "$out"/bin/waf
wrapProgram "$out"/bin/waf --prefix PYTHONPATH : "$out"/${python3.sitePackages}
mkdir -p "$out"/${python3.sitePackages}/
cp -r waflib "$out"/${python3.sitePackages}/
runHook postInstall
'';
passthru = {
inherit python3 extraTools;
hook = callPackage ./hook.nix {
waf = finalAttrs.finalPackage;
};
};
meta = {
homepage = "https://waf.io";
description = "Meta build system";
changelog = "https://gitlab.com/ita1024/waf/blob/waf-${finalAttrs.version}/ChangeLog";
license = lib.licenses.bsd3;
mainProgram = "waf";
maintainers = [ ];
inherit (python3.meta) platforms;
sourceProvenance = [ lib.sourceTypes.fromSource ];
};
})