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 { };