2021-03-15 08:37:03 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
|
|
|
, ocaml, findlib, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, gmp
|
|
|
|
}:
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.04"
|
|
|
|
then throw "zarith is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-03-15 08:37:03 +00:00
|
|
|
pname = "ocaml${ocaml.version}-zarith";
|
|
|
|
version = "1.12";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml";
|
|
|
|
repo = "Zarith";
|
|
|
|
rev = "release-${version}";
|
|
|
|
sha256 = "1jslm1rv1j0ya818yh23wf3bb6hz7qqj9pn5fwl45y9mqyqa01s9";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-03-15 08:37:03 +00:00
|
|
|
buildInputs = [ ocaml findlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ gmp ];
|
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
configureFlags = [ "-installdir ${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ];
|
|
|
|
|
|
|
|
preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fast, arbitrary precision OCaml integers";
|
|
|
|
homepage = "http://forge.ocamlcore.org/projects/zarith";
|
|
|
|
license = licenses.lgpl2;
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice vbgl ];
|
|
|
|
};
|
|
|
|
}
|