2023-01-19 08:24:02 +00:00
|
|
|
{ boost
|
2023-05-12 14:17:16 +00:00
|
|
|
, cargo
|
2023-01-19 08:24:02 +00:00
|
|
|
, cmake
|
|
|
|
, CoreServices
|
|
|
|
, cpptoml
|
|
|
|
, double-conversion
|
|
|
|
, edencommon
|
|
|
|
, ensureNewerSourcesForZipFilesHook
|
|
|
|
, fb303
|
|
|
|
, fbthrift
|
|
|
|
, fetchFromGitHub
|
2024-06-19 05:37:06 +00:00
|
|
|
, fetchpatch
|
2023-01-19 08:24:02 +00:00
|
|
|
, fizz
|
|
|
|
, fmt_8
|
|
|
|
, folly
|
|
|
|
, glog
|
|
|
|
, gtest
|
|
|
|
, lib
|
|
|
|
, libevent
|
|
|
|
, libiconv
|
|
|
|
, libsodium
|
|
|
|
, libunwind
|
|
|
|
, lz4
|
|
|
|
, openssl
|
2023-08-12 03:46:49 +00:00
|
|
|
, pcre2
|
2023-01-19 08:24:02 +00:00
|
|
|
, pkg-config
|
|
|
|
, rustPlatform
|
2023-05-12 14:17:16 +00:00
|
|
|
, rustc
|
2023-01-19 08:24:02 +00:00
|
|
|
, stateDir ? "/tmp"
|
|
|
|
, stdenv
|
|
|
|
, wangle
|
|
|
|
, zlib
|
|
|
|
, zstd
|
2014-07-05 20:34:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "watchman";
|
2024-03-13 17:44:53 +00:00
|
|
|
version = "2024.03.11.00";
|
2014-07-05 20:34:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "watchman";
|
|
|
|
rev = "v${version}";
|
2024-03-13 17:44:53 +00:00
|
|
|
hash = "sha256-cD8mIYCc+8Z2p3rwKVRFcW9sOBbpb5KHU5VpbXHMpeg=";
|
2014-07-05 20:34:51 +00:00
|
|
|
};
|
|
|
|
|
2023-01-19 08:24:02 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
"-DENABLE_EDEN_SUPPORT=NO" # requires sapling (formerly known as eden), which is not packaged in nixpkgs
|
|
|
|
"-DWATCHMAN_STATE_DIR=${stateDir}"
|
2023-03-20 17:58:14 +00:00
|
|
|
"-DWATCHMAN_VERSION_OVERRIDE=${version}"
|
2023-01-19 08:24:02 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14" # For aligned allocation
|
|
|
|
];
|
2014-07-05 20:34:51 +00:00
|
|
|
|
2023-01-19 08:24:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
ensureNewerSourcesForZipFilesHook
|
2023-05-12 14:17:16 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
cargo
|
|
|
|
rustc
|
|
|
|
];
|
2016-01-28 16:58:33 +00:00
|
|
|
|
2023-01-19 08:24:02 +00:00
|
|
|
buildInputs = [
|
2023-08-12 03:46:49 +00:00
|
|
|
pcre2
|
2023-01-19 08:24:02 +00:00
|
|
|
openssl
|
|
|
|
gtest
|
|
|
|
glog
|
|
|
|
boost
|
|
|
|
libevent
|
|
|
|
fmt_8
|
|
|
|
libsodium
|
|
|
|
zlib
|
|
|
|
folly
|
|
|
|
fizz
|
|
|
|
wangle
|
|
|
|
fbthrift
|
|
|
|
fb303
|
|
|
|
cpptoml
|
|
|
|
edencommon
|
|
|
|
libunwind
|
|
|
|
double-conversion
|
|
|
|
lz4
|
|
|
|
zstd
|
|
|
|
libiconv
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices ];
|
2014-07-05 20:34:51 +00:00
|
|
|
|
2023-01-19 08:24:02 +00:00
|
|
|
cargoRoot = "watchman/cli";
|
2017-08-24 16:17:27 +00:00
|
|
|
|
2023-01-19 08:24:02 +00:00
|
|
|
cargoDeps = rustPlatform.importCargoLock {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
};
|
|
|
|
|
2024-06-19 05:37:06 +00:00
|
|
|
patches = [
|
|
|
|
# fix build with rustc >=1.79
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/facebook/watchman/commit/c3536143cab534cdd9696eb3e2d03c4ac1e2f883.patch";
|
|
|
|
hash = "sha256-lpGr5H28gfVXkWNdfDo4SCbF/p5jB4SNlHj6km/rfw4=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-01-19 08:24:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
cp ${./Cargo.lock} ${cargoRoot}/Cargo.lock
|
2014-07-05 20:34:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Watches files and takes action when they change";
|
2023-01-19 08:24:02 +00:00
|
|
|
homepage = "https://facebook.github.io/watchman";
|
2023-09-29 22:29:36 +00:00
|
|
|
maintainers = with maintainers; [ kylesferrazza ];
|
2023-01-19 08:24:02 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.mit;
|
2014-07-05 20:34:51 +00:00
|
|
|
};
|
|
|
|
}
|