From 5bd5a25808dc23a702d4aeb334555285d29cc2a6 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 24 Jul 2023 07:14:51 +0200 Subject: [PATCH] =?UTF-8?q?ocamlPackages.sosa:=20fix=20for=20OCaml=20?= =?UTF-8?q?=E2=89=A5=205.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/sosa/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/sosa/default.nix b/pkgs/development/ocaml-modules/sosa/default.nix index 623f21748a87..1ef11e363ff8 100644 --- a/pkgs/development/ocaml-modules/sosa/default.nix +++ b/pkgs/development/ocaml-modules/sosa/default.nix @@ -2,9 +2,8 @@ , findlib, ocaml, ocamlbuild }: -if lib.versionOlder ocaml.version "4.02" -then throw "sosa is not available for OCaml ${ocaml.version}" -else +lib.throwIf (lib.versionOlder ocaml.version "4.02") + "sosa is not available for OCaml ${ocaml.version}" stdenv.mkDerivation rec { pname = "ocaml${ocaml.version}-sosa"; @@ -17,6 +16,13 @@ stdenv.mkDerivation rec { sha256 = "053hdv6ww0q4mivajj4iyp7krfvgq8zajq9d8x4mia4lid7j0dyk"; }; + postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "4.07") '' + for p in functors list_of of_mutable + do + substituteInPlace src/lib/$p.ml --replace Pervasives. Stdlib. + done + ''; + nativeBuildInputs = [ ocaml ocamlbuild findlib ]; strictDeps = true;