From 97e4c19fcaa01fcc7f456f3896cbddccb25a6bb6 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Fri, 22 Apr 2016 19:30:26 +0300 Subject: [PATCH] wrapPython: drop python suffixes --- pkgs/development/python-modules/generic/wrap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh index fa6a4d0102f..a67ea51f5a9 100644 --- a/pkgs/development/python-modules/generic/wrap.sh +++ b/pkgs/development/python-modules/generic/wrap.sh @@ -28,8 +28,10 @@ wrapPythonProgramsIn() { # Find all regular files in the output directory that are executable. for f in $(find "$dir" -type f -perm -0100); do # Rewrite "#! .../env python" to "#! /nix/store/.../python". + # Strip suffix, like "3" or "2.7m" -- we don't have any choice on which + # Python to use besides one in $python anyway. if head -n1 "$f" | grep -q '#!.*/env.*\(python\|pypy\)'; then - sed -i "$f" -e "1 s^.*/env[ ]*\(python\|pypy\)^#! $python^" + sed -i "$f" -e "1 s^.*/env[ ]*\(python\|pypy\)[^ ]*^#! $python^" fi # catch /python and /.python-wrapped