about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/watchman/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/watchman/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/watchman/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/watchman/default.nix b/nixpkgs/pkgs/development/tools/watchman/default.nix
new file mode 100644
index 000000000000..b349ecf61e13
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/watchman/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, lib, config, fetchFromGitHub, autoconf, automake, pcre,
+  libtool, pkgconfig, openssl,
+  confFile ? config.watchman.confFile or null,
+  withApple ? stdenv.isDarwin, CoreServices, CoreFoundation
+}:
+
+stdenv.mkDerivation rec {
+  name = "watchman-${version}";
+
+  version = "4.9.0";
+
+  src = fetchFromGitHub {
+    owner = "facebook";
+    repo = "watchman";
+    rev = "v${version}";
+    sha256 = "0fdaj5pmicm6j17d5q7px800m5rmam1a400x3hv1iiifnmhgnkal";
+  };
+
+  buildInputs = [ pcre openssl ]
+               ++ lib.optionals withApple [ CoreFoundation CoreServices ];
+  nativeBuildInputs = [ autoconf automake pkgconfig libtool ];
+
+  configureFlags = [
+      "--enable-lenient"
+      "--enable-conffile=${if confFile == null then "no" else confFile}"
+      "--with-pcre=yes"
+
+      # For security considerations re: --disable-statedir, see:
+      # https://github.com/facebook/watchman/issues/178
+      "--disable-statedir"
+  ];
+
+  prePatch = ''
+    patchShebangs .
+  '';
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with lib; {
+    description = "Watches files and takes action when they change";
+    homepage    = https://facebook.github.io/watchman;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms   = with platforms; linux ++ darwin;
+    license     = licenses.asl20;
+  };
+}