Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

112 lines
2.4 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
stdenv,
fetchFromGitHub,
cmake,
ninja,
glog,
gflags,
folly,
fb303,
wangle,
fbthrift,
gtest,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "edencommon";
version = "2025.09.15.00";
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "facebookexperimental";
repo = "edencommon";
tag = "v${finalAttrs.version}";
hash = "sha256-KyJAosCLGnpEG968GV9BOyOrsoHS7BbRatTfBqzTelU=";
};
patches = [
./glog-0.7.patch
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
# Test discovery timeout is bizarrely flaky on `x86_64-darwin`
./increase-test-discovery-timeout.patch
];
nativeBuildInputs = [
cmake
ninja
];
buildInputs = [
glog
gflags
folly
fb303
wangle
fbthrift
gtest
];
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "CMAKE_INSTALL_RPATH_USE_LINK_PATH" true)
(lib.cmakeFeature "INCLUDE_INSTALL_DIR" "${placeholder "dev"}/include")
(lib.cmakeFeature "LIB_INSTALL_DIR" "${placeholder "out"}/lib")
(lib.cmakeFeature "CMAKE_INSTALL_DIR" "${placeholder "dev"}/lib/cmake/edencommon")
];
doCheck = true;
checkPhase = ''
runHook preCheck
# Skip flaky test
ctest -j $NIX_BUILD_CORES --output-on-failure ${
lib.escapeShellArgs [
"--exclude-regex"
(lib.concatMapStringsSep "|" (test: "^${lib.escapeRegex test}$") [
"ProcessInfoCache.addFromMultipleThreads"
])
]
}
runHook postCheck
'';
postPatch = ''
# The CMake build requires the FBThrift Python support even though
# its not used, presumably because of the relevant code having
# been moved in from another repository.
substituteInPlace CMakeLists.txt \
--replace-fail \
'find_package(FBThrift CONFIG REQUIRED COMPONENTS cpp2 py)' \
'find_package(FBThrift CONFIG REQUIRED COMPONENTS cpp2)'
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Shared library for Meta's source control filesystem tools (EdenFS and Watchman)";
homepage = "https://github.com/facebookexperimental/edencommon";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
kylesferrazza
emily
techknowlogick
];
};
})