python wrap.sh: wrap pypy and python shebangs
This commit is contained in:
parent
1dd36bc23f
commit
649e7d6fdb
|
@ -18,11 +18,11 @@ wrapPythonProgramsIn() {
|
||||||
for i in $(find "$dir" -type f -perm +0100); do
|
for i in $(find "$dir" -type f -perm +0100); do
|
||||||
|
|
||||||
# Rewrite "#! .../env python" to "#! /nix/store/.../python".
|
# Rewrite "#! .../env python" to "#! /nix/store/.../python".
|
||||||
if head -n1 "$i" | grep -q '#!.*/env.*python'; then
|
if head -n1 "$i" | grep -q '#!.*/env.*\(python\|pypy\)'; then
|
||||||
sed -i "$i" -e "1 s^.*/env[ ]*python^#! $python^"
|
sed -i "$i" -e "1 s^.*/env[ ]*\(python\|pypy\)^#! $python^"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if head -n1 "$i" | grep -q /@executable_name@; then
|
if head -n1 "$i" | grep -q '/python\|/pypy'; then
|
||||||
# dont wrap EGG-INFO scripts since they are called from python
|
# dont wrap EGG-INFO scripts since they are called from python
|
||||||
if echo "$i" | grep -v EGG-INFO/scripts; then
|
if echo "$i" | grep -v EGG-INFO/scripts; then
|
||||||
echo "wrapping \`$i'..."
|
echo "wrapping \`$i'..."
|
||||||
|
|
|
@ -28,7 +28,6 @@ pythonPackages = modules // import ./python-packages-generated.nix {
|
||||||
wrapPython = pkgs.makeSetupHook
|
wrapPython = pkgs.makeSetupHook
|
||||||
{ deps = pkgs.makeWrapper;
|
{ deps = pkgs.makeWrapper;
|
||||||
substitutions.libPrefix = python.libPrefix;
|
substitutions.libPrefix = python.libPrefix;
|
||||||
substitutions.executable_name = python.executable;
|
|
||||||
substitutions.executable = "${python}/bin/${python.executable}";
|
substitutions.executable = "${python}/bin/${python.executable}";
|
||||||
}
|
}
|
||||||
../development/python-modules/generic/wrap.sh;
|
../development/python-modules/generic/wrap.sh;
|
||||||
|
|
Loading…
Reference in New Issue