mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-20 15:41:16 +00:00
elixir: use env shebang only on Darwin
This commit is contained in:
@@ -57,6 +57,16 @@ let
|
||||
true
|
||||
else
|
||||
versionOlder (versions.major (getVersion erlang)) maxShiftMajor;
|
||||
|
||||
elixirShebang =
|
||||
if stdenv.hostPlatform.isDarwin then
|
||||
# Darwin disallows shebang scripts from using other scripts as their
|
||||
# command. Use env as an intermediary instead of calling elixir directly
|
||||
# (another shebang script).
|
||||
# See https://github.com/NixOS/nixpkgs/pull/9671
|
||||
"${coreutils}/bin/env $out/bin/elixir"
|
||||
else
|
||||
"$out/bin/elixir";
|
||||
in
|
||||
assert assertMsg (versionAtLeast (getVersion erlang) minimumOTPVersion) compatibilityMsg;
|
||||
assert assertMsg maxAssert compatibilityMsg;
|
||||
@@ -104,7 +114,7 @@ stdenv.mkDerivation ({
|
||||
done
|
||||
|
||||
substituteInPlace $out/bin/mix \
|
||||
--replace "/usr/bin/env elixir" "${coreutils}/bin/env $out/bin/elixir"
|
||||
--replace "/usr/bin/env elixir" "${elixirShebang}"
|
||||
'';
|
||||
|
||||
pos = builtins.unsafeGetAttrPos "sha256" args;
|
||||
|
||||
Reference in New Issue
Block a user