···
···
versionOlder (versions.major (getVersion erlang)) maxShiftMajor;
61
+
minAssert = versionAtLeast (getVersion erlang) minimumOTPVersion;
62
+
bothAssert = minAssert && maxAssert;
if stdenv.hostPlatform.isDarwin then
···
erlc_opts = [ "deterministic" ] ++ optionals debugInfo [ "debug_info" ];
73
-
assert assertMsg (versionAtLeast (getVersion erlang) minimumOTPVersion) compatibilityMsg;
74
-
assert assertMsg maxAssert compatibilityMsg;
76
+
if !config.allowAliases && !bothAssert then
77
+
# Don't throw without aliases to not break CI.
80
+
assert assertMsg bothAssert compatibilityMsg;
81
+
stdenv.mkDerivation {
82
+
pname = "${baseName}";
76
-
stdenv.mkDerivation {
77
-
pname = "${baseName}";
84
+
inherit src version debugInfo;
79
-
inherit src version debugInfo;
86
+
nativeBuildInputs = [ makeWrapper ];
87
+
buildInputs = [ erlang ];
81
-
nativeBuildInputs = [ makeWrapper ];
82
-
buildInputs = [ erlang ];
91
+
LC_TYPE = "C.UTF-8";
92
+
DESTDIR = placeholder "out";
94
+
ERL_COMPILER_OPTIONS = "[${concatStringsSep "," erlc_opts}]";
86
-
LC_TYPE = "C.UTF-8";
87
-
DESTDIR = placeholder "out";
89
-
ERL_COMPILER_OPTIONS = "[${concatStringsSep "," erlc_opts}]";
98
+
patchShebangs ${escriptPath} || true
93
-
patchShebangs ${escriptPath} || true
101
+
# copy stdlib source files for LSP access
104
+
cp -R "$d/lib" "$out/lib/elixir/$d"
96
-
# copy stdlib source files for LSP access
99
-
cp -R "$d/lib" "$out/lib/elixir/$d"
109
+
# Elixir binaries are shell scripts which run erl. Add some stuff
110
+
# to PATH so the scripts can run without problems.
104
-
# Elixir binaries are shell scripts which run erl. Add some stuff
105
-
# to PATH so the scripts can run without problems.
112
+
for f in $out/bin/*; do
114
+
if [ "$b" = mix ]; then continue; fi
116
+
--prefix PATH ":" "${
107
-
for f in $out/bin/*; do
109
-
if [ "$b" = mix ]; then continue; fi
111
-
--prefix PATH ":" "${
126
+
substituteInPlace $out/bin/mix \
127
+
--replace "/usr/bin/env elixir" "${elixirShebang}"
121
-
substituteInPlace $out/bin/mix \
122
-
--replace "/usr/bin/env elixir" "${elixirShebang}"
130
+
passthru.updateScript = nix-update-script {
133
+
"v(${lib.versions.major version}\\.${lib.versions.minor version}\\.[0-9\\-rc.]+)"
134
+
"--override-filename"
135
+
"pkgs/development/interpreters/elixir/${lib.versions.major version}.${lib.versions.minor version}.nix"
125
-
passthru.updateScript = nix-update-script {
128
-
"v(${lib.versions.major version}\\.${lib.versions.minor version}\\.[0-9\\-rc.]+)"
129
-
"--override-filename"
130
-
"pkgs/development/interpreters/elixir/${lib.versions.major version}.${lib.versions.minor version}.nix"
139
+
pos = builtins.unsafeGetAttrPos "sha256" args;
141
+
homepage = "https://elixir-lang.org/";
142
+
description = "Functional, meta-programming aware language built on top of the Erlang VM";
134
-
pos = builtins.unsafeGetAttrPos "sha256" args;
136
-
homepage = "https://elixir-lang.org/";
137
-
description = "Functional, meta-programming aware language built on top of the Erlang VM";
139
-
longDescription = ''
140
-
Elixir is a functional, meta-programming aware language built on
141
-
top of the Erlang VM. It is a dynamic language with flexible
142
-
syntax and macro support that leverages Erlang's abilities to
143
-
build concurrent, distributed and fault-tolerant applications
144
-
with hot code upgrades.
144
+
longDescription = ''
145
+
Elixir is a functional, meta-programming aware language built on
146
+
top of the Erlang VM. It is a dynamic language with flexible
147
+
syntax and macro support that leverages Erlang's abilities to
148
+
build concurrent, distributed and fault-tolerant applications
149
+
with hot code upgrades.
147
-
license = licenses.asl20;
148
-
platforms = platforms.unix;
149
-
teams = [ teams.beam ];
152
+
license = licenses.asl20;
153
+
platforms = platforms.unix;
154
+
teams = [ teams.beam ];