1{
2 lib,
3 stdenv,
4
5 fetchFromGitHub,
6
7 cmake,
8 ninja,
9
10 gflags,
11 glog,
12 folly,
13 fbthrift,
14 fizz,
15 wangle,
16
17 nix-update-script,
18}:
19
20stdenv.mkDerivation (finalAttrs: {
21 pname = "fb303";
22 version = "2025.04.21.00";
23
24 outputs = [
25 "out"
26 "dev"
27 ];
28
29 src = fetchFromGitHub {
30 owner = "facebook";
31 repo = "fb303";
32 tag = "v${finalAttrs.version}";
33 hash = "sha256-Cgr+uuUl+tlyWdAvBCVMK/mInYu+M5N9QLMTvvJ3oEk=";
34 };
35
36 patches = [
37 ./glog-0.7.patch
38 ];
39
40 nativeBuildInputs = [
41 cmake
42 ninja
43 ];
44
45 buildInputs = [
46 gflags
47 glog
48 folly
49 fbthrift
50 fizz
51 wangle
52 ];
53
54 cmakeFlags = [
55 (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
56
57 (lib.cmakeBool "CMAKE_INSTALL_RPATH_USE_LINK_PATH" true)
58
59 (lib.cmakeBool "PYTHON_EXTENSIONS" false)
60
61 (lib.cmakeFeature "INCLUDE_INSTALL_DIR" "${placeholder "dev"}/include")
62 (lib.cmakeFeature "LIB_INSTALL_DIR" "${placeholder "out"}/lib")
63 (lib.cmakeFeature "CMAKE_INSTALL_DIR" "${placeholder "dev"}/lib/cmake/fb303")
64 (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (placeholder "dev"))
65 ];
66
67 passthru.updateScript = nix-update-script { };
68
69 meta = {
70 description = "Base Thrift service and a common set of functionality for querying stats, options, and other information from a service";
71 homepage = "https://github.com/facebook/fb303";
72 license = lib.licenses.asl20;
73 platforms = lib.platforms.unix;
74 maintainers = with lib.maintainers; [
75 kylesferrazza
76 emily
77 techknowlogick
78 ];
79 };
80})