@@ -0,0 +1,29 @@
1+{ stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib }:
2+
3+stdenv.mkDerivation rec {
4+ version = "1.1";
5+ name = "ocaml${ocaml.version}-num-${version}";
6+ src = fetchFromGitHub {
7+ owner = "ocaml";
8+ repo = "num";
9+ rev = "v${version}";
10+ sha256 = "0a4mhxgs5hi81d227aygjx35696314swas0vzy3ig809jb7zq4h0";
11+ };
12+
13+ patches = [ (fetchpatch {
14+ url = "https://github.com/ocaml/num/commit/6d4c6d476c061298e6385e8a0864f083194b9307.patch";
15+ sha256 = "18zlvb5n327q8y3c52js5dvyy29ssld1l53jqng8m9w1k24ypi0b";
16+ })
17+ ];
18+
19+ buildInputs = [ ocaml findlib ];
20+
21+ createFindlibDestdir = true;
22+
23+ meta = {
24+ description = "Legacy Num library for arbitrary-precision integer and rational arithmetic";
25+ license = stdenv.lib.licenses.lgpl21;
26+ inherit (ocaml.meta) platforms;
27+ inherit (src.meta) homepage;
28+ };
29+}