@@ -1,21 +1,30 @@
1−{ stdenv, fetchzip, ocaml, findlib }:
1+{ stdenv, fetchFromGitHub, ocaml, findlib }:
22
3−stdenv.mkDerivation {
4− name = "ocaml-ppx_tools-5.0+4.02";
5− src = fetchzip {
6− url = https://github.com/alainfrisch/ppx_tools/archive/5.0+4.02.0.tar.gz;
7− sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8";
8− };
3+let
4+ version =
5+ if stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.03" then "5.0+4.03.0" else "5.0+4.02.0";
6+in
7+ stdenv.mkDerivation {
8+ name = "ocaml-ppx_tools-${version}";
9+ src = fetchFromGitHub {
10+ owner = "alainfrisch";
11+ repo = "ppx_tools";
12+ rev = version;
13+ sha256 = if version == "5.0+4.03.0"
14+ then "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"
15+ else "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"
16+ ;
17+ };
918
10− buildInputs = [ ocaml findlib ];
19+ buildInputs = [ ocaml findlib ];
1120
12− createFindlibDestdir = true;
21+ createFindlibDestdir = true;
1322
14− meta = with stdenv.lib; {
15− description = "Tools for authors of ppx rewriters";
16− homepage = http://www.lexifi.com/ppx_tools;
17− license = licenses.mit;
18− platforms = ocaml.meta.platforms or [];
19− maintainers = with maintainers; [ vbgl ];
20− };
21−}
23+ meta = with stdenv.lib; {
24+ description = "Tools for authors of ppx rewriters";
25+ homepage = http://www.lexifi.com/ppx_tools;
26+ license = licenses.mit;
27+ platforms = ocaml.meta.platforms or [];
28+ maintainers = with maintainers; [ vbgl ];
29+ };
30+ }