Skip to content

Commit

Permalink
libcap-ng: work around Homebrew dir structure to install Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Feb 21, 2024
1 parent f753618 commit df47852
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Formula/lib/libcap-ng.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit df47852

Please sign in to comment.