about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-10-06 20:23:12 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-10-06 21:16:06 +0000
commitcbf5307020b4a0a473e3ca4232ebb66ce0d60bec (patch)
treec84b7ae6f4bcd54ae269f0eb3206872763e6d88f
parent96874c6e719dbe8c53cc1dea832f7e1866297a24 (diff)
downloadnixlib-cbf5307020b4a0a473e3ca4232ebb66ce0d60bec.tar
nixlib-cbf5307020b4a0a473e3ca4232ebb66ce0d60bec.tar.gz
nixlib-cbf5307020b4a0a473e3ca4232ebb66ce0d60bec.tar.bz2
nixlib-cbf5307020b4a0a473e3ca4232ebb66ce0d60bec.tar.lz
nixlib-cbf5307020b4a0a473e3ca4232ebb66ce0d60bec.tar.xz
nixlib-cbf5307020b4a0a473e3ca4232ebb66ce0d60bec.tar.zst
nixlib-cbf5307020b4a0a473e3ca4232ebb66ce0d60bec.zip
ocamlPackages.biniou: 1.0.9 -> 1.2.0
-rw-r--r--pkgs/development/ocaml-modules/biniou/1.0.nix36
-rw-r--r--pkgs/development/ocaml-modules/biniou/default.nix56
-rw-r--r--pkgs/top-level/ocaml-packages.nix5
3 files changed, 63 insertions, 34 deletions
diff --git a/pkgs/development/ocaml-modules/biniou/1.0.nix b/pkgs/development/ocaml-modules/biniou/1.0.nix
new file mode 100644
index 000000000000..d2d3159cde14
--- /dev/null
+++ b/pkgs/development/ocaml-modules/biniou/1.0.nix
@@ -0,0 +1,36 @@
+{stdenv, fetchurl, ocaml, findlib, easy-format}:
+let
+  pname = "biniou";
+  version = "1.0.9";
+  webpage = "http://mjambon.com/${pname}.html";
+in
+
+assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "3.11";
+
+stdenv.mkDerivation rec {
+
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://mjambon.com/releases/${pname}/${name}.tar.gz";
+    sha256 = "14j3hrhbjqxbizr1pr8fcig9dmfzhbjjwzwyc99fcsdic67w8izb";
+  };
+
+  buildInputs = [ ocaml findlib easy-format ];
+
+  createFindlibDestdir = true;
+
+  makeFlags = "PREFIX=$(out)";
+
+  preBuild = ''
+    mkdir $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve";
+    homepage = "${webpage}";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/biniou/default.nix b/pkgs/development/ocaml-modules/biniou/default.nix
index d2d3159cde14..7047edf24b3e 100644
--- a/pkgs/development/ocaml-modules/biniou/default.nix
+++ b/pkgs/development/ocaml-modules/biniou/default.nix
@@ -1,36 +1,26 @@
-{stdenv, fetchurl, ocaml, findlib, easy-format}:
-let
-  pname = "biniou";
-  version = "1.0.9";
-  webpage = "http://mjambon.com/${pname}.html";
-in
-
-assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "3.11";
+{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, easy-format }:
 
 stdenv.mkDerivation rec {
-
-  name = "${pname}-${version}";
-
-  src = fetchurl {
-    url = "http://mjambon.com/releases/${pname}/${name}.tar.gz";
-    sha256 = "14j3hrhbjqxbizr1pr8fcig9dmfzhbjjwzwyc99fcsdic67w8izb";
-  };
-
-  buildInputs = [ ocaml findlib easy-format ];
-
-  createFindlibDestdir = true;
-
-  makeFlags = "PREFIX=$(out)";
-
-  preBuild = ''
-    mkdir $out/bin
-  '';
-
-  meta = with stdenv.lib; {
-    description = "A binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve";
-    homepage = "${webpage}";
-    license = licenses.bsd3;
-    maintainers = [ maintainers.vbgl ];
-    platforms = ocaml.meta.platforms or [];
-  };
+	version = "1.2.0";
+	name = "ocaml${ocaml.version}-biniou-${version}";
+	src = fetchFromGitHub {
+		owner = "mjambon";
+		repo = "biniou";
+		rev = "v${version}";
+		sha256 = "0mjpgwyfq2b2izjw0flmlpvdjgqpq8shs89hxj1np2r50csr8dcb";
+	};
+
+	buildInputs = [ ocaml findlib jbuilder ];
+
+	propagatedBuildInputs = [ easy-format ];
+
+	inherit (jbuilder) installPhase;
+
+	meta = {
+		inherit (src.meta) homepage;
+		inherit (ocaml.meta) platforms;
+		description = "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve";
+		maintainers = [ stdenv.lib.maintainers.vbgl ];
+		license = stdenv.lib.licenses.bsd3;
+	};
 }
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index e45256bd3dc4..275c0739ce65 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -114,7 +114,10 @@ let
 
     benchmark = callPackage ../development/ocaml-modules/benchmark { };
 
-    biniou = callPackage ../development/ocaml-modules/biniou { };
+    biniou =
+      if lib.versionOlder "4.02" ocaml.version
+      then callPackage ../development/ocaml-modules/biniou { }
+      else callPackage ../development/ocaml-modules/biniou/1.0.nix { };
 
     bin_prot_p4 = callPackage ../development/ocaml-modules/bin_prot { };