waf: Added support for optional extra tools (#63042)

The list of tools `withTools` are included as extra tools when building
waf.

Example:

    mywaf = callPackage ../development/tools/build-managers/waf {
      python = python3;
      withTools = [ "doxygen" ];
    };
This commit is contained in:
xbreak 2019-06-17 16:23:52 +02:00 committed by Dmitry Kalinkin
parent 10a25e9b52
commit 2b51328002

View file

@ -1,5 +1,11 @@
{ stdenv, fetchFromGitLab, fetchpatch, python, ensureNewerSourcesForZipFilesHook }:
{ stdenv, fetchFromGitLab, fetchpatch, python, ensureNewerSourcesForZipFilesHook
# optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]`
, withTools ? null
}:
let
wafToolsArg = with stdenv.lib.strings;
optionalString (!isNull withTools) " --tools=\"${concatStringsSep "," withTools}\"";
in
stdenv.mkDerivation rec {
name = "waf-${version}";
version = "2.0.15";
@ -24,7 +30,7 @@ stdenv.mkDerivation rec {
python waf-light configure
'';
buildPhase = ''
python waf-light build
python waf-light build${wafToolsArg}
'';
installPhase = ''
install waf $out