ocamlPackages.uri: 1.9.2 -> 1.9.5

+74 -37
+17 -35
pkgs/development/ocaml-modules/uri/default.nix
··· 1 - { stdenv, fetchzip, ocaml, findlib, ocamlbuild, re, stringext, ounit 2 - , sexplib, ppx_sexp_conv 3 - , legacyVersion ? false 4 - , sexplib_p4 1 + { stdenv, fetchurl, ocaml, findlib, jbuilder, ppx_sexp_conv, ounit 2 + , ppx_deriving, re, sexplib, stringext 5 3 }: 6 4 7 - if !stdenv.lib.versionAtLeast ocaml.version "4" 8 - || legacyVersion && stdenv.lib.versionAtLeast ocaml.version "4.03" 9 - then throw "uri${stdenv.lib.optionalString legacyVersion "_p4"} is not available for OCaml ${ocaml.version}" else 5 + stdenv.mkDerivation rec { 6 + version = "1.9.5"; 7 + name = "ocaml${ocaml.version}-uri-${version}"; 10 8 11 - with 12 - if legacyVersion 13 - then { 14 - version = "1.9.1"; 15 - sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85"; 16 - } else { 17 - version = "1.9.2"; 18 - sha256 = "137pg8j654x7r0d1664iy2zp3l82nki1kkh921lwdrwc5qqdl6jx"; 9 + src = fetchurl { 10 + url = "https://github.com/mirage/ocaml-uri/releases/download/v${version}/uri-${version}.tbz"; 11 + sha256 = "11cix26fisjbzd1kj12a78wjf3bfgaxpj8nz88bl3dssdakhswyc"; 19 12 }; 20 13 21 - stdenv.mkDerivation { 22 - name = "ocaml${ocaml.version}-uri-${version}"; 14 + unpackCmd = "tar -xjf $curSrc"; 23 15 24 - src = fetchzip { 25 - url = "https://github.com/mirage/ocaml-uri/archive/v${version}.tar.gz"; 26 - inherit sha256; 27 - }; 16 + buildInputs = [ ocaml findlib jbuilder ppx_sexp_conv ounit ]; 17 + propagatedBuildInputs = [ ppx_deriving re sexplib stringext ]; 28 18 29 - buildInputs = [ ocaml findlib ocamlbuild ounit ] 30 - ++ stdenv.lib.optional (!legacyVersion) ppx_sexp_conv; 31 - propagatedBuildInputs = [ re (if legacyVersion then sexplib_p4 else sexplib) stringext ]; 19 + buildPhase = "jbuilder build"; 32 20 33 - configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"; 34 - buildPhase = '' 35 - ocaml setup.ml -build 36 - ocaml setup.ml -doc 37 - ''; 38 21 doCheck = true; 39 - checkPhase = "ocaml setup.ml -test"; 40 - installPhase = "ocaml setup.ml -install"; 22 + checkPhase = "jbuilder runtest"; 41 23 42 - createFindlibDestdir = true; 24 + inherit (jbuilder) installPhase; 43 25 44 26 meta = { 45 - homepage = https://github.com/mirage/ocaml-uri; 46 - platforms = ocaml.meta.platforms or []; 27 + homepage = "https://github.com/mirage/ocaml-uri"; 47 28 description = "RFC3986 URI parsing library for OCaml"; 48 29 license = stdenv.lib.licenses.isc; 49 - maintainers = with stdenv.lib.maintainers; [ vbgl ]; 30 + maintainers = [ stdenv.lib.maintainers.vbgl ]; 31 + inherit (ocaml.meta) platforms; 50 32 }; 51 33 }
+51
pkgs/development/ocaml-modules/uri/legacy.nix
··· 1 + { stdenv, fetchzip, ocaml, findlib, ocamlbuild, re, stringext, ounit 2 + , sexplib, ppx_sexp_conv 3 + , legacyVersion ? false 4 + , sexplib_p4 5 + }: 6 + 7 + if !stdenv.lib.versionAtLeast ocaml.version "4" 8 + || legacyVersion && stdenv.lib.versionAtLeast ocaml.version "4.03" 9 + then throw "uri${stdenv.lib.optionalString legacyVersion "_p4"} is not available for OCaml ${ocaml.version}" else 10 + 11 + with 12 + if legacyVersion 13 + then { 14 + version = "1.9.1"; 15 + sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85"; 16 + } else { 17 + version = "1.9.2"; 18 + sha256 = "137pg8j654x7r0d1664iy2zp3l82nki1kkh921lwdrwc5qqdl6jx"; 19 + }; 20 + 21 + stdenv.mkDerivation { 22 + name = "ocaml${ocaml.version}-uri-${version}"; 23 + 24 + src = fetchzip { 25 + url = "https://github.com/mirage/ocaml-uri/archive/v${version}.tar.gz"; 26 + inherit sha256; 27 + }; 28 + 29 + buildInputs = [ ocaml findlib ocamlbuild ounit ] 30 + ++ stdenv.lib.optional (!legacyVersion) ppx_sexp_conv; 31 + propagatedBuildInputs = [ re (if legacyVersion then sexplib_p4 else sexplib) stringext ]; 32 + 33 + configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"; 34 + buildPhase = '' 35 + ocaml setup.ml -build 36 + ocaml setup.ml -doc 37 + ''; 38 + doCheck = true; 39 + checkPhase = "ocaml setup.ml -test"; 40 + installPhase = "ocaml setup.ml -install"; 41 + 42 + createFindlibDestdir = true; 43 + 44 + meta = { 45 + homepage = https://github.com/mirage/ocaml-uri; 46 + platforms = ocaml.meta.platforms or []; 47 + description = "RFC3986 URI parsing library for OCaml"; 48 + license = stdenv.lib.licenses.isc; 49 + maintainers = with stdenv.lib.maintainers; [ vbgl ]; 50 + }; 51 + }
+6 -2
pkgs/top-level/ocaml-packages.nix
··· 667 667 uucp = callPackage ../development/ocaml-modules/uucp { }; 668 668 uunf = callPackage ../development/ocaml-modules/uunf { }; 669 669 670 - uri = callPackage ../development/ocaml-modules/uri { }; 671 - uri_p4 = callPackage ../development/ocaml-modules/uri { 670 + uri = 671 + if lib.versionAtLeast ocaml.version "4.3" 672 + then callPackage ../development/ocaml-modules/uri { } 673 + else callPackage ../development/ocaml-modules/uri/legacy.nix { }; 674 + 675 + uri_p4 = callPackage ../development/ocaml-modules/uri/legacy.nix { 672 676 legacyVersion = true; 673 677 }; 674 678