From e9b43adab722bce20978f0d83099b5da0baf2162 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 4 Nov 2018 06:49:27 +0000 Subject: [PATCH] ocamlPackages.optint: init at 0.0.2 This library provide one module Optint which internally uses an int if you are in a x64 architecture or an int32 (boxed value) if you are in a x86 architecture. Homepage: https://github.com/mirage/optint --- .../ocaml-modules/optint/default.nix | 28 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/development/ocaml-modules/optint/default.nix diff --git a/pkgs/development/ocaml-modules/optint/default.nix b/pkgs/development/ocaml-modules/optint/default.nix new file mode 100644 index 00000000000..613973200d2 --- /dev/null +++ b/pkgs/development/ocaml-modules/optint/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchurl, ocaml, findlib, dune }: + +if !stdenv.lib.versionAtLeast ocaml.version "4.02" +then throw "optint is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + version = "0.0.2"; + name = "ocaml${ocaml.version}-optint-${version}"; + src = fetchurl { + url = "https://github.com/mirage/optint/releases/download/v0.0.2/optint-v0.0.2.tbz"; + sha256 = "1lmb7nycmkr05y93slqi98i1lcs1w4kcngjzjwz7i230qqjpw9w1"; + }; + + buildInputs = [ ocaml findlib dune ]; + + buildPhase = "dune build"; + + inherit (dune) installPhase; + + meta = { + homepage = "https://github.com/mirage/optint"; + description = "Abstract type of integer between x64 and x86 architecture"; + license = stdenv.lib.licenses.mit; + maintainers = [ stdenv.lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 197051f3c2e..f2c0f16302e 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -557,6 +557,8 @@ let opti = callPackage ../development/ocaml-modules/opti { }; + optint = callPackage ../development/ocaml-modules/optint { }; + otfm = callPackage ../development/ocaml-modules/otfm { }; otr = callPackage ../development/ocaml-modules/otr { };