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

pkg-config: split out pkg.m4 #182175

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
pkg-config: split out pkg.m4
To (at least temporarily) remove conflict with `pkgconf` so that it
allows for migration. `pkgconf` has replaced `pkg-config` in major
repositories like Debian and Fedora.
  • Loading branch information
cho-m committed Aug 23, 2024
commit 4d2f32bf7c5374470cdf386672cb12600d0efbf3
12 changes: 8 additions & 4 deletions Formula/p/pkg-config.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class PkgConfig < Formula
desc "Manage compile and link flags for libraries"
homepage "https://freedesktop.org/wiki/Software/pkg-config/"
homepage "https://www.freedesktop.org/wiki/Software/pkg-config/"
url "https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz"
mirror "http://fresh-center.net/linux/misc/pkg-config-0.29.2.tar.gz"
mirror "http://fresh-center.net/linux/misc/legacy/pkg-config-0.29.2.tar.gz"
sha256 "6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591"
license "GPL-2.0-or-later"
revision 3
revision 4

livecheck do
url "https://pkg-config.freedesktop.org/releases/"
@@ -28,12 +28,12 @@ class PkgConfig < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "3d9b8bf9b7b4bd08086be1104e3e18afb1c437dfaca03e6e7df8f2710b9c1c1a"
end

conflicts_with "pkgconf", because: "both install `pkg.m4` file"

# FIXME: The bottle is mistakenly considered relocatable on Linux.
# See https://github.com/Homebrew/homebrew-core/pull/85032.
pour_bottle? only_if: :default_prefix

depends_on "pkg.m4"

def install
pc_path = %W[
#{HOMEBREW_PREFIX}/lib/pkgconfig
@@ -65,6 +65,9 @@ def install
"--with-system-include-path=#{system_include_path}"
system "make"
system "make", "install"

# Move `pkg.m4` into libexec as using copy from formula. Keep to make sure identical.
libexec.install share/"aclocal/pkg.m4"
end

test do
@@ -86,5 +89,6 @@ def install
assert_equal "1.0.0\n", shell_output("#{bin}/pkg-config --modversion foo")
assert_equal "-lfoo\n", shell_output("#{bin}/pkg-config --libs foo")
assert_equal "-I/usr/include/foo\n", shell_output("#{bin}/pkg-config --cflags foo")
assert_equal (Formula["pkg.m4"].share/"aclocal/pkg.m4").read, (libexec/"pkg.m4").read
end
end