summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ppx_tools
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2016-11-26 10:13:02 +0100
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-01-24 21:13:00 +0000
commit0caeaf4cdddaf53301b90d82f4840d732918c76d (patch)
tree23d7d5aa7c11838287630dbeae665ee168904c00 /pkgs/development/ocaml-modules/ppx_tools
parentf697e5ae3b573616dec1f3b0bf9e0502cb96c88c (diff)
downloadnixpkgs-0caeaf4cdddaf53301b90d82f4840d732918c76d.tar
nixpkgs-0caeaf4cdddaf53301b90d82f4840d732918c76d.tar.gz
nixpkgs-0caeaf4cdddaf53301b90d82f4840d732918c76d.tar.bz2
nixpkgs-0caeaf4cdddaf53301b90d82f4840d732918c76d.tar.lz
nixpkgs-0caeaf4cdddaf53301b90d82f4840d732918c76d.tar.xz
nixpkgs-0caeaf4cdddaf53301b90d82f4840d732918c76d.tar.zst
nixpkgs-0caeaf4cdddaf53301b90d82f4840d732918c76d.zip
ocamlPackages.ppx_tools: minor refactoring
Diffstat (limited to 'pkgs/development/ocaml-modules/ppx_tools')
-rw-r--r--pkgs/development/ocaml-modules/ppx_tools/default.nix20
1 files changed, 11 insertions, 9 deletions
diff --git a/pkgs/development/ocaml-modules/ppx_tools/default.nix b/pkgs/development/ocaml-modules/ppx_tools/default.nix
index 33bf180cd7f..b6a6039a4fa 100644
--- a/pkgs/development/ocaml-modules/ppx_tools/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_tools/default.nix
@@ -1,19 +1,21 @@
 { stdenv, fetchFromGitHub, ocaml, findlib }:
 
-let
-  version =
-  if stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.03" then "5.0+4.03.0" else "5.0+4.02.0";
+let param = {
+  "4.02.3" = {
+    version = "5.0+4.02.0";
+    sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"; };
+  "4.03.0" = {
+    version = "5.0+4.03.0";
+    sha256 = "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"; };
+}."${ocaml.version}";
 in
   stdenv.mkDerivation {
-    name = "ocaml-ppx_tools-${version}";
+    name = "ocaml${ocaml.version}-ppx_tools-${param.version}";
     src = fetchFromGitHub {
       owner = "alainfrisch";
       repo = "ppx_tools";
-      rev = version;
-      sha256 = if version == "5.0+4.03.0"
-      then "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"
-      else "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"
-      ;
+      rev = param.version;
+      inherit (param) sha256;
     };
 
     buildInputs = [ ocaml findlib ];