summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorVincent Laporte <vbgl@users.noreply.github.com>2017-12-23 09:29:16 +0100
committerGitHub <noreply@github.com>2017-12-23 09:29:16 +0100
commite3d363546a96946637973efe4e6c0fd23ecc405f (patch)
tree48883487103ca28f06239982c4f506f96d49ee70 /pkgs
parentc7f1aa38047bef88a6c32b9cbde1502bf7266530 (diff)
parentd39886db5a26d813aebfecb07f196f1d9bca26da (diff)
downloadnixpkgs-e3d363546a96946637973efe4e6c0fd23ecc405f.tar
nixpkgs-e3d363546a96946637973efe4e6c0fd23ecc405f.tar.gz
nixpkgs-e3d363546a96946637973efe4e6c0fd23ecc405f.tar.bz2
nixpkgs-e3d363546a96946637973efe4e6c0fd23ecc405f.tar.lz
nixpkgs-e3d363546a96946637973efe4e6c0fd23ecc405f.tar.xz
nixpkgs-e3d363546a96946637973efe4e6c0fd23ecc405f.tar.zst
nixpkgs-e3d363546a96946637973efe4e6c0fd23ecc405f.zip
Merge pull request #32585 from vbgl/ocaml-lru-0.2.0
Add OCaml libraries: psq, lru, faraday, farfadet, digestif
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/ocaml-modules/digestif/default.nix29
-rw-r--r--pkgs/development/ocaml-modules/faraday/default.nix34
-rw-r--r--pkgs/development/ocaml-modules/farfadet/default.nix34
-rw-r--r--pkgs/development/ocaml-modules/lru/default.nix27
-rw-r--r--pkgs/development/ocaml-modules/psq/default.nix29
-rw-r--r--pkgs/top-level/ocaml-packages.nix10
6 files changed, 163 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/digestif/default.nix b/pkgs/development/ocaml-modules/digestif/default.nix
new file mode 100644
index 00000000000..cf8b5335d59
--- /dev/null
+++ b/pkgs/development/ocaml-modules/digestif/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4.3"
+then throw "digestif is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-digestif-${version}";
+  version = "0.5";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/digestif/releases/download/v${version}/digestif-${version}.tbz";
+    sha256 = "0fsyfi5ps17j3wjav5176gf6z3a5xcw9aqhcr1gml9n9ayfbkhrd";
+  };
+
+  unpackCmd = "tar -xjf $curSrc";
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "Simple hash algorithms in OCaml";
+    homepage = "https://github.com/mirage/digestif";
+    license = stdenv.lib.licenses.mit;
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/faraday/default.nix b/pkgs/development/ocaml-modules/faraday/default.nix
new file mode 100644
index 00000000000..8f30ec51977
--- /dev/null
+++ b/pkgs/development/ocaml-modules/faraday/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, alcotest }:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4.02"
+then throw "faraday is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-faraday-${version}";
+  version = "0.5.0";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = "faraday";
+    rev = version;
+    sha256 = "1kql0il1frsbx6rvwqd7ahi4m14ik6la5an6c2w4x7k00ndm4d7n";
+  };
+
+  buildInputs = [ ocaml findlib jbuilder alcotest ];
+
+  buildPhase = "jbuilder build -p faraday";
+
+  doCheck = true;
+  checkPhase = "jbuilder runtest";
+
+  inherit (jbuilder) installPhase;
+
+  meta = {
+    description = "Serialization library built for speed and memory efficiency";
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/farfadet/default.nix b/pkgs/development/ocaml-modules/farfadet/default.nix
new file mode 100644
index 00000000000..080cc74998d
--- /dev/null
+++ b/pkgs/development/ocaml-modules/farfadet/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg
+, faraday
+}:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4.3"
+then throw "farfadet is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-farfadet-${version}";
+  version = "0.2";
+
+  src = fetchurl {
+    url = "https://github.com/oklm-wsh/Farfadet/releases/download/v${version}/farfadet-${version}.tbz";
+    sha256 = "06wvd57c8khpq0c2hvm15zng269zvabsw1lcaqphqdcckl67nsxr";
+  };
+
+  unpackCmd = "tar -xjf $curSrc";
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  propagatedBuildInputs = [ faraday ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "A printf-like for Faraday library";
+    homepage = "https://github.com/oklm-wsh/Farfadet";
+    license = stdenv.lib.licenses.mit;
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
+
diff --git a/pkgs/development/ocaml-modules/lru/default.nix b/pkgs/development/ocaml-modules/lru/default.nix
new file mode 100644
index 00000000000..3e474c5653a
--- /dev/null
+++ b/pkgs/development/ocaml-modules/lru/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, psq }:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-lru-${version}";
+  version = "0.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/lru/releases/download/v${version}/lru-${version}.tbz";
+    sha256 = "0bd7js9rrma1fjjjjc3fgr9l5fjbhgihx2nsaf96g2b35iiaimd0";
+  };
+
+  unpackCmd = "tar -xjf $curSrc";
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  propagatedBuildInputs = [ psq ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    homepage = "https://github.com/pqwy/lru";
+    description = "Scalable LRU caches for OCaml";
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    license = stdenv.lib.licenses.isc;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/psq/default.nix b/pkgs/development/ocaml-modules/psq/default.nix
new file mode 100644
index 00000000000..fc3fa81a02a
--- /dev/null
+++ b/pkgs/development/ocaml-modules/psq/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4.02"
+then throw "psq is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-psq-${version}";
+  version = "0.1.0";
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/psq/releases/download/v${version}/psq-${version}.tbz";
+    sha256 = "08ghgdivbjrxnaqc3hsb69mr9s2ql5ds0fb97b7z6zimzqibz6lp";
+  };
+
+  unpackCmd = "tar -xjf $curSrc";
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "Functional Priority Search Queues for OCaml";
+    homepage = "https://github.com/pqwy/psq";
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    license = stdenv.lib.licenses.isc;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index 3879778cb98..67d77c570fa 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -202,6 +202,8 @@ let
 
     decompress =  callPackage ../development/ocaml-modules/decompress { };
 
+    digestif =  callPackage ../development/ocaml-modules/digestif { };
+
     dolmen =  callPackage ../development/ocaml-modules/dolmen { };
 
     dolog = callPackage ../development/ocaml-modules/dolog { };
@@ -233,6 +235,10 @@ let
 
     faillib = callPackage ../development/ocaml-modules/faillib { };
 
+    faraday = callPackage ../development/ocaml-modules/faraday { };
+
+    farfadet = callPackage ../development/ocaml-modules/farfadet { };
+
     fieldslib_p4 = callPackage ../development/ocaml-modules/fieldslib { };
 
     fileutils = callPackage ../development/ocaml-modules/fileutils { };
@@ -351,6 +357,8 @@ let
       lwt = ocaml_lwt;
     };
 
+    lru = callPackage ../development/ocaml-modules/lru { };
+
     lwt2 = callPackage ../development/ocaml-modules/lwt { };
 
     lwt3 = if lib.versionOlder "4.02" ocaml.version
@@ -502,6 +510,8 @@ let
     piqi = callPackage ../development/ocaml-modules/piqi { };
     piqi-ocaml = callPackage ../development/ocaml-modules/piqi-ocaml { };
 
+    psq = callPackage ../development/ocaml-modules/psq { };
+
     ptime = callPackage ../development/ocaml-modules/ptime { };
 
     re2_p4 = callPackage ../development/ocaml-modules/re2 { };