Generalize building of Elixir interpreter
This commit is contained in:
parent
3270545094
commit
019afb0c80
@ -42,6 +42,7 @@
|
|||||||
andrewrk = "Andrew Kelley <superjoe30@gmail.com>";
|
andrewrk = "Andrew Kelley <superjoe30@gmail.com>";
|
||||||
andsild = "Anders Sildnes <andsild@gmail.com>";
|
andsild = "Anders Sildnes <andsild@gmail.com>";
|
||||||
aneeshusa = "Aneesh Agrawal <aneeshusa@gmail.com>";
|
aneeshusa = "Aneesh Agrawal <aneeshusa@gmail.com>";
|
||||||
|
ankhers = "Justin Wood <justin.k.wood@gmail.com>";
|
||||||
antono = "Antono Vasiljev <self@antono.info>";
|
antono = "Antono Vasiljev <self@antono.info>";
|
||||||
apeschar = "Albert Peschar <albert@peschar.net>";
|
apeschar = "Albert Peschar <albert@peschar.net>";
|
||||||
apeyroux = "Alexandre Peyroux <alex@px.io>";
|
apeyroux = "Alexandre Peyroux <alex@px.io>";
|
||||||
|
@ -37,9 +37,16 @@ let
|
|||||||
buildMix = callPackage ./build-mix.nix {};
|
buildMix = callPackage ./build-mix.nix {};
|
||||||
|
|
||||||
# BEAM-based languages.
|
# BEAM-based languages.
|
||||||
elixir = if versionAtLeast (lib.getVersion erlang) "18"
|
elixir = defaultScope.elixir-1_4;
|
||||||
then callPackage ../interpreters/elixir { debugInfo = true; }
|
|
||||||
else throw "Elixir requires at least Erlang/OTP R18.";
|
elixir-1_4 = if versionAtLeast (lib.getVersion erlang) "18"
|
||||||
|
then lib.callElixir ../interpreters/elixir/1.4.nix { debugInfo = true; }
|
||||||
|
else throw "Elixir requires at least Erlang/OTP R18.";
|
||||||
|
|
||||||
|
elixir-1_3 = if versionAtLeast (lib.getVersion erlang) "18"
|
||||||
|
then lib.callElixir ../interpreters/elixir/1.3.nix { debugInfo = true; }
|
||||||
|
else throw "Elixir requires at least Erlang/OTP R18.";
|
||||||
|
|
||||||
lfe = callPackage ../interpreters/lfe { };
|
lfe = callPackage ../interpreters/lfe { };
|
||||||
|
|
||||||
# Non hex packages
|
# Non hex packages
|
||||||
|
@ -43,4 +43,12 @@ rec {
|
|||||||
mkDerivation = pkgs.makeOverridable builder;
|
mkDerivation = pkgs.makeOverridable builder;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
callElixir = drv: args:
|
||||||
|
let
|
||||||
|
builder = callPackage ../../development/interpreters/elixir/generic-builder.nix args;
|
||||||
|
in
|
||||||
|
callPackage drv {
|
||||||
|
mkDerivation = pkgs.makeOverridable builder;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
6
pkgs/development/interpreters/elixir/1.3.nix
Normal file
6
pkgs/development/interpreters/elixir/1.3.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{ mkDerivation }:
|
||||||
|
|
||||||
|
mkDerivation rec {
|
||||||
|
version = "1.3.4";
|
||||||
|
sha256 = "01qqv1ghvfadcwcr5p88w8j217cgaf094pmpqllij3l0q1yg104l";
|
||||||
|
}
|
6
pkgs/development/interpreters/elixir/1.4.nix
Normal file
6
pkgs/development/interpreters/elixir/1.4.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{ mkDerivation }:
|
||||||
|
|
||||||
|
mkDerivation rec {
|
||||||
|
version = "1.4.5";
|
||||||
|
sha256 = "18ivcxmh5bak13k3rjy7jjzin57rgb2nffhwnqb2wl7bpi8mrarw";
|
||||||
|
}
|
@ -1,21 +1,20 @@
|
|||||||
{ stdenv, fetchFromGitHub, erlang, rebar, makeWrapper, coreutils, curl, bash,
|
{ pkgs, stdenv, fetchFromGitHub, erlang, rebar, makeWrapper, coreutils, curl
|
||||||
debugInfo ? false }:
|
, bash, debugInfo ? false }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
{ baseName ? "elixir"
|
||||||
name = "elixir-${version}";
|
, version
|
||||||
version = "1.4.4";
|
, sha256 ? null
|
||||||
|
, rev ? "v${version}"
|
||||||
|
, src ? fetchFromGitHub { inherit rev sha256; owner = "elixir-lang"; repo = "elixir"; }
|
||||||
|
}:
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
stdenv.mkDerivation ({
|
||||||
owner = "elixir-lang";
|
name = "${baseName}-${version}";
|
||||||
repo = "elixir";
|
|
||||||
rev = "v${version}";
|
inherit src version;
|
||||||
sha256 = "0m51cirkv1dahw4z2jlmz58cwmpy0dya88myx4wykq0v5bh1xbq8";
|
|
||||||
};
|
|
||||||
|
|
||||||
buildInputs = [ erlang rebar makeWrapper ];
|
buildInputs = [ erlang rebar makeWrapper ];
|
||||||
|
|
||||||
# Elixir expects that UTF-8 locale to be set (see https://github.com/elixir-lang/elixir/issues/3548).
|
|
||||||
# In other cases there is warnings during compilation.
|
|
||||||
LANG = "en_US.UTF-8";
|
LANG = "en_US.UTF-8";
|
||||||
LC_TYPE = "en_US.UTF-8";
|
LC_TYPE = "en_US.UTF-8";
|
||||||
|
|
||||||
@ -66,6 +65,6 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
license = licenses.epl10;
|
license = licenses.epl10;
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
maintainers = with maintainers; [ the-kenny havvy couchemar ];
|
maintainers = with maintainers; [ the-kenny havvy couchemar ankhers ];
|
||||||
};
|
};
|
||||||
}
|
})
|
@ -57,6 +57,9 @@ rec {
|
|||||||
# access for example elixir built with different version of Erlang, use
|
# access for example elixir built with different version of Erlang, use
|
||||||
# `beam.packages.erlangR19.elixir`.
|
# `beam.packages.erlangR19.elixir`.
|
||||||
elixir = packages.erlang.elixir;
|
elixir = packages.erlang.elixir;
|
||||||
|
elixir-1_4 = packages.erlang.elixir-1_4;
|
||||||
|
elixir-1_3 = packages.erlang.elixir-1_3;
|
||||||
|
|
||||||
lfe = packages.erlang.lfe;
|
lfe = packages.erlang.lfe;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user