From 7cd807e5883736e1eeddb091b5774ee95af29869 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 2 Jun 2023 10:07:13 +0200 Subject: [PATCH] ocamlPackages.pgocaml: fix for OCaml 5.0 --- .../ocaml-modules/pgocaml/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/development/ocaml-modules/pgocaml/default.nix b/pkgs/development/ocaml-modules/pgocaml/default.nix index 22ef94af92e1..76b97103d667 100644 --- a/pkgs/development/ocaml-modules/pgocaml/default.nix +++ b/pkgs/development/ocaml-modules/pgocaml/default.nix @@ -1,7 +1,9 @@ -{ lib, fetchFromGitHub, buildDunePackage -, calendar, csv, hex, ppx_deriving, ppx_sexp_conv, re, rresult, sexplib +{ lib, fetchFromGitHub, fetchpatch, buildDunePackage, ocaml +, calendar, camlp-streams, csv, hex, ppx_deriving, ppx_sexp_conv, re, rresult, sexplib }: +let with-camlp-streams = lib.optional (lib.versionAtLeast ocaml.version "5.0"); in + buildDunePackage rec { pname = "pgocaml"; version = "4.3.0"; @@ -12,10 +14,16 @@ buildDunePackage rec { hash = "sha256-W1fbRnU1l61qqxfVY2qiBnVpGD81xrBO8k0tWr+RXMY="; }; - minimalOCamlVersion = "4.08"; - duneVersion = "3"; + # Compatibility with OCaml ≥ 5.0 + patches = with-camlp-streams (fetchpatch { + url = "https://github.com/darioteixeira/pgocaml/commit/906a289dc57da4971e312c31eedd26d81e902ed5.patch"; + hash = "sha256-/v9Jheg98GhrcD2gcsQpPvq7YiIrvJj22SKvrBRlR9Y="; + }); - propagatedBuildInputs = [ calendar csv hex ppx_deriving ppx_sexp_conv re rresult sexplib ]; + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ calendar csv hex ppx_deriving ppx_sexp_conv re rresult sexplib ] + ++ with-camlp-streams camlp-streams; meta = with lib; { description = "An interface to PostgreSQL databases for OCaml applications";