diff --git a/pkgs/development/ocaml-modules/amqp-client/async.nix b/pkgs/development/ocaml-modules/amqp-client/async.nix new file mode 100644 index 000000000000..0bc781de66e4 --- /dev/null +++ b/pkgs/development/ocaml-modules/amqp-client/async.nix @@ -0,0 +1,29 @@ +{ + buildDunePackage, + async, + uri, + amqp-client, + ezxmlm, +}: + +buildDunePackage { + pname = "amqp-client-async"; + + inherit (amqp-client) version src; + + doCheck = true; + + buildInputs = [ + ezxmlm + ]; + + propagatedBuildInputs = [ + amqp-client + async + uri + ]; + + meta = amqp-client.meta // { + description = "Amqp client library, async version"; + }; +} diff --git a/pkgs/development/ocaml-modules/amqp-client/default.nix b/pkgs/development/ocaml-modules/amqp-client/default.nix new file mode 100644 index 000000000000..112710d2a439 --- /dev/null +++ b/pkgs/development/ocaml-modules/amqp-client/default.nix @@ -0,0 +1,39 @@ +{ + lib, + buildDunePackage, + fetchFromGitHub, + version ? "2.3.0", +}: + +buildDunePackage { + pname = "amqp-client"; + + inherit version; + minimalOCamlVersion = "4.14.0"; + + src = fetchFromGitHub { + owner = "andersfugmann"; + repo = "amqp-client"; + tag = version; + hash = "sha256-zWhkjVoKyNCIBXD5746FywCg3DKn1mXb1tn1VlF9Tyg="; + }; + + doCheck = true; + + meta = { + description = "Amqp client base library"; + homepage = "https://github.com/andersfugmann/amqp-client"; + license = lib.licenses.bsd3; + changelog = "https://raw.githubusercontent.com/andersfugmann/amqp-client/refs/tags/${version}/Changelog"; + maintainers = with lib.maintainers; [ momeemt ]; + longDescription = '' + This library provides high level client bindings for amqp. The library + is tested with rabbitmq, but should work with other amqp + servers. The library is written in pure OCaml. + + This is the base library required by lwt/async versions. + You should install either amqp-client-async or amqp-client-lwt + for actual client functionality. + ''; + }; +} diff --git a/pkgs/development/ocaml-modules/amqp-client/lwt.nix b/pkgs/development/ocaml-modules/amqp-client/lwt.nix new file mode 100644 index 000000000000..6ddb2683c46e --- /dev/null +++ b/pkgs/development/ocaml-modules/amqp-client/lwt.nix @@ -0,0 +1,28 @@ +{ + buildDunePackage, + lwt, + lwt_log, + amqp-client, + uri, + ezxmlm, +}: +buildDunePackage { + pname = "amqp-client-lwt"; + + inherit (amqp-client) version src; + + buildInputs = [ ezxmlm ]; + + propagatedBuildInputs = [ + lwt + lwt_log + amqp-client + uri + ]; + + doCheck = true; + + meta = amqp-client.meta // { + description = "Amqp client library, lwt version"; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index ae6b6a4b7312..6a323c16944d 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -32,6 +32,12 @@ let ancient = callPackage ../development/ocaml-modules/ancient { }; + amqp-client = callPackage ../development/ocaml-modules/amqp-client { }; + + amqp-client-async = callPackage ../development/ocaml-modules/amqp-client/async.nix { }; + + amqp-client-lwt = callPackage ../development/ocaml-modules/amqp-client/lwt.nix { }; + angstrom = callPackage ../development/ocaml-modules/angstrom { }; angstrom-async = callPackage ../development/ocaml-modules/angstrom-async { };