From 905405eb725bd108b646b15bd12246813ec0983d Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 6 Apr 2019 13:49:48 +0000 Subject: [PATCH 1/3] ocamlPackages.uri: 1.9.6 -> 2.2.0 --- .../development/ocaml-modules/uri/default.nix | 31 ++++++++++++++----- pkgs/top-level/ocaml-packages.nix | 1 + 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/pkgs/development/ocaml-modules/uri/default.nix b/pkgs/development/ocaml-modules/uri/default.nix index 6073411a24d2..0f3578806d83 100644 --- a/pkgs/development/ocaml-modules/uri/default.nix +++ b/pkgs/development/ocaml-modules/uri/default.nix @@ -1,24 +1,39 @@ -{ stdenv, fetchurl, buildDunePackage, ppx_sexp_conv, ounit -, re, sexplib, stringext +{ lib, fetchurl, buildDunePackage, ppx_sexp_conv, ounit +, re, sexplib0, sexplib, stringext +, legacy ? false }: +let params = + if legacy then rec { + version = "1.9.6"; + archive = version; + sha256 = "1m845rwd70wi4iijkrigyz939m1x84ba70hvv0d9sgk6971w4kz0"; + inherit sexplib; + } else rec { + version = "2.2.0"; + archive = "v${version}"; + sha256 = "1q0xmc93l46dilxclkmai7w952bdi745rhvsx5vissaigcj9wbwi"; + sexplib = sexplib0; + } +; in + buildDunePackage rec { pname = "uri"; - version = "1.9.6"; + inherit (params) version; src = fetchurl { - url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz"; - sha256 = "1m845rwd70wi4iijkrigyz939m1x84ba70hvv0d9sgk6971w4kz0"; + url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/${pname}-${params.archive}.tbz"; + inherit (params) sha256; }; buildInputs = [ ounit ]; - propagatedBuildInputs = [ ppx_sexp_conv re sexplib stringext ]; + propagatedBuildInputs = [ ppx_sexp_conv re params.sexplib stringext ]; doCheck = true; meta = { homepage = "https://github.com/mirage/ocaml-uri"; description = "RFC3986 URI parsing library for OCaml"; - license = stdenv.lib.licenses.isc; - maintainers = [ stdenv.lib.maintainers.vbgl ]; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; }; } diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index f79f6ea3c0ca..47d233a22878 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -68,6 +68,7 @@ let }; }; uri = uri.override { + legacy = true; inherit (janeStreet_0_9_0) ppx_sexp_conv sexplib; }; }; From 2dfc7524c66f2753031ddfd26e762f3b8c100a7b Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 6 Apr 2019 13:54:37 +0000 Subject: [PATCH 2/3] ocamlPackages.cohttp: 1.1.1 -> 2.0.0 --- pkgs/development/ocaml-modules/cohttp/default.nix | 12 ++++++------ pkgs/development/ocaml-modules/cohttp/lwt.nix | 4 ++-- pkgs/top-level/ocaml-packages.nix | 4 +--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix index 0110ea0223cb..23585ad009c5 100644 --- a/pkgs/development/ocaml-modules/cohttp/default.nix +++ b/pkgs/development/ocaml-modules/cohttp/default.nix @@ -1,27 +1,27 @@ -{ stdenv, fetchFromGitHub, buildDunePackage +{ lib, fetchFromGitHub, buildDunePackage , ppx_fields_conv, ppx_sexp_conv, ppx_deriving , base64, fieldslib, jsonm, re, stringext, uri }: buildDunePackage rec { pname = "cohttp"; - version = "1.1.1"; + version = "2.0.0"; src = fetchFromGitHub { owner = "mirage"; repo = "ocaml-cohttp"; rev = "v${version}"; - sha256 = "1dzd6vy43b7p9xplzg2whylz5br59zxaqywa14b4l377f31gnwq1"; + sha256 = "0nz9y7l5s9a2rq5sb1m5705h99wvf4dk3fhcgragwhy5nwwzcya8"; }; buildInputs = [ jsonm ppx_fields_conv ppx_sexp_conv ]; - propagatedBuildInputs = [ ppx_deriving base64 fieldslib re stringext uri ]; + propagatedBuildInputs = [ base64 fieldslib re stringext uri ]; meta = { description = "HTTP(S) library for Lwt, Async and Mirage"; - license = stdenv.lib.licenses.isc; - maintainers = [ stdenv.lib.maintainers.vbgl ]; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; inherit (src.meta) homepage; }; } diff --git a/pkgs/development/ocaml-modules/cohttp/lwt.nix b/pkgs/development/ocaml-modules/cohttp/lwt.nix index 37348c55262e..93ba084703e5 100644 --- a/pkgs/development/ocaml-modules/cohttp/lwt.nix +++ b/pkgs/development/ocaml-modules/cohttp/lwt.nix @@ -1,4 +1,4 @@ -{ stdenv, buildDunePackage, cohttp, ocaml_lwt, uri, ppx_sexp_conv }: +{ stdenv, buildDunePackage, cohttp, ocaml_lwt, uri, ppx_sexp_conv, logs }: if !stdenv.lib.versionAtLeast cohttp.version "0.99" then cohttp @@ -10,5 +10,5 @@ buildDunePackage rec { buildInputs = [ uri ppx_sexp_conv ]; - propagatedBuildInputs = [ cohttp ocaml_lwt ]; + propagatedBuildInputs = [ cohttp ocaml_lwt logs ]; } diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 47d233a22878..d36bb5696173 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -153,9 +153,7 @@ let cohttp = if lib.versionOlder "4.03" ocaml.version - then callPackage ../development/ocaml-modules/cohttp { - base64 = base64_2; - } + then callPackage ../development/ocaml-modules/cohttp { } else cohttp_p4; cohttp-lwt = callPackage ../development/ocaml-modules/cohttp/lwt.nix { }; From 5e93a2f2d91b9ff6e0df282cad808ea63fecf63d Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 16 Apr 2019 08:41:56 +0000 Subject: [PATCH 3/3] ocamlPackages.uri_1_9: add an attribute for version 1.9 --- pkgs/top-level/ocaml-packages.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index d36bb5696173..c0089186275f 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -67,8 +67,7 @@ let }; }; }; - uri = uri.override { - legacy = true; + uri = uri_1_9.override { inherit (janeStreet_0_9_0) ppx_sexp_conv sexplib; }; }; @@ -756,6 +755,10 @@ let then callPackage ../development/ocaml-modules/uri { } else callPackage ../development/ocaml-modules/uri/legacy.nix { }; + uri_1_9 = callPackage ../development/ocaml-modules/uri { + legacy = true; + }; + uri_p4 = callPackage ../development/ocaml-modules/uri/legacy.nix { legacyVersion = true; };