2017-11-28 16:56:47 +00:00
|
|
|
{ stdenv, fetchFromGitHub, perl, ocaml, findlib, camlidl, gmp, mpfr }:
|
2016-10-12 11:12:46 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ocaml${ocaml.version}-mlgmpidl-${version}";
|
2017-11-28 16:56:47 +00:00
|
|
|
version = "1.2.6";
|
2016-10-12 11:12:46 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nberth";
|
|
|
|
repo = "mlgmpidl";
|
|
|
|
rev = version;
|
2017-11-28 16:56:47 +00:00
|
|
|
sha256 = "1lq3yy10v3rvlchbl5kl75l9f8frgj6g9f1n14kj5qlxm5xsrvks";
|
2016-10-12 11:12:46 +01:00
|
|
|
};
|
|
|
|
|
2017-11-28 16:56:47 +00:00
|
|
|
buildInputs = [ perl gmp mpfr ocaml findlib camlidl ];
|
2016-10-12 11:12:46 +01:00
|
|
|
|
|
|
|
configurePhase = ''
|
2017-11-28 16:56:47 +00:00
|
|
|
echo CAML_PREFIX = ${ocaml} > Makefile.config
|
|
|
|
cat Makefile.config.model >> Makefile.config
|
2016-10-12 11:12:46 +01:00
|
|
|
sed -i Makefile.config \
|
|
|
|
-e 's|^MLGMPIDL_PREFIX.*$|MLGMPIDL_PREFIX = $out|' \
|
|
|
|
-e 's|^GMP_PREFIX.*$|GMP_PREFIX = ${gmp.dev}|' \
|
|
|
|
-e 's|^MPFR_PREFIX.*$|MPFR_PREFIX = ${mpfr.dev}|' \
|
|
|
|
-e 's|^CAMLIDL_DIR.*$|CAMLIDL_DIR = ${camlidl}/lib/ocaml/${ocaml.version}/site-lib/camlidl|'
|
|
|
|
echo HAS_NATIVE_PLUGINS = 1 >> Makefile.config
|
|
|
|
sed -i Makefile \
|
|
|
|
-e 's|^ /bin/rm | rm |'
|
|
|
|
'';
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "OCaml interface to the GMP library";
|
|
|
|
homepage = https://www.inrialpes.fr/pop-art/people/bjeannet/mlxxxidl-forge/mlgmpidl/;
|
|
|
|
license = stdenv.lib.licenses.lgpl21;
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.vbgl ];
|
|
|
|
};
|
|
|
|
}
|