Python: wrapPythonPrograms: only wrap in $out/bin
Thus far all executables in a derivation were wrapped. This commit only wraps executables in $out/bin. If other scripts need to be wrapped as well, then one can use wrapPythonProgramsIn.
This commit is contained in:
parent
dc2250eb5e
commit
c10af9e744
@ -1,7 +1,7 @@
|
|||||||
# Wrapper around wrapPythonProgramsIn, below. The $pythonPath
|
# Wrapper around wrapPythonProgramsIn, below. The $pythonPath
|
||||||
# variable is passed in from the buildPythonPackage function.
|
# variable is passed in from the buildPythonPackage function.
|
||||||
wrapPythonPrograms() {
|
wrapPythonPrograms() {
|
||||||
wrapPythonProgramsIn $out "$out $pythonPath"
|
wrapPythonProgramsIn "$out/bin" "$out $pythonPath"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Builds environment variables like PYTHONPATH and PATH walking through closure
|
# Builds environment variables like PYTHONPATH and PATH walking through closure
|
||||||
@ -47,6 +47,7 @@ wrapPythonProgramsIn() {
|
|||||||
buildPythonPath "$pythonPath"
|
buildPythonPath "$pythonPath"
|
||||||
|
|
||||||
# Find all regular files in the output directory that are executable.
|
# Find all regular files in the output directory that are executable.
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
find "$dir" -type f -perm -0100 -print0 | while read -d "" f; do
|
find "$dir" -type f -perm -0100 -print0 | while read -d "" f; do
|
||||||
# Rewrite "#! .../env python" to "#! /nix/store/.../python".
|
# Rewrite "#! .../env python" to "#! /nix/store/.../python".
|
||||||
# Strip suffix, like "3" or "2.7m" -- we don't have any choice on which
|
# Strip suffix, like "3" or "2.7m" -- we don't have any choice on which
|
||||||
@ -75,6 +76,7 @@ wrapPythonProgramsIn() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adds the lib and bin directories to the PYTHONPATH and PATH variables,
|
# Adds the lib and bin directories to the PYTHONPATH and PATH variables,
|
||||||
|
Loading…
Reference in New Issue
Block a user