@@ -1,24 +1,39 @@
1−{ stdenv, fetchurl, buildDunePackage, ppx_sexp_conv, ounit
2−, re, sexplib, stringext
1+{ lib, fetchurl, buildDunePackage, ppx_sexp_conv, ounit
2+, re, sexplib0, sexplib, stringext
3+, legacy ? false
34}:
45
6+let params =
7+ if legacy then rec {
8+ version = "1.9.6";
9+ archive = version;
10+ sha256 = "1m845rwd70wi4iijkrigyz939m1x84ba70hvv0d9sgk6971w4kz0";
11+ inherit sexplib;
12+ } else rec {
13+ version = "2.2.0";
14+ archive = "v${version}";
15+ sha256 = "1q0xmc93l46dilxclkmai7w952bdi745rhvsx5vissaigcj9wbwi";
16+ sexplib = sexplib0;
17+ }
18+; in
19+
520buildDunePackage rec {
621 pname = "uri";
7− version = "1.9.6";
22+ inherit (params) version;
823
924 src = fetchurl {
10− url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
11− sha256 = "1m845rwd70wi4iijkrigyz939m1x84ba70hvv0d9sgk6971w4kz0";
25+ url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/${pname}-${params.archive}.tbz";
26+ inherit (params) sha256;
1227 };
1328
1429 buildInputs = [ ounit ];
15− propagatedBuildInputs = [ ppx_sexp_conv re sexplib stringext ];
30+ propagatedBuildInputs = [ ppx_sexp_conv re params.sexplib stringext ];
1631 doCheck = true;
1732
1833 meta = {
1934 homepage = "https://github.com/mirage/ocaml-uri";
2035 description = "RFC3986 URI parsing library for OCaml";
21− license = stdenv.lib.licenses.isc;
22− maintainers = [ stdenv.lib.maintainers.vbgl ];
36+ license = lib.licenses.isc;
37+ maintainers = [ lib.maintainers.vbgl ];
2338 };
2439}