From 3beb47ff2a6abe579d01dd24948eeedc0cebbb0a Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 2 Jul 2017 15:03:48 +0200 Subject: [PATCH] ocamlPackages.inotify: init at 2.3 This package contains bindings for Linux's filesystem monitoring interface, inotify. Homepage: https://github.com/whitequark/ocaml-inotify --- .../ocaml-modules/inotify/default.nix | 36 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/ocaml-modules/inotify/default.nix diff --git a/pkgs/development/ocaml-modules/inotify/default.nix b/pkgs/development/ocaml-modules/inotify/default.nix new file mode 100644 index 00000000000..e2993077521 --- /dev/null +++ b/pkgs/development/ocaml-modules/inotify/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild +, ocaml_lwt # optional lwt support +, doCheck ? stdenv.lib.versionAtLeast ocaml.version "4.03" +, ounit, fileutils # only for tests +}: + +stdenv.mkDerivation rec { + version = "2.3"; + name = "ocaml${ocaml.version}-inotify-${version}"; + + src = fetchFromGitHub { + owner = "whitequark"; + repo = "ocaml-inotify"; + rev = "v${version}"; + sha256 = "1s6vmqpx19hxzsi30jvp3h7p56rqnxfhfddpcls4nz8sqca1cz5y"; + }; + + buildInputs = [ ocaml findlib ocamlbuild ocaml_lwt ] + ++ stdenv.lib.optionals doCheck [ ounit fileutils ]; + + configureFlags = [ "--enable-lwt" + (stdenv.lib.optionalString doCheck "--enable-tests") ]; + + inherit doCheck; + checkTarget = "test"; + + createFindlibDestdir = true; + + meta = { + description = "Bindings for Linux’s filesystem monitoring interface, inotify"; + license = stdenv.lib.licenses.lgpl21; + maintainers = [ stdenv.lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index e6a025556c2..1c611610817 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -226,6 +226,8 @@ let higlo = callPackage ../development/ocaml-modules/higlo { }; + inotify = callPackage ../development/ocaml-modules/inotify { }; + io-page = callPackage ../development/ocaml-modules/io-page { }; ipaddr_p4 = callPackage ../development/ocaml-modules/ipaddr/2.6.1.nix { };