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