Make assertion for OTP version in the generic elixir builder

Changed Elixir 1.5 to include the fact it is an rc release
This commit is contained in:
Justin Wood 2017-06-26 23:09:11 -04:00
parent 803797c6d6
commit 46faaa69b8
5 changed files with 63 additions and 57 deletions

View File

@ -62,12 +62,8 @@ rec {
inherit (stdenv.lib) versionAtLeast; inherit (stdenv.lib) versionAtLeast;
builder = callPackage ../interpreters/elixir/generic-builder.nix args; builder = callPackage ../interpreters/elixir/generic-builder.nix args;
in in
if versionAtLeast (getVersion args.erlang) vsn
then
callPackage drv { callPackage drv {
mkDerivation = pkgs.makeOverridable builder; mkDerivation = pkgs.makeOverridable builder;
} };
else
throw "Elixir requires at least Erlang/OTP R${vsn}.";
} }

View File

@ -3,4 +3,5 @@
mkDerivation rec { mkDerivation rec {
version = "1.3.4"; version = "1.3.4";
sha256 = "01qqv1ghvfadcwcr5p88w8j217cgaf094pmpqllij3l0q1yg104l"; sha256 = "01qqv1ghvfadcwcr5p88w8j217cgaf094pmpqllij3l0q1yg104l";
minimumOTPVersion = "18";
} }

View File

@ -3,4 +3,5 @@
mkDerivation rec { mkDerivation rec {
version = "1.4.5"; version = "1.4.5";
sha256 = "18ivcxmh5bak13k3rjy7jjzin57rgb2nffhwnqb2wl7bpi8mrarw"; sha256 = "18ivcxmh5bak13k3rjy7jjzin57rgb2nffhwnqb2wl7bpi8mrarw";
minimumOTPVersion = "18";
} }

View File

@ -3,4 +3,5 @@
mkDerivation rec { mkDerivation rec {
version = "1.5.0-rc.0"; version = "1.5.0-rc.0";
sha256 = "1p0sawz86w9na56c42ivdacqxzldjb9s9cvl2isj3sy4nwsa0l0j"; sha256 = "1p0sawz86w9na56c42ivdacqxzldjb9s9cvl2isj3sy4nwsa0l0j";
minimumOTPVersion = "18";
} }

View File

@ -1,14 +1,21 @@
{ pkgs, stdenv, fetchFromGitHub, erlang, rebar, makeWrapper, coreutils, curl { pkgs, stdenv, fetchFromGitHub, erlang, rebar, makeWrapper,
, bash, debugInfo ? false }: coreutils, curl, bash, debugInfo ? false }:
{ baseName ? "elixir" { baseName ? "elixir"
, version , version
, minimumOTPVersion
, sha256 ? null , sha256 ? null
, rev ? "v${version}" , rev ? "v${version}"
, src ? fetchFromGitHub { inherit rev sha256; owner = "elixir-lang"; repo = "elixir"; } , src ? fetchFromGitHub { inherit rev sha256; owner = "elixir-lang"; repo = "elixir"; }
}: }:
stdenv.mkDerivation ({ let
inherit (stdenv.lib) getVersion versionAtLeast;
in
assert versionAtLeast (getVersion erlang) minimumOTPVersion;
stdenv.mkDerivation ({
name = "${baseName}-${version}"; name = "${baseName}-${version}";
inherit src version; inherit src version;
@ -67,4 +74,4 @@ stdenv.mkDerivation ({
platforms = platforms.unix; platforms = platforms.unix;
maintainers = with maintainers; [ the-kenny havvy couchemar ankhers ]; maintainers = with maintainers; [ the-kenny havvy couchemar ankhers ];
}; };
}) })