A stdenv derivation replaces shebang line in shell scripts during fixupPhase. Current strategy is that when this meets #!/usr/bin/env (interpreter command), it replaces the whole line with actual command for the interpreter. Therefore, for example, the first line of a python script starting with
is changed to
#!/nix/store/....-python-2.7.6-wrapper/bin/python
This works in linux systems, but does not work on BSD flavored systems like OS X since they do not allow another shell script to play a role as an interpreter.
A relevant link is here:
http://www.in-ulm.de/~mascheck/various/shebang/#interpreter-script
I suggest to keep /usr/bin/env as /nix/store/...-coreutils-../bin/env when being replaced by patchShebangs during fixupPhase
A stdenv derivation replaces shebang line in shell scripts during
fixupPhase. Current strategy is that when this meets#!/usr/bin/env (interpreter command), it replaces the whole line with actual command for the interpreter. Therefore, for example, the first line of a python script starting withis changed to
This works in linux systems, but does not work on BSD flavored systems like OS X since they do not allow another shell script to play a role as an interpreter.
A relevant link is here:
http://www.in-ulm.de/~mascheck/various/shebang/#interpreter-script
I suggest to keep
/usr/bin/envas/nix/store/...-coreutils-../bin/envwhen being replaced bypatchShebangsduringfixupPhase