diff --git a/pkgs/development/interpreters/tcl/tcl-package-hook.sh b/pkgs/development/interpreters/tcl/tcl-package-hook.sh index 747783cb1c27..41603037931f 100644 --- a/pkgs/development/interpreters/tcl/tcl-package-hook.sh +++ b/pkgs/development/interpreters/tcl/tcl-package-hook.sh @@ -2,6 +2,8 @@ # * wrap any installed executables with a wrapper that configures TCLLIBPATH # * write a setup hook that extends the TCLLIBPATH of any anti-dependencies +tclWrapperArgs=( ${tclWrapperArgs-} ) + # Add a directory to TCLLIBPATH, provided that it exists _addToTclLibPath() { local tclPkg="$1" @@ -50,10 +52,12 @@ wrapTclBins() { return fi + tclWrapperArgs+=(--prefix TCLLIBPATH ' ' "$TCLLIBPATH") + find "$tclBinsDir" -type f -executable -print | while read -r someBin; do echo "Adding TCLLIBPATH wrapper for $someBin" - wrapProgram "$someBin" --prefix TCLLIBPATH ' ' "$TCLLIBPATH" + wrapProgram "$someBin" "${tclWrapperArgs[@]}" done } diff --git a/pkgs/games/scid-vs-pc/default.nix b/pkgs/games/scid-vs-pc/default.nix index 2837f96357a7..9d3cdeb02e93 100644 --- a/pkgs/games/scid-vs-pc/default.nix +++ b/pkgs/games/scid-vs-pc/default.nix @@ -42,6 +42,7 @@ tcl.mkTclDerivation rec { dontPatchShebangs = true; + # TODO: can this use tclWrapperArgs? postFixup = '' sed -i -e '1c#!'"$out"'/bin/tcscid' "$out/bin/scidpgn" sed -i -e '1c#!${tk}/bin/wish' "$out/bin/sc_remote" diff --git a/pkgs/games/scid/default.nix b/pkgs/games/scid/default.nix index 43794f6bc255..a1955e9cced0 100644 --- a/pkgs/games/scid/default.nix +++ b/pkgs/games/scid/default.nix @@ -31,6 +31,7 @@ tcl.mkTclDerivation { dontPatchShebangs = true; + # TODO: can this use tclWrapperArgs? postFixup = '' for cmd in sc_addmove sc_eco sc_epgn scidpgn \ sc_import sc_spell sc_tree spliteco diff --git a/pkgs/tools/misc/expect/default.nix b/pkgs/tools/misc/expect/default.nix index 03e8e260ac6b..5a792c040b39 100644 --- a/pkgs/tools/misc/expect/default.nix +++ b/pkgs/tools/misc/expect/default.nix @@ -25,10 +25,9 @@ tcl.mkTclDerivation rec { strictDeps = true; hardeningDisable = [ "format" ]; - postInstall = lib.optionalString stdenv.isDarwin '' - for i in $out/bin/*; do - wrapProgram $i --prefix DYLD_LIBRARY_PATH : $out/lib/expect${version} - done + postInstall = '' + tclWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ tcl ]}) + ${lib.optionalString stdenv.isDarwin "tclWrapperArgs+=(--prefix DYLD_LIBRARY_PATH : $out/lib/expect${version})"} ''; outputs = [ "out" "dev" ];