summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/uri
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2018-01-11 07:57:57 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2018-01-14 05:28:49 +0000
commit1b43f4fe865dd76b1dfcd0c3cc4ceecf9cd28545 (patch)
tree60515e048fe957b9abc7fcd4358e29227efa658f /pkgs/development/ocaml-modules/uri
parent08492b31d128501927862844b370b9facca17273 (diff)
downloadnixlib-1b43f4fe865dd76b1dfcd0c3cc4ceecf9cd28545.tar
nixlib-1b43f4fe865dd76b1dfcd0c3cc4ceecf9cd28545.tar.gz
nixlib-1b43f4fe865dd76b1dfcd0c3cc4ceecf9cd28545.tar.bz2
nixlib-1b43f4fe865dd76b1dfcd0c3cc4ceecf9cd28545.tar.lz
nixlib-1b43f4fe865dd76b1dfcd0c3cc4ceecf9cd28545.tar.xz
nixlib-1b43f4fe865dd76b1dfcd0c3cc4ceecf9cd28545.tar.zst
nixlib-1b43f4fe865dd76b1dfcd0c3cc4ceecf9cd28545.zip
ocamlPackages.uri: 1.9.2 -> 1.9.5
Diffstat (limited to 'pkgs/development/ocaml-modules/uri')
-rw-r--r--pkgs/development/ocaml-modules/uri/default.nix54
-rw-r--r--pkgs/development/ocaml-modules/uri/legacy.nix51
2 files changed, 69 insertions, 36 deletions
diff --git a/pkgs/development/ocaml-modules/uri/default.nix b/pkgs/development/ocaml-modules/uri/default.nix
index f08ee7fc2fc1..535af5708218 100644
--- a/pkgs/development/ocaml-modules/uri/default.nix
+++ b/pkgs/development/ocaml-modules/uri/default.nix
@@ -1,51 +1,33 @@
-{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, re, stringext, ounit
-, sexplib, ppx_sexp_conv
-, legacyVersion ? false
-, sexplib_p4
+{ stdenv, fetchurl, ocaml, findlib, jbuilder, ppx_sexp_conv, ounit
+, ppx_deriving, re, sexplib, stringext
 }:
 
-if !stdenv.lib.versionAtLeast ocaml.version "4"
-|| legacyVersion && stdenv.lib.versionAtLeast ocaml.version "4.03"
-then throw "uri${stdenv.lib.optionalString legacyVersion "_p4"} is not available for OCaml ${ocaml.version}" else
-
-with
-  if legacyVersion
-  then {
-    version = "1.9.1";
-    sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85";
-  } else {
-    version = "1.9.2";
-    sha256 = "137pg8j654x7r0d1664iy2zp3l82nki1kkh921lwdrwc5qqdl6jx";
-  };
-
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
+  version = "1.9.5";
   name = "ocaml${ocaml.version}-uri-${version}";
 
-  src = fetchzip {
-    url = "https://github.com/mirage/ocaml-uri/archive/v${version}.tar.gz";
-    inherit sha256;
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-uri/releases/download/v${version}/uri-${version}.tbz";
+    sha256 = "11cix26fisjbzd1kj12a78wjf3bfgaxpj8nz88bl3dssdakhswyc";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild ounit ]
-  ++ stdenv.lib.optional (!legacyVersion) ppx_sexp_conv;
-  propagatedBuildInputs = [ re (if legacyVersion then sexplib_p4 else sexplib) stringext ];
+  unpackCmd = "tar -xjf $curSrc";
+
+  buildInputs = [ ocaml findlib jbuilder ppx_sexp_conv ounit ];
+  propagatedBuildInputs = [ ppx_deriving re sexplib stringext ];
+
+  buildPhase = "jbuilder build";
 
-  configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
-  buildPhase = ''
-    ocaml setup.ml -build
-    ocaml setup.ml -doc
-  '';
   doCheck = true;
-  checkPhase = "ocaml setup.ml -test";
-  installPhase = "ocaml setup.ml -install";
+  checkPhase = "jbuilder runtest";
 
-  createFindlibDestdir = true;
+  inherit (jbuilder) installPhase;
 
   meta = {
-    homepage = https://github.com/mirage/ocaml-uri;
-    platforms = ocaml.meta.platforms or [];
+    homepage = "https://github.com/mirage/ocaml-uri";
     description = "RFC3986 URI parsing library for OCaml";
     license = stdenv.lib.licenses.isc;
-    maintainers = with stdenv.lib.maintainers; [ vbgl ];
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
   };
 }
diff --git a/pkgs/development/ocaml-modules/uri/legacy.nix b/pkgs/development/ocaml-modules/uri/legacy.nix
new file mode 100644
index 000000000000..f08ee7fc2fc1
--- /dev/null
+++ b/pkgs/development/ocaml-modules/uri/legacy.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, re, stringext, ounit
+, sexplib, ppx_sexp_conv
+, legacyVersion ? false
+, sexplib_p4
+}:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4"
+|| legacyVersion && stdenv.lib.versionAtLeast ocaml.version "4.03"
+then throw "uri${stdenv.lib.optionalString legacyVersion "_p4"} is not available for OCaml ${ocaml.version}" else
+
+with
+  if legacyVersion
+  then {
+    version = "1.9.1";
+    sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85";
+  } else {
+    version = "1.9.2";
+    sha256 = "137pg8j654x7r0d1664iy2zp3l82nki1kkh921lwdrwc5qqdl6jx";
+  };
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-uri-${version}";
+
+  src = fetchzip {
+    url = "https://github.com/mirage/ocaml-uri/archive/v${version}.tar.gz";
+    inherit sha256;
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ounit ]
+  ++ stdenv.lib.optional (!legacyVersion) ppx_sexp_conv;
+  propagatedBuildInputs = [ re (if legacyVersion then sexplib_p4 else sexplib) stringext ];
+
+  configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
+  buildPhase = ''
+    ocaml setup.ml -build
+    ocaml setup.ml -doc
+  '';
+  doCheck = true;
+  checkPhase = "ocaml setup.ml -test";
+  installPhase = "ocaml setup.ml -install";
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = https://github.com/mirage/ocaml-uri;
+    platforms = ocaml.meta.platforms or [];
+    description = "RFC3986 URI parsing library for OCaml";
+    license = stdenv.lib.licenses.isc;
+    maintainers = with stdenv.lib.maintainers; [ vbgl ];
+  };
+}