2021-03-04 21:03:28 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
|
|
|
, ocaml, findlib, pkg-config
|
2019-01-15 03:50:15 +00:00
|
|
|
, gmp
|
|
|
|
}:
|
2014-05-01 08:26:35 +01:00
|
|
|
|
2021-03-04 21:03:28 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.04"
|
|
|
|
then throw "zarith is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2016-10-13 20:12:46 +01:00
|
|
|
|
2019-08-08 16:35:52 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-03-04 21:03:28 +00:00
|
|
|
pname = "ocaml${ocaml.version}-zarith";
|
|
|
|
version = "1.12";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml";
|
|
|
|
repo = "Zarith";
|
|
|
|
rev = "release-${version}";
|
|
|
|
sha256 = "1jslm1rv1j0ya818yh23wf3bb6hz7qqj9pn5fwl45y9mqyqa01s9";
|
|
|
|
};
|
2014-05-01 08:26:35 +01:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-03-04 21:03:28 +00:00
|
|
|
buildInputs = [ ocaml findlib ];
|
2014-11-07 09:50:39 +00:00
|
|
|
propagatedBuildInputs = [ gmp ];
|
2014-05-01 08:26:35 +01:00
|
|
|
|
2019-10-31 10:26:23 +00:00
|
|
|
dontAddPrefix = true;
|
|
|
|
configureFlags = [ "-installdir ${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ];
|
2019-08-08 16:35:52 +01:00
|
|
|
|
|
|
|
preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs";
|
2014-05-01 08:26:35 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-20 11:53:46 +01:00
|
|
|
description = "Fast, arbitrary precision OCaml integers";
|
2014-05-01 08:26:35 +01:00
|
|
|
homepage = "http://forge.ocamlcore.org/projects/zarith";
|
2014-10-10 14:43:58 +01:00
|
|
|
license = licenses.lgpl2;
|
2019-08-08 16:35:52 +01:00
|
|
|
inherit (ocaml.meta) platforms;
|
2014-10-10 14:43:58 +01:00
|
|
|
maintainers = with maintainers; [ thoughtpolice vbgl ];
|
2014-05-01 08:26:35 +01:00
|
|
|
};
|
|
|
|
}
|