ocamlPackages.zarith: use buildOcaml instead of mkDerivation
This has two main advantages: - By setting hasSharedObjects = true, buildOcaml will automatically include a setup-hook.sh that sets CAML_LD_LIBRARY_PATH in dependent expressions. This is needed to pick up dllzarith.so properly which is shipped as party of the library. - We can kill the ugly assert in the expression and instead change it to use minimumSupportedOcamlVersion. Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
parent
ee3949d720
commit
9d5a7af4e5
@ -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 source =
|
||||||
|
|
||||||
let param =
|
|
||||||
if stdenv.lib.versionAtLeast ocaml.version "4.02"
|
if stdenv.lib.versionAtLeast ocaml.version "4.02"
|
||||||
then {
|
then {
|
||||||
version = "1.7";
|
version = "1.7";
|
||||||
@ -15,18 +16,20 @@ let param =
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
buildOcaml rec {
|
||||||
name = "zarith-${version}";
|
name = "zarith";
|
||||||
inherit (param) version;
|
inherit (source) version;
|
||||||
|
src = fetchurl { inherit (source) url sha256; };
|
||||||
|
|
||||||
src = fetchurl {
|
minimumSupportedOcamlVersion = "3.12.1";
|
||||||
inherit (param) url sha256;
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
buildInputs = [ ocaml findlib perl ];
|
buildInputs = [ ocaml findlib perl ];
|
||||||
propagatedBuildInputs = [ gmp ];
|
propagatedBuildInputs = [ gmp ];
|
||||||
|
|
||||||
|
# needed so setup-hook.sh sets CAML_LD_LIBRARY_PATH for dllzarith.so
|
||||||
|
hasSharedObjects = true;
|
||||||
|
|
||||||
patchPhase = "patchShebangs ./z_pp.pl";
|
patchPhase = "patchShebangs ./z_pp.pl";
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
./configure -installdir $out/lib/ocaml/${ocaml.version}/site-lib
|
./configure -installdir $out/lib/ocaml/${ocaml.version}/site-lib
|
||||||
|
Loading…
Reference in New Issue
Block a user