From df4785272af2bede3de1cd6a9415648966d994b9 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Wed, 21 Feb 2024 12:21:29 -0500 Subject: [PATCH] libcap-ng: work around Homebrew dir structure to install Python bindings --- Formula/lib/libcap-ng.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Formula/lib/libcap-ng.rb b/Formula/lib/libcap-ng.rb index 3520f06cde14e..2e6dbdd294a51 100644 --- a/Formula/lib/libcap-ng.rb +++ b/Formula/lib/libcap-ng.rb @@ -28,12 +28,16 @@ class LibcapNg < Formula # https://github.com/stevegrubb/libcap-ng/commit/30453b6553948cd05c438f9f509013e3bb84f25b patch :DATA + def python3 + "python3.12" + end + def install system "./autogen.sh" if build.head? system "./configure", *std_configure_args, "--disable-silent-rules", "--with-python3" - system "make", "install" + system "make", "install", "py3execdir=#{prefix/Language::Python.site_packages(python3)}" end test do @@ -49,7 +53,7 @@ def install EOS system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lcap-ng", "-o", "test" assert_equal "ok", `./test` - system "python3.12", "-c", "import capng" + system python3, "-c", "import capng" end end