1 class Watchman < Formula
2 desc "Watch files and take action when they change"
3 homepage "https://github.com/facebook/watchman"
4 url "https://github.com/facebook/watchman/archive/refs/tags/v2024.12.02.00.tar.gz"
5 sha256 "445bda6f262cd23ed305f914249e400c7377ebe21ec971a2ace6c1c3dfad5880"
8 head "https://github.com/facebook/watchman.git", branch: "main"
11 sha256 cellar: :any, arm64_sequoia: "caa41cb9dc1d7707da7078b7f8a7a1b5fb2d9c5193a744ea035627699e472ed9"
12 sha256 cellar: :any, arm64_sonoma: "9b70da1cfde3294c1bd0e498a7d091df78f95eefafae0190dbd9fa7c5c11bcc4"
13 sha256 cellar: :any, arm64_ventura: "83cecd08b798fb570eb9194a3e2ba7a7149f5b1a5448643439adac5e9f4fb48c"
14 sha256 cellar: :any, sonoma: "d32ba4e9aaab9dc10589b7e79cd3d1edfb30f39876fa53fc0f472503c28a4dc9"
15 sha256 cellar: :any, ventura: "91d3d3000f0e5cfd67c10c1526b93f81012ae3af4fccc7235b6504c31cc97a66"
16 sha256 cellar: :any_skip_relocation, x86_64_linux: "d793f03af48391058490f5bb8516239b101d6cfabc1b288cfbba90428ec54eb7"
19 depends_on "cmake" => :build
20 depends_on "cpptoml" => :build
21 depends_on "googletest" => :build
22 depends_on "mvfst" => :build
23 depends_on "pkgconf" => :build
24 depends_on "python-setuptools" => :build
25 depends_on "rust" => :build
26 depends_on "edencommon"
34 depends_on "openssl@3"
36 depends_on "python@3.13"
40 depends_on "libunwind"
44 # NOTE: Setting `BUILD_SHARED_LIBS=ON` will generate DSOs for Eden libraries.
45 # These libraries are not part of any install targets and have the wrong
46 # RPATHs configured, so will need to be installed and relocated manually
47 # if they are built as shared libraries. They're not used by any other
48 # formulae, so let's link them statically instead. This is done by default.
50 # Use the upstream default for WATCHMAN_STATE_DIR by unsetting it.
52 -DENABLE_EDEN_SUPPORT=ON
53 -DPython3_EXECUTABLE=#{which("python3.13")}
54 -DWATCHMAN_VERSION_OVERRIDE=#{version}
55 -DWATCHMAN_BUILDINFO_OVERRIDE=#{tap&.user || "Homebrew"}
58 # Avoid overlinking with libsodium and mvfst
59 args << "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-dead_strip_dylibs" if OS.mac?
61 system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
62 system "cmake", "--build", "build"
63 system "cmake", "--install", "build"
65 path = Pathname.new(File.join(prefix, HOMEBREW_PREFIX))
66 bin.install (path/"bin").children
67 lib.install (path/"lib").children
72 assert_equal(version.to_s, shell_output("#{bin}/watchman -v").chomp)