nixpkgs/pkgs/by-name/wa/waf/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
1.6 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitLab
, callPackage
, ensureNewerSourcesForZipFilesHook
, python3
# optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]`
, extraTools ? []
}:
stdenv.mkDerivation (finalAttrs: {
pname = "waf";
2024-03-12 00:44:37 +00:00
version = "2.0.27";
2016-02-10 19:34:05 +00:00
src = fetchFromGitLab {
owner = "ita1024";
repo = "waf";
rev = "waf-${finalAttrs.version}";
2024-03-12 00:44:37 +00:00
hash = "sha256-GeEoD5CHubwR4ndGk7J7czEf0hWtPQr88TqJDPqeK0s=";
2016-02-10 19:34:05 +00:00
};
nativeBuildInputs = [
ensureNewerSourcesForZipFilesHook
python3
];
buildInputs = [
# waf executable uses `#!/usr/bin/env python`
python3
];
strictDeps = true;
2016-02-10 19:34:05 +00:00
configurePhase = ''
runHook preConfigure
2016-02-10 19:34:05 +00:00
python waf-light configure
runHook postConfigure
2016-02-10 19:34:05 +00:00
'';
buildPhase = let
extraToolsList =
lib.optionalString (extraTools != [])
"--tools=\"${lib.concatStringsSep "," extraTools}\"";
in
''
runHook preBuild
python waf-light build ${extraToolsList}
runHook postBuild
2016-02-10 19:34:05 +00:00
'';
2016-02-10 19:34:05 +00:00
installPhase = ''
runHook preInstall
install -D waf $out/bin/waf
2016-02-10 19:34:05 +00:00
runHook postInstall
'';
passthru = {
inherit python3 extraTools;
hook = callPackage ./hook.nix {
waf = finalAttrs.finalPackage;
};
};
meta = {
homepage = "https://waf.io";
description = "The meta build system";
changelog = "https://gitlab.com/ita1024/waf/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.bsd3;
mainProgram = "waf";
maintainers = with lib.maintainers; [ AndersonTorres ];
inherit (python3.meta) platforms;
sourceProvenance = [ lib.sourceTypes.fromSource ];
2016-02-10 19:34:05 +00:00
};
})