2021-10-16 17:11:28 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, python3, ensureNewerSourcesForZipFilesHook
|
2019-06-17 14:23:52 +00:00
|
|
|
# optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]`
|
|
|
|
, withTools ? null
|
|
|
|
}:
|
|
|
|
let
|
2021-01-23 12:26:19 +00:00
|
|
|
wafToolsArg = with lib.strings;
|
2023-03-05 21:08:45 +00:00
|
|
|
optionalString (withTools != null) " --tools=\"${concatStringsSep "," withTools}\"";
|
2019-06-17 14:23:52 +00:00
|
|
|
in
|
2016-02-10 19:34:05 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "waf";
|
2023-01-06 13:23:15 +00:00
|
|
|
version = "2.0.25";
|
2016-02-10 19:34:05 +00:00
|
|
|
|
2018-08-09 18:31:26 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "ita1024";
|
|
|
|
repo = "waf";
|
2019-08-15 12:41:18 +00:00
|
|
|
rev = "${pname}-${version}";
|
2023-01-06 13:23:15 +00:00
|
|
|
sha256 = "sha256-wqZEAfGRHhcd7Xm2pQ0FTjZGfuPafRrZAUdpc7ACoEA=";
|
2016-02-10 19:34:05 +00:00
|
|
|
};
|
|
|
|
|
2021-10-16 17:11:28 +00:00
|
|
|
nativeBuildInputs = [ python3 ensureNewerSourcesForZipFilesHook ];
|
|
|
|
|
|
|
|
# waf bin has #!/usr/bin/env python
|
|
|
|
buildInputs = [ python3 ];
|
2016-02-10 19:34:05 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
python waf-light configure
|
|
|
|
'';
|
|
|
|
buildPhase = ''
|
2019-06-17 14:23:52 +00:00
|
|
|
python waf-light build${wafToolsArg}
|
2016-02-10 19:34:05 +00:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
2020-03-06 05:08:06 +00:00
|
|
|
install -D waf $out/bin/waf
|
2016-02-10 19:34:05 +00:00
|
|
|
'';
|
|
|
|
|
2021-10-16 17:11:28 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2016-02-10 19:34:05 +00:00
|
|
|
description = "Meta build system";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://waf.io";
|
2016-06-27 04:56:50 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ vrthra ];
|
2016-02-10 19:34:05 +00:00
|
|
|
};
|
|
|
|
}
|