ocamlPackages.ppx_tools: minor refactoring
This commit is contained in:
parent
f697e5ae3b
commit
0caeaf4cdd
@ -1,19 +1,21 @@
|
|||||||
{ stdenv, fetchFromGitHub, ocaml, findlib }:
|
{ stdenv, fetchFromGitHub, ocaml, findlib }:
|
||||||
|
|
||||||
let
|
let param = {
|
||||||
version =
|
"4.02.3" = {
|
||||||
if stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.03" then "5.0+4.03.0" else "5.0+4.02.0";
|
version = "5.0+4.02.0";
|
||||||
|
sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"; };
|
||||||
|
"4.03.0" = {
|
||||||
|
version = "5.0+4.03.0";
|
||||||
|
sha256 = "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"; };
|
||||||
|
}."${ocaml.version}";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "ocaml-ppx_tools-${version}";
|
name = "ocaml${ocaml.version}-ppx_tools-${param.version}";
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "alainfrisch";
|
owner = "alainfrisch";
|
||||||
repo = "ppx_tools";
|
repo = "ppx_tools";
|
||||||
rev = version;
|
rev = param.version;
|
||||||
sha256 = if version == "5.0+4.03.0"
|
inherit (param) sha256;
|
||||||
then "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"
|
|
||||||
else "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"
|
|
||||||
;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ocaml findlib ];
|
buildInputs = [ ocaml findlib ];
|
||||||
|
Loading…
Reference in New Issue
Block a user