diff options
author | Naïm Favier <n@monade.li> | 2022-03-14 18:47:29 +0100 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-03-18 18:55:58 +0100 |
commit | 10479e4f51ff182651ccff4a71b2a94ab93816c0 (patch) | |
tree | 036a04f546e167ebfc80e7579e81f84d024b2cda /pkgs | |
parent | c377a6f7f5c79a12c0e2c75fa09adbdab6843d24 (diff) | |
download | nixpkgs-10479e4f51ff182651ccff4a71b2a94ab93816c0.tar nixpkgs-10479e4f51ff182651ccff4a71b2a94ab93816c0.tar.gz nixpkgs-10479e4f51ff182651ccff4a71b2a94ab93816c0.tar.bz2 nixpkgs-10479e4f51ff182651ccff4a71b2a94ab93816c0.tar.lz nixpkgs-10479e4f51ff182651ccff4a71b2a94ab93816c0.tar.xz nixpkgs-10479e4f51ff182651ccff4a71b2a94ab93816c0.tar.zst nixpkgs-10479e4f51ff182651ccff4a71b2a94ab93816c0.zip |
makeWrapper: add `--chdir`
For symmetry with `makeBinaryWrapper`.
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/setup-hooks/make-wrapper.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index fa606583289..7d598956168 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -18,6 +18,7 @@ assertExecutable() { # --set-default VAR VAL : like --set, but only adds VAR if not already set in # the environment # --unset VAR : remove VAR from the environment +# --chdir DIR : change working directory (use instead of --run "cd DIR") # --run COMMAND : run command before the executable # --add-flags FLAGS : add FLAGS to invocation of executable @@ -126,6 +127,10 @@ makeWrapper() { varName="${params[$((n + 1))]}" n=$((n + 1)) echo "unset $varName" >> "$wrapper" + elif [[ "$p" == "--chdir" ]]; then + dir="${params[$((n + 1))]}" + n=$((n + 1)) + echo "cd ${dir@Q}" >> "$wrapper" elif [[ "$p" == "--run" ]]; then command="${params[$((n + 1))]}" n=$((n + 1)) |