waf: make executable runnable (#388010)

authored by Dmitry Kalinkin and committed by GitHub 1da8df70 9f7eb433

+12 -5
+1 -1
doc/hooks/waf.section.md
··· 14 14 15 15 Location of the `waf` tool. It defaults to `./waf`, to honor software projects that include it directly inside their source trees. 16 16 17 - If `wafPath` doesn't exist, then `wafHook` will copy the `waf` provided from Nixpkgs to it. 17 + If the file pointed by `wafPath` doesn't exist, then `waf` provided by Nixpkgs will be used. 18 18 19 19 #### `wafFlags` {#waf-flags} 20 20
+10 -2
pkgs/by-name/wa/waf/package.nix
··· 4 4 , callPackage 5 5 , ensureNewerSourcesForZipFilesHook 6 6 , python3 7 + , makeWrapper 7 8 # optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]` 8 9 , extraTools ? [] 9 10 }: ··· 22 23 nativeBuildInputs = [ 23 24 ensureNewerSourcesForZipFilesHook 24 25 python3 26 + makeWrapper 25 27 ]; 26 28 27 29 buildInputs = [ ··· 48 50 runHook preBuild 49 51 50 52 python waf-light build ${extraToolsList} 53 + 54 + substituteInPlace waf \ 55 + --replace "w = test(i + '/lib/' + dirname)" \ 56 + "w = test('$out/${python3.sitePackages}')" 51 57 52 58 runHook postBuild 53 59 ''; ··· 55 61 installPhase = '' 56 62 runHook preInstall 57 63 58 - install -D waf $out/bin/waf 59 - 64 + install -D waf "$out"/bin/waf 65 + wrapProgram "$out"/bin/waf --set PYTHONPATH "$out"/${python3.sitePackages} 66 + mkdir -p "$out"/${python3.sitePackages}/ 67 + cp -r waflib "$out"/${python3.sitePackages}/ 60 68 runHook postInstall 61 69 ''; 62 70
+1 -2
pkgs/by-name/wa/waf/setup-hook.sh
··· 4 4 runHook preConfigure 5 5 6 6 if ! [ -f "${wafPath:=./waf}" ]; then 7 - echo "copying waf to $wafPath..." 8 - cp @waf@/bin/waf "$wafPath" 7 + wafPath="@waf@/bin/waf" 9 8 fi 10 9 11 10 if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then