about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/yojson
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-10-22 06:29:13 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-11-27 17:00:15 +0000
commitd0c513b470d7561d2038d2a46340a78cc9a21103 (patch)
tree5e8179c92a7d2bda958336a5961ab213e7b2b87d /pkgs/development/ocaml-modules/yojson
parenta8da423332da42287ef71a0e4c97ccede23a8f5e (diff)
ocamlPackages.yojson: 1.3.3 -> 1.4.0
Diffstat (limited to 'pkgs/development/ocaml-modules/yojson')
-rw-r--r--pkgs/development/ocaml-modules/yojson/default.nix32
1 files changed, 17 insertions, 15 deletions
diff --git a/pkgs/development/ocaml-modules/yojson/default.nix b/pkgs/development/ocaml-modules/yojson/default.nix
index 2ce2faa7e8d6d..5d751d3dc997a 100644
--- a/pkgs/development/ocaml-modules/yojson/default.nix
+++ b/pkgs/development/ocaml-modules/yojson/default.nix
@@ -1,16 +1,26 @@
-{ stdenv, fetchzip, ocaml, findlib, cppo, easy-format, biniou }:
+{ stdenv, fetchzip, ocaml, findlib, jbuilder, cppo, easy-format, biniou }:
 let
   pname = "yojson";
   param =
-  if stdenv.lib.versionAtLeast ocaml.version "4.01" then {
-    version = "1.3.3";
-    sha256 = "02l11facbr6bxrxq95vrcp1dxapp02kv7g4gq8rm62pb3dj5c6g7";
+  if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
+    version = "1.4.0";
+    sha256 = "0rzn4yihfi0psd2qmgrx5fvwpby87sqx4zws3ijf49f7wbpycccv";
+    buildInputs = [ jbuilder ];
+    extra = { inherit (jbuilder) installPhase; };
   } else {
     version = "1.2.3";
     sha256 = "10dvkndgwanvw4agbjln7kgb1n9s6lii7jw82kwxczl5rd1sgmvl";
+    buildInputs = [];
+    extra = {
+      createFindlibDestdir = true;
+
+      makeFlags = "PREFIX=$(out)";
+
+      preBuild = "mkdir $out/bin";
+    };
   };
 in
-stdenv.mkDerivation {
+stdenv.mkDerivation ({
 
   name = "ocaml${ocaml.version}-${pname}-${param.version}";
 
@@ -19,18 +29,10 @@ stdenv.mkDerivation {
     inherit (param) sha256;
   };
 
-  buildInputs = [ ocaml findlib ];
+  buildInputs = [ ocaml findlib ] ++ param.buildInputs;
 
   propagatedBuildInputs = [ cppo easy-format biniou ];
 
-  createFindlibDestdir = true;
-
-  makeFlags = "PREFIX=$(out)";
-
-  preBuild = ''
-    mkdir $out/bin
-  '';
-
   meta = with stdenv.lib; {
     description = "An optimized parsing and printing library for the JSON format";
     homepage = "http://mjambon.com/${pname}.html";
@@ -38,4 +40,4 @@ stdenv.mkDerivation {
     maintainers = [ maintainers.vbgl ];
     platforms = ocaml.meta.platforms or [];
   };
-}
+} // param.extra)