From 0ce1067b18af17a8a7a36b4570814adbbb8e516c Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 3 Nov 2017 23:45:18 +0000 Subject: [PATCH] ocamlPackages.num: init at 1.1 --- .../development/ocaml-modules/num/default.nix | 29 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 4 +++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/ocaml-modules/num/default.nix diff --git a/pkgs/development/ocaml-modules/num/default.nix b/pkgs/development/ocaml-modules/num/default.nix new file mode 100644 index 000000000000..d46bff5b3d59 --- /dev/null +++ b/pkgs/development/ocaml-modules/num/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib }: + +stdenv.mkDerivation rec { + version = "1.1"; + name = "ocaml${ocaml.version}-num-${version}"; + src = fetchFromGitHub { + owner = "ocaml"; + repo = "num"; + rev = "v${version}"; + sha256 = "0a4mhxgs5hi81d227aygjx35696314swas0vzy3ig809jb7zq4h0"; + }; + + patches = [ (fetchpatch { + url = "https://github.com/ocaml/num/commit/6d4c6d476c061298e6385e8a0864f083194b9307.patch"; + sha256 = "18zlvb5n327q8y3c52js5dvyy29ssld1l53jqng8m9w1k24ypi0b"; + }) + ]; + + buildInputs = [ ocaml findlib ]; + + createFindlibDestdir = true; + + meta = { + description = "Legacy Num library for arbitrary-precision integer and rational arithmetic"; + license = stdenv.lib.licenses.lgpl21; + inherit (ocaml.meta) platforms; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index d41d5b97f183..a56343713fe2 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -387,6 +387,10 @@ let lwt = ocaml_lwt; }; + num = if lib.versionOlder "4.06" ocaml.version + then callPackage ../development/ocaml-modules/num {} + else null; + ocaml_batteries = callPackage ../development/ocaml-modules/batteries { }; comparelib = callPackage ../development/ocaml-modules/comparelib { };