2023-07-16 14:26:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2023-08-23 01:31:36 +00:00
|
|
|
, callPackage
|
2023-07-16 14:26:29 +00:00
|
|
|
, ensureNewerSourcesForZipFilesHook
|
|
|
|
, python3
|
2019-06-17 14:23:52 +00:00
|
|
|
# optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]`
|
2023-07-16 14:26:29 +00:00
|
|
|
, extraTools ? []
|
2019-06-17 14:23:52 +00:00
|
|
|
}:
|
2023-07-16 14:26:29 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "waf";
|
2024-03-12 00:44:37 +00:00
|
|
|
version = "2.0.27";
|
2016-02-10 19:34:05 +00:00
|
|
|
|
2018-08-09 18:31:26 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "ita1024";
|
|
|
|
repo = "waf";
|
2023-07-16 14:26:29 +00:00
|
|
|
rev = "waf-${finalAttrs.version}";
|
2024-03-12 00:44:37 +00:00
|
|
|
hash = "sha256-GeEoD5CHubwR4ndGk7J7czEf0hWtPQr88TqJDPqeK0s=";
|
2016-02-10 19:34:05 +00:00
|
|
|
};
|
|
|
|
|
2023-07-16 14:26:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ensureNewerSourcesForZipFilesHook
|
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
# waf executable uses `#!/usr/bin/env python`
|
|
|
|
python3
|
|
|
|
];
|
2021-10-16 17:11:28 +00:00
|
|
|
|
2023-07-16 14:26:29 +00:00
|
|
|
strictDeps = true;
|
2016-02-10 19:34:05 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2023-07-16 14:26:29 +00:00
|
|
|
runHook preConfigure
|
|
|
|
|
2016-02-10 19:34:05 +00:00
|
|
|
python waf-light configure
|
2023-07-16 14:26:29 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
2016-02-10 19:34:05 +00:00
|
|
|
'';
|
2023-07-16 14:26:29 +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
|
|
|
'';
|
2023-07-16 14:26:29 +00:00
|
|
|
|
2016-02-10 19:34:05 +00:00
|
|
|
installPhase = ''
|
2023-07-16 14:26:29 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-03-06 05:08:06 +00:00
|
|
|
install -D waf $out/bin/waf
|
2016-02-10 19:34:05 +00:00
|
|
|
|
2023-07-16 14:26:29 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2021-10-16 17:11:28 +00:00
|
|
|
|
2023-08-23 01:31:36 +00:00
|
|
|
passthru = {
|
|
|
|
inherit python3 extraTools;
|
|
|
|
hook = callPackage ./hook.nix {
|
|
|
|
waf = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-07-16 14:26:29 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://waf.io";
|
|
|
|
description = "The meta build system";
|
2023-08-16 00:57:59 +00:00
|
|
|
changelog = "https://gitlab.com/ita1024/waf/blob/${finalAttrs.version}/ChangeLog";
|
2023-07-16 14:26:29 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
mainProgram = "waf";
|
2024-02-09 01:06:02 +00:00
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
2023-07-16 14:26:29 +00:00
|
|
|
inherit (python3.meta) platforms;
|
2023-08-16 00:57:59 +00:00
|
|
|
sourceProvenance = [ lib.sourceTypes.fromSource ];
|
2016-02-10 19:34:05 +00:00
|
|
|
};
|
2023-07-16 14:26:29 +00:00
|
|
|
})
|