aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/ocaml-modules/ppx_tools
diff options
context:
space:
mode:
authorThéophane Hufschmitt <theophane.hufschmitt@polytechnique.org>2016-07-20 14:51:20 +0200
committerThéophane Hufschmitt <theophane.hufschmitt@polytechnique.org>2016-08-04 14:44:34 +0200
commitf0bbb906e95ee6ff146cad5fdfe568b9653f4b2b (patch)
tree39baa88ffb7f2a6b2fedd4a9b08f99b899269fd1 /pkgs/development/ocaml-modules/ppx_tools
parent7bb3a04064c622628876a984531aa72c3f904152 (diff)
ocamlPackages.ppx_tools : Add a version for ocaml 4.03
Diffstat (limited to 'pkgs/development/ocaml-modules/ppx_tools')
-rw-r--r--pkgs/development/ocaml-modules/ppx_tools/default.nix43
1 files changed, 26 insertions, 17 deletions
diff --git a/pkgs/development/ocaml-modules/ppx_tools/default.nix b/pkgs/development/ocaml-modules/ppx_tools/default.nix
index 377dc32751a7..33bf180cd7f3 100644
--- a/pkgs/development/ocaml-modules/ppx_tools/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_tools/default.nix
@@ -1,21 +1,30 @@
-{ stdenv, fetchzip, ocaml, findlib }:
+{ stdenv, fetchFromGitHub, ocaml, findlib }:
-stdenv.mkDerivation {
- name = "ocaml-ppx_tools-5.0+4.02";
- src = fetchzip {
- url = https://github.com/alainfrisch/ppx_tools/archive/5.0+4.02.0.tar.gz;
- sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8";
- };
+let
+ version =
+ if stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.03" then "5.0+4.03.0" else "5.0+4.02.0";
+in
+ stdenv.mkDerivation {
+ name = "ocaml-ppx_tools-${version}";
+ src = fetchFromGitHub {
+ owner = "alainfrisch";
+ repo = "ppx_tools";
+ rev = version;
+ sha256 = if version == "5.0+4.03.0"
+ then "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"
+ else "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"
+ ;
+ };
- buildInputs = [ ocaml findlib ];
+ buildInputs = [ ocaml findlib ];
- createFindlibDestdir = true;
+ createFindlibDestdir = true;
- meta = with stdenv.lib; {
- description = "Tools for authors of ppx rewriters";
- homepage = http://www.lexifi.com/ppx_tools;
- license = licenses.mit;
- platforms = ocaml.meta.platforms or [];
- maintainers = with maintainers; [ vbgl ];
- };
-}
+ meta = with stdenv.lib; {
+ description = "Tools for authors of ppx rewriters";
+ homepage = http://www.lexifi.com/ppx_tools;
+ license = licenses.mit;
+ platforms = ocaml.meta.platforms or [];
+ maintainers = with maintainers; [ vbgl ];
+ };
+ }