Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcap-ng: work around Homebrew dir structure to install Python bindings #163561

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Formula/lib/libcap-ng.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class LibcapNg < Formula
license all_of: ["LGPL-2.1-or-later", "GPL-2.0-or-later"]

bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, x86_64_linux: "3762e67587dbdae0a476f3e25a2b7f6274a6328cf8f9ca3304857d995907b9be"
rebuild 2
sha256 cellar: :any_skip_relocation, x86_64_linux: "2c95eb278def830071146f6a7f5e9cdd9f03caf71646604b5a4013a3750375a3"
end

head do
Expand All @@ -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
Loading