Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub
2, ocaml, findlib, pkg-config
3, gmp
4}:
5
6if lib.versionOlder ocaml.version "4.04"
7then throw "zarith is not available for OCaml ${ocaml.version}"
8else
9
10stdenv.mkDerivation rec {
11 pname = "ocaml${ocaml.version}-zarith";
12 version = "1.12";
13 src = fetchFromGitHub {
14 owner = "ocaml";
15 repo = "Zarith";
16 rev = "release-${version}";
17 sha256 = "1jslm1rv1j0ya818yh23wf3bb6hz7qqj9pn5fwl45y9mqyqa01s9";
18 };
19
20 nativeBuildInputs = [ pkg-config ocaml findlib ];
21 propagatedBuildInputs = [ gmp ];
22 strictDeps = true;
23
24 dontAddPrefix = true;
25 dontAddStaticConfigureFlags = true;
26 configurePlatforms = [];
27 configureFlags = [ "-installdir ${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ];
28
29 preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs";
30
31 meta = with lib; {
32 description = "Fast, arbitrary precision OCaml integers";
33 homepage = "http://forge.ocamlcore.org/projects/zarith";
34 license = licenses.lgpl2;
35 inherit (ocaml.meta) platforms;
36 maintainers = with maintainers; [ thoughtpolice vbgl ];
37 };
38}