mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
waf: make executable runnable (#388010)
This commit is contained in:
parent
9f7eb43375
commit
1da8df70f6
3 changed files with 12 additions and 5 deletions
|
@ -14,7 +14,7 @@ The variables below are exclusive of `wafHook`.
|
|||
|
||||
Location of the `waf` tool. It defaults to `./waf`, to honor software projects that include it directly inside their source trees.
|
||||
|
||||
If `wafPath` doesn't exist, then `wafHook` will copy the `waf` provided from Nixpkgs to it.
|
||||
If the file pointed by `wafPath` doesn't exist, then `waf` provided by Nixpkgs will be used.
|
||||
|
||||
#### `wafFlags` {#waf-flags}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
, callPackage
|
||||
, ensureNewerSourcesForZipFilesHook
|
||||
, python3
|
||||
, makeWrapper
|
||||
# optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]`
|
||||
, extraTools ? []
|
||||
}:
|
||||
|
@ -22,6 +23,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
nativeBuildInputs = [
|
||||
ensureNewerSourcesForZipFilesHook
|
||||
python3
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
|
@ -49,14 +51,20 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
python waf-light build ${extraToolsList}
|
||||
|
||||
substituteInPlace waf \
|
||||
--replace "w = test(i + '/lib/' + dirname)" \
|
||||
"w = test('$out/${python3.sitePackages}')"
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -D waf $out/bin/waf
|
||||
|
||||
install -D waf "$out"/bin/waf
|
||||
wrapProgram "$out"/bin/waf --set PYTHONPATH "$out"/${python3.sitePackages}
|
||||
mkdir -p "$out"/${python3.sitePackages}/
|
||||
cp -r waflib "$out"/${python3.sitePackages}/
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
|
|
|
@ -4,8 +4,7 @@ wafConfigurePhase() {
|
|||
runHook preConfigure
|
||||
|
||||
if ! [ -f "${wafPath:=./waf}" ]; then
|
||||
echo "copying waf to $wafPath..."
|
||||
cp @waf@/bin/waf "$wafPath"
|
||||
wafPath="@waf@/bin/waf"
|
||||
fi
|
||||
|
||||
if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue