@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl
1+{ stdenv, buildOcaml, fetchurl
22, ocaml, findlib, pkgconfig, perl
33, gmp
44}:
@@ -16,20 +16,25 @@ let source =
1616 };
1717in
1818
19−stdenv.mkDerivation rec {
20− name = "ocaml${ocaml.version}-zarith-${version}";
19+buildOcaml rec {
20+ name = "zarith";
2121 inherit (source) version;
2222 src = fetchurl { inherit (source) url sha256; };
2323
24+ minimumSupportedOcamlVersion = "3.12.1";
25+
2426 nativeBuildInputs = [ pkgconfig ];
2527 buildInputs = [ ocaml findlib perl ];
2628 propagatedBuildInputs = [ gmp ];
2729
30+ # needed so setup-hook.sh sets CAML_LD_LIBRARY_PATH for dllzarith.so
31+ hasSharedObjects = true;
32+
2833 patchPhase = "patchShebangs ./z_pp.pl";
2934 configurePhase = ''
3035 ./configure -installdir $out/lib/ocaml/${ocaml.version}/site-lib
3136 '';
32− createFindlibDestdir = true;
37+ preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib";
3338
3439 meta = with stdenv.lib; {
3540 description = "Fast, arbitrary precision OCaml integers";