diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix index cd54c29f00b9..1642868a9d85 100644 --- a/pkgs/development/ocaml-modules/cohttp/default.nix +++ b/pkgs/development/ocaml-modules/cohttp/default.nix @@ -15,18 +15,24 @@ fmt, alcotest, crowbar, + ppx_expect, }: buildDunePackage (finalAttrs: { pname = "cohttp"; - version = if lib.versionAtLeast ocaml.version "4.13" then "6.2.1" else "5.3.1"; - - minimalOCamlVersion = "4.08"; + version = + if lib.versionAtLeast ocaml.version "5.2" then + "6.2.2" + else if lib.versionAtLeast ocaml.version "4.13" then + "6.2.1" + else + "5.3.1"; src = fetchurl { url = "https://github.com/mirage/ocaml-cohttp/releases/download/v${finalAttrs.version}/cohttp-${finalAttrs.version}.tbz"; hash = { + "6.2.2" = "sha256-SZzYsJTO5LAP5rn2MiaA+B/ocWHpY6GWsQnBiCYQr2I="; "6.2.1" = "sha256-ZQgCR3Y0QtHcPNkGeLgjO3mHcvA2rIHNHqreH11mpl8="; "5.3.1" = "sha256-9eJz08Lyn/R71+Ftsj4fPWzQGkC+ACCJhbxDTIjUV2s="; } @@ -34,7 +40,7 @@ buildDunePackage (finalAttrs: { }; postPatch = '' - substituteInPlace cohttp/src/dune --replace 'bytes base64' 'base64' + substituteInPlace cohttp/src/dune --replace-warn 'bytes base64' 'base64' ''; buildInputs = [ @@ -61,8 +67,8 @@ buildDunePackage (finalAttrs: { fmt alcotest ] - ++ lib.optionals (lib.versionOlder finalAttrs.version "6.0.0") [ - crowbar + ++ [ + (if lib.versionOlder finalAttrs.version "6.0.0" then crowbar else ppx_expect) ]; meta = { diff --git a/pkgs/development/ocaml-modules/cohttp/eio.nix b/pkgs/development/ocaml-modules/cohttp/eio.nix index 1c4155993aff..90a7d26c8205 100644 --- a/pkgs/development/ocaml-modules/cohttp/eio.nix +++ b/pkgs/development/ocaml-modules/cohttp/eio.nix @@ -10,6 +10,7 @@ alcotest, ca-certs, eio_main, + ppx_expect, tls-eio, }: @@ -37,6 +38,7 @@ buildDunePackage { alcotest ca-certs eio_main + ppx_expect tls-eio ]; diff --git a/pkgs/development/ocaml-modules/cohttp/http.nix b/pkgs/development/ocaml-modules/cohttp/http.nix index 774b7a134813..14d9dd98c0d4 100644 --- a/pkgs/development/ocaml-modules/cohttp/http.nix +++ b/pkgs/development/ocaml-modules/cohttp/http.nix @@ -1,7 +1,6 @@ { buildDunePackage, cohttp, - ppx_expect, }: buildDunePackage { @@ -13,8 +12,6 @@ buildDunePackage { minimalOCamlVersion = "5.1"; - propagatedBuildInputs = [ ppx_expect ]; - meta = cohttp.meta // { description = "CoHTTP implementation using the Lwt concurrency library"; }; diff --git a/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix b/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix index cf75b2387ee2..9136cd270396 100644 --- a/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix +++ b/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix @@ -9,6 +9,7 @@ js_of_ocaml-lwt, nodejs, lwt_ppx, + ppx_expect, }: buildDunePackage { @@ -29,6 +30,7 @@ buildDunePackage { checkInputs = [ nodejs lwt_ppx + ppx_expect ]; meta = cohttp-lwt.meta // { diff --git a/pkgs/development/ocaml-modules/cohttp/server-lwt-unix.nix b/pkgs/development/ocaml-modules/cohttp/server-lwt-unix.nix index a600600f416b..e43e2f9d3dbf 100644 --- a/pkgs/development/ocaml-modules/cohttp/server-lwt-unix.nix +++ b/pkgs/development/ocaml-modules/cohttp/server-lwt-unix.nix @@ -4,6 +4,7 @@ cohttp-lwt-unix, http, lwt, + ppx_expect, }: buildDunePackage (finalAttrs: { @@ -15,7 +16,10 @@ buildDunePackage (finalAttrs: { lwt ]; - checkInputs = [ cohttp-lwt-unix ]; + checkInputs = [ + cohttp-lwt-unix + ppx_expect + ]; doCheck = true; meta = cohttp.meta // { diff --git a/pkgs/development/ocaml-modules/cohttp/top.nix b/pkgs/development/ocaml-modules/cohttp/top.nix index a2561684e014..2f83086284b2 100644 --- a/pkgs/development/ocaml-modules/cohttp/top.nix +++ b/pkgs/development/ocaml-modules/cohttp/top.nix @@ -1,4 +1,8 @@ -{ buildDunePackage, cohttp }: +{ + buildDunePackage, + cohttp, + ppx_expect, +}: buildDunePackage { pname = "cohttp-top"; @@ -7,6 +11,7 @@ buildDunePackage { propagatedBuildInputs = [ cohttp ]; doCheck = true; + checkInputs = [ ppx_expect ]; meta = cohttp.meta // { description = "CoHTTP toplevel pretty printers for HTTP types";