diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index 95d1a5192137..dd43068be279 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -97,9 +97,9 @@ filterExisting() { wrapProgram() { local prog="$1" local progBasename=$(basename $prog) - local hiddenDir=$(dirname $prog)/.$progBasename-wrapped-bin - local hidden=$hiddenDir/$progBasename - mkdir $hiddenDir + local hiddenDir="$(dirname $prog)/../wrapped-bin/.$progBasename-wrapped-bin" + mkdir -p $hiddenDir + local hidden="$(cd "$hiddenDir"; pwd)/$progBasename" mv $prog $hidden makeWrapper $hidden $prog "$@" }