summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2018-07-22 06:11:39 +0000
committerVincent Laporte <vbgl@users.noreply.github.com>2018-07-29 07:47:21 +0000
commit96b9fdaa3573e73a615a2ee919c1f2c7cd04ab28 (patch)
treeb2248232d9738b5d3e2f44d246e570d7133336f0
parente46e7f44c22fcf328d62c10152926852e6e4b896 (diff)
downloadnixpkgs-96b9fdaa3573e73a615a2ee919c1f2c7cd04ab28.tar
nixpkgs-96b9fdaa3573e73a615a2ee919c1f2c7cd04ab28.tar.gz
nixpkgs-96b9fdaa3573e73a615a2ee919c1f2c7cd04ab28.tar.bz2
nixpkgs-96b9fdaa3573e73a615a2ee919c1f2c7cd04ab28.tar.lz
nixpkgs-96b9fdaa3573e73a615a2ee919c1f2c7cd04ab28.tar.xz
nixpkgs-96b9fdaa3573e73a615a2ee919c1f2c7cd04ab28.tar.zst
nixpkgs-96b9fdaa3573e73a615a2ee919c1f2c7cd04ab28.zip
ocamlPackages.bigstringaf: init at 0.3.0
Bigstring intrinsics and fast blits based on memcpy/memmove

homepage: https://github.com/inhabitedtype/bigstringaf
-rw-r--r--pkgs/development/ocaml-modules/bigstringaf/default.nix32
-rw-r--r--pkgs/top-level/ocaml-packages.nix2
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/bigstringaf/default.nix b/pkgs/development/ocaml-modules/bigstringaf/default.nix
new file mode 100644
index 00000000000..21a0e394392
--- /dev/null
+++ b/pkgs/development/ocaml-modules/bigstringaf/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, alcotest }:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4.03"
+then throw "bigstringaf is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  version = "0.3.0";
+  name = "ocaml${ocaml.version}-bigstringaf-${version}";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = "bigstringaf";
+    rev = version;
+    sha256 = "1yx6hv8rk0ldz1h6kk00rwg8abpfc376z00aifl9f5rn7xavpscs";
+  };
+
+  buildInputs = [ ocaml findlib jbuilder alcotest ];
+
+  doCheck = true;
+  checkPhase = "dune runtest";
+
+  inherit (jbuilder) installPhase;
+
+  meta = {
+    description = "Bigstring intrinsics and fast blits based on memcpy/memmove";
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index 003f21aa81a..fcf7e1487dd 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -71,6 +71,8 @@ let
 
     batteries = callPackage ../development/ocaml-modules/batteries { };
 
+    bigstringaf = callPackage ../development/ocaml-modules/bigstringaf { };
+
     bitstring = callPackage ../development/ocaml-modules/bitstring { };
 
     bitv = callPackage ../development/ocaml-modules/bitv { };