diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh index 33b9a06f6080..b6d2a66afff6 100644 --- a/pkgs/development/python-modules/generic/wrap.sh +++ b/pkgs/development/python-modules/generic/wrap.sh @@ -37,6 +37,9 @@ wrapPythonProgramsIn() { # dont wrap EGG-INFO scripts since they are called from python if echo "$f" | grep -qv EGG-INFO/scripts; then echo "wrapping \`$f'..." + # The magicalSedExpression will invoke a "$(basename "$f")", so + # if you change $f to something else, be sure to also change it + # in pkgs/top-level/python-packages.nix! sed -i "$f" -re '@magicalSedExpression@' # wrapProgram creates the executable shell script described # above. The script will set PYTHONPATH and PATH variables.! diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d2aecc941581..3e9e07361dc6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -68,7 +68,7 @@ let /\\$/{N;br} /__future__|^ *(#.*)?$/{n;br} ${concatImapStrings mkStringSkipper quoteVariants} - /^ *[^# ]/i import sys; sys.argv[0] = '"'$(basename "$i")'"' + /^ *[^# ]/i import sys; sys.argv[0] = '"'$(basename "$f")'"' } ''; }