2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, callPackage
|
|
|
|
, ensureNewerSourcesForZipFilesHook
|
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
# optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]`
|
2023-10-09 19:29:22 +00:00
|
|
|
, extraTools ? []
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "waf";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.0.26";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "ita1024";
|
|
|
|
repo = "waf";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "waf-${finalAttrs.version}";
|
|
|
|
hash = "sha256-AXDMWlwivJ0Xot6iwuIIlbV2Anz6ieghyOI9jA4yrko=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ensureNewerSourcesForZipFilesHook
|
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
# waf executable uses `#!/usr/bin/env python`
|
|
|
|
python3
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
runHook preConfigure
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
python waf-light configure
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
buildPhase = let
|
|
|
|
extraToolsList =
|
|
|
|
lib.optionalString (extraTools != [])
|
|
|
|
"--tools=\"${lib.concatStringsSep "," extraTools}\"";
|
|
|
|
in
|
|
|
|
''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
python waf-light build ${extraToolsList}
|
|
|
|
|
|
|
|
runHook postBuild
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
install -D waf $out/bin/waf
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
passthru = {
|
|
|
|
inherit python3 extraTools;
|
|
|
|
hook = callPackage ./hook.nix {
|
|
|
|
waf = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
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 vrthra ];
|
|
|
|
inherit (python3.meta) platforms;
|
|
|
|
sourceProvenance = [ lib.sourceTypes.fromSource ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|