From 98d4e4214525a368b4bd31587f8932b6dd049ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Czapli=C5=84ski?= Date: Tue, 16 Oct 2018 21:38:57 +0200 Subject: [PATCH] ocamlPackages.zmq: init at 20180726 --- maintainers/maintainer-list.nix | 5 +++ .../development/ocaml-modules/zmq/default.nix | 32 +++++++++++++++++++ pkgs/development/ocaml-modules/zmq/lwt.nix | 12 +++++++ .../ocaml-modules/zmq/ocaml-zmq-issue43.patch | 11 +++++++ pkgs/top-level/ocaml-packages.nix | 4 +++ 5 files changed, 64 insertions(+) create mode 100644 pkgs/development/ocaml-modules/zmq/default.nix create mode 100644 pkgs/development/ocaml-modules/zmq/lwt.nix create mode 100644 pkgs/development/ocaml-modules/zmq/ocaml-zmq-issue43.patch diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index fe501623c698..13fa3ba9151c 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -158,6 +158,11 @@ github = "alexanderkjeldaas"; name = "Alexander Kjeldaas"; }; + akavel = { + email = "czapkofan@gmail.com"; + github = "akavel"; + name = "Mateusz CzapliƄski"; + }; akaWolf = { email = "akawolf0@gmail.com"; github = "akaWolf"; diff --git a/pkgs/development/ocaml-modules/zmq/default.nix b/pkgs/development/ocaml-modules/zmq/default.nix new file mode 100644 index 000000000000..a792877e0590 --- /dev/null +++ b/pkgs/development/ocaml-modules/zmq/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, ocaml, findlib, dune, czmq, stdint }: + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-zmq-${version}"; + version = "20180726"; + src = fetchFromGitHub { + owner = "issuu"; + repo = "ocaml-zmq"; + rev = "d312a8458d6b688f75470248f11875fbbfa5bb1a"; + sha256 = "1f5l4bw78y4drabhyvmpj3z8k30bill33ca7bzhr02m55yf6gqpf"; + }; + + patches = [ + ./ocaml-zmq-issue43.patch + ]; + + buildInputs = [ ocaml findlib dune czmq ]; + + propagatedBuildInputs = [ stdint ]; + + buildPhase = "dune build -p zmq"; + + inherit (dune) installPhase; + + meta = with stdenv.lib; { + description = "ZeroMQ bindings for OCaml"; + license = licenses.mit; + maintainers = with maintainers; [ akavel ]; + inherit (src.meta) homepage; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/zmq/lwt.nix b/pkgs/development/ocaml-modules/zmq/lwt.nix new file mode 100644 index 000000000000..80c934b44d64 --- /dev/null +++ b/pkgs/development/ocaml-modules/zmq/lwt.nix @@ -0,0 +1,12 @@ +{ stdenv, ocaml, findlib, dune, zmq, ocaml_lwt }: + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-zmq-lwt-${version}"; + inherit (zmq) version src installPhase meta; + + buildInputs = [ ocaml findlib dune ]; + + propagatedBuildInputs = [ zmq ocaml_lwt ]; + + buildPhase = "dune build -p zmq-lwt"; +} diff --git a/pkgs/development/ocaml-modules/zmq/ocaml-zmq-issue43.patch b/pkgs/development/ocaml-modules/zmq/ocaml-zmq-issue43.patch new file mode 100644 index 000000000000..0d01e8b45f39 --- /dev/null +++ b/pkgs/development/ocaml-modules/zmq/ocaml-zmq-issue43.patch @@ -0,0 +1,11 @@ +--- source/zmq/src/caml_zmq_stubs.c 1970-01-01 01:00:01.000000000 +0100 ++++ source/zmq/src/caml_zmq_stubs.c 1970-01-01 01:00:01.000000000 +0100 +@@ -35,7 +35,7 @@ + #include "socket.h" + #include "msg.h" + +-#include ++#include + + /** + * Version diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index c9df0f908ee2..9f9bba933a17 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -753,6 +753,10 @@ let zed = callPackage ../development/ocaml-modules/zed { }; + zmq = callPackage ../development/ocaml-modules/zmq { }; + + zmq-lwt = callPackage ../development/ocaml-modules/zmq/lwt.nix { }; + ocsigen_deriving = callPackage ../development/ocaml-modules/ocsigen-deriving { oasis = ocaml_oasis; };