summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorUlrik Strid <ulrik.strid@outlook.com>2021-07-12 11:29:43 +0200
committerGitHub <noreply@github.com>2021-07-12 11:29:43 +0200
commita164e1d0a17549cc4c238cfe9c32a0bac97b24e1 (patch)
tree9833a630b8bc870aef817f36031be6634740f256 /pkgs
parent17de7c8df1436a2e71d9efdf6f10ea0585fe5c8e (diff)
downloadnixpkgs-a164e1d0a17549cc4c238cfe9c32a0bac97b24e1.tar
nixpkgs-a164e1d0a17549cc4c238cfe9c32a0bac97b24e1.tar.gz
nixpkgs-a164e1d0a17549cc4c238cfe9c32a0bac97b24e1.tar.bz2
nixpkgs-a164e1d0a17549cc4c238cfe9c32a0bac97b24e1.tar.lz
nixpkgs-a164e1d0a17549cc4c238cfe9c32a0bac97b24e1.tar.xz
nixpkgs-a164e1d0a17549cc4c238cfe9c32a0bac97b24e1.tar.zst
nixpkgs-a164e1d0a17549cc4c238cfe9c32a0bac97b24e1.zip
ocamlPackages.json-data-encoding: init at 0.8, ocamlPackages.data-encoding: init at 0.2.0 (#129444)
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/ocaml-modules/data-encoding/default.nix46
-rw-r--r--pkgs/development/ocaml-modules/json-data-encoding/bson.nix20
-rw-r--r--pkgs/development/ocaml-modules/json-data-encoding/default.nix31
-rw-r--r--pkgs/top-level/ocaml-packages.nix6
4 files changed, 103 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/data-encoding/default.nix b/pkgs/development/ocaml-modules/data-encoding/default.nix
new file mode 100644
index 00000000000..2e4e0518a52
--- /dev/null
+++ b/pkgs/development/ocaml-modules/data-encoding/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, ezjsonm
+, zarith
+, hex
+, json-data-encoding
+, json-data-encoding-bson
+, alcotest
+, crowbar
+}:
+
+buildDunePackage {
+  pname = "data-encoding";
+  version = "0.2.0";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "data-encoding";
+    rev = "0.2";
+    sha256 = "0d9c2ix2imqk4r0jfhnwak9laarlbsq9kmswvbnjzdm2g0hwin1d";
+  };
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    ezjsonm
+    zarith
+    hex
+    json-data-encoding
+    json-data-encoding-bson
+  ];
+
+  checkInputs = [
+    alcotest
+    crowbar
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://gitlab.com/nomadic-labs/data-encoding";
+    description = "Library of JSON and binary encoding combinators";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/json-data-encoding/bson.nix b/pkgs/development/ocaml-modules/json-data-encoding/bson.nix
new file mode 100644
index 00000000000..5048a8fd06a
--- /dev/null
+++ b/pkgs/development/ocaml-modules/json-data-encoding/bson.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, json-data-encoding, ocplib-endian, crowbar }:
+
+buildDunePackage {
+  pname = "json-data-encoding-bson";
+
+  inherit (json-data-encoding) version src useDune2 doCheck;
+
+  propagatedBuildInputs = [
+    json-data-encoding
+    ocplib-endian
+  ];
+
+  checkInputs = [
+    crowbar
+  ];
+
+  meta = json-data-encoding.meta // {
+    description = "Type-safe encoding to and decoding from JSON (bson support)";
+  };
+}
diff --git a/pkgs/development/ocaml-modules/json-data-encoding/default.nix b/pkgs/development/ocaml-modules/json-data-encoding/default.nix
new file mode 100644
index 00000000000..6dfea612b10
--- /dev/null
+++ b/pkgs/development/ocaml-modules/json-data-encoding/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchFromGitLab, buildDunePackage, uri, crowbar }:
+
+buildDunePackage rec {
+  pname = "json-data-encoding";
+  version = "0.8";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "json-data-encoding";
+    rev = "v${version}";
+    sha256 = "1c6m2qvi9bm6qjxc38p6cia1f66r0rb9xf6b8svlj3jjymvqw889";
+  };
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    uri
+  ];
+
+  checkInputs = [
+    crowbar
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://gitlab.com/nomadic-labs/json-data-encoding";
+    description = "Type-safe encoding to and decoding from JSON";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index 977d70e7ef1..31ef92e4204 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -242,6 +242,8 @@ let
 
     dap =  callPackage ../development/ocaml-modules/dap { };
 
+    data-encoding = callPackage ../development/ocaml-modules/data-encoding { };
+
     decompress =  callPackage ../development/ocaml-modules/decompress { };
 
     diet =  callPackage ../development/ocaml-modules/diet { };
@@ -548,6 +550,10 @@ let
 
     jsonm = callPackage ../development/ocaml-modules/jsonm { };
 
+    json-data-encoding = callPackage ../development/ocaml-modules/json-data-encoding { };
+
+    json-data-encoding-bson = callPackage ../development/ocaml-modules/json-data-encoding/bson.nix { };
+
     junit = callPackage ../development/ocaml-modules/junit { };
     junit_ounit = callPackage ../development/ocaml-modules/junit/ounit.nix { };
     junit_alcotest = callPackage ../development/ocaml-modules/junit/alcotest.nix { };