diff --git a/pkgs/development/ocaml-modules/zarith/default.nix b/pkgs/development/ocaml-modules/zarith/default.nix index e5d954970589..d91f6e1c8a31 100644 --- a/pkgs/development/ocaml-modules/zarith/default.nix +++ b/pkgs/development/ocaml-modules/zarith/default.nix @@ -1,8 +1,9 @@ -{ stdenv, fetchurl, ocaml, findlib, pkgconfig, gmp, perl }: +{ stdenv, buildOcaml, fetchurl +, ocaml, findlib, pkgconfig, perl +, gmp +}: -assert stdenv.lib.versionAtLeast ocaml.version "3.12.1"; - -let param = +let source = if stdenv.lib.versionAtLeast ocaml.version "4.02" then { version = "1.7"; @@ -15,18 +16,20 @@ let param = }; in -stdenv.mkDerivation rec { - name = "zarith-${version}"; - inherit (param) version; +buildOcaml rec { + name = "zarith"; + inherit (source) version; + src = fetchurl { inherit (source) url sha256; }; - src = fetchurl { - inherit (param) url sha256; - }; + minimumSupportedOcamlVersion = "3.12.1"; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ ocaml findlib perl ]; propagatedBuildInputs = [ gmp ]; + # needed so setup-hook.sh sets CAML_LD_LIBRARY_PATH for dllzarith.so + hasSharedObjects = true; + patchPhase = "patchShebangs ./z_pp.pl"; configurePhase = '' ./configure -installdir $out/lib/ocaml/${ocaml.version}/site-lib