summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/yojson/default.nix
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-10-22 06:18:32 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-10-22 14:37:28 +0000
commit97c5dfc55efc6307a091ea70a03b1495c1f193fd (patch)
tree49f05cb5a30b4f42d3e2b8da7b2d1f88869568ae /pkgs/development/ocaml-modules/yojson/default.nix
parentc7dec7a4b8aaf045e041bcbd1530e100baaca3c9 (diff)
downloadnixpkgs-97c5dfc55efc6307a091ea70a03b1495c1f193fd.tar
nixpkgs-97c5dfc55efc6307a091ea70a03b1495c1f193fd.tar.gz
nixpkgs-97c5dfc55efc6307a091ea70a03b1495c1f193fd.tar.bz2
nixpkgs-97c5dfc55efc6307a091ea70a03b1495c1f193fd.tar.lz
nixpkgs-97c5dfc55efc6307a091ea70a03b1495c1f193fd.tar.xz
nixpkgs-97c5dfc55efc6307a091ea70a03b1495c1f193fd.tar.zst
nixpkgs-97c5dfc55efc6307a091ea70a03b1495c1f193fd.zip
ocamlPackages.yojson: 1.2.3 -> 1.3.3
Diffstat (limited to 'pkgs/development/ocaml-modules/yojson/default.nix')
-rw-r--r--pkgs/development/ocaml-modules/yojson/default.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkgs/development/ocaml-modules/yojson/default.nix b/pkgs/development/ocaml-modules/yojson/default.nix
index ab949f4f1f2..2ce2faa7e8d 100644
--- a/pkgs/development/ocaml-modules/yojson/default.nix
+++ b/pkgs/development/ocaml-modules/yojson/default.nix
@@ -1,15 +1,22 @@
 { stdenv, fetchzip, ocaml, findlib, cppo, easy-format, biniou }:
 let
   pname = "yojson";
-  version = "1.2.3";
+  param =
+  if stdenv.lib.versionAtLeast ocaml.version "4.01" then {
+    version = "1.3.3";
+    sha256 = "02l11facbr6bxrxq95vrcp1dxapp02kv7g4gq8rm62pb3dj5c6g7";
+  } else {
+    version = "1.2.3";
+    sha256 = "10dvkndgwanvw4agbjln7kgb1n9s6lii7jw82kwxczl5rd1sgmvl";
+  };
 in
 stdenv.mkDerivation {
 
-  name = "ocaml-${pname}-${version}";
+  name = "ocaml${ocaml.version}-${pname}-${param.version}";
 
   src = fetchzip {
-    url = "https://github.com/mjambon/${pname}/archive/v${version}.tar.gz";
-    sha256 = "10dvkndgwanvw4agbjln7kgb1n9s6lii7jw82kwxczl5rd1sgmvl";
+    url = "https://github.com/mjambon/${pname}/archive/v${param.version}.tar.gz";
+    inherit (param) sha256;
   };
 
   buildInputs = [ ocaml findlib ];