ocamlPackages.sosa: fix for OCaml ≥ 5.0

This commit is contained in:
Vincent Laporte 2023-07-24 07:14:51 +02:00 committed by Vincent Laporte
parent cba62cad70
commit 5bd5a25808

View File

@ -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;