From 48b5788c062ba492c34890e1b2a7cb26c8a1505f Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Fri, 18 Oct 2024 12:34:22 -0400 Subject: [PATCH 1/3] pkgconf: drop-in replacement for `pkg-config` --- Aliases/pkg-config | 1 + Aliases/pkgconfig | 2 +- Formula/p/pkgconf.rb | 38 ++++++++++++++++++++++---------------- 3 files changed, 24 insertions(+), 17 deletions(-) create mode 120000 Aliases/pkg-config diff --git a/Aliases/pkg-config b/Aliases/pkg-config new file mode 120000 index 0000000000000..cfd1caa5c3348 --- /dev/null +++ b/Aliases/pkg-config @@ -0,0 +1 @@ +../Formula/p/pkgconf.rb \ No newline at end of file diff --git a/Aliases/pkgconfig b/Aliases/pkgconfig index 1682f2a4a6ac2..cfd1caa5c3348 120000 --- a/Aliases/pkgconfig +++ b/Aliases/pkgconfig @@ -1 +1 @@ -../Formula/p/pkg-config.rb \ No newline at end of file +../Formula/p/pkgconf.rb \ No newline at end of file diff --git a/Formula/p/pkgconf.rb b/Formula/p/pkgconf.rb index 5b5247f96de3e..7772248e2c3e0 100644 --- a/Formula/p/pkgconf.rb +++ b/Formula/p/pkgconf.rb @@ -2,8 +2,10 @@ class Pkgconf < Formula desc "Package compiler and linker metadata toolkit" homepage "https://github.com/pkgconf/pkgconf" url "https://distfiles.ariadne.space/pkgconf/pkgconf-2.3.0.tar.xz" + mirror "http://distfiles.ariadne.space/pkgconf/pkgconf-2.3.0.tar.xz" sha256 "3a9080ac51d03615e7c1910a0a2a8df08424892b5f13b0628a204d3fcce0ea8b" license "ISC" + revision 1 livecheck do url "https://distfiles.ariadne.space/pkgconf/" @@ -30,8 +32,6 @@ class Pkgconf < Formula depends_on "libtool" => :build end - conflicts_with "pkg-config", because: "both install `pkg.m4` file" - def install if build.head? ENV["LIBTOOLIZE"] = "glibtoolize" @@ -42,27 +42,33 @@ def install #{HOMEBREW_PREFIX}/lib/pkgconfig #{HOMEBREW_PREFIX}/share/pkgconfig ] - pc_path << if OS.mac? - pc_path << "/usr/local/lib/pkgconfig" - pc_path << "/usr/lib/pkgconfig" - "#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}" + pc_path += if OS.mac? + %W[ + /usr/local/lib/pkgconfig + /usr/lib/pkgconfig + #{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version} + ] else - "#{HOMEBREW_LIBRARY}/Homebrew/os/linux/pkgconfig" + ["#{HOMEBREW_LIBRARY}/Homebrew/os/linux/pkgconfig"] end - pc_path = pc_path.uniq.join(File::PATH_SEPARATOR) - - configure_args = std_configure_args + %W[ - --with-pkg-config-dir=#{pc_path} - ] - - system "./configure", *configure_args + system "./configure", "--disable-silent-rules", + "--with-pkg-config-dir=#{pc_path.uniq.join(File::PATH_SEPARATOR)}", + *std_configure_args system "make" system "make", "install" + + # Make `pkgconf` a drop-in replacement for `pkg-config` by adding symlink[^1]. + # Similar to Debian[^2], Fedora, ArchLinux and MacPorts. + # + # [^1]: https://github.com/pkgconf/pkgconf/#pkg-config-symlink + # [^2]: https://salsa.debian.org/debian/pkgconf/-/blob/debian/unstable/debian/pkgconf.links?ref_type=heads + bin.install_symlink "pkgconf" => "pkg-config" + man1.install_symlink "pkgconf.1" => "pkg-config.1" end test do - (testpath/"foo.pc").write <<~EOS + (testpath/"foo.pc").write <<~PC prefix=/usr exec_prefix=${prefix} includedir=${prefix}/include @@ -73,7 +79,7 @@ def install Version: 1.0.0 Cflags: -I${includedir}/foo Libs: -L${libdir} -lfoo - EOS + PC ENV["PKG_CONFIG_LIBDIR"] = testpath system bin/"pkgconf", "--validate", "foo" From 2ddcf80b77a6db2485c4e9ecaa33c519b9e68164 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Sun, 3 Nov 2024 11:29:30 -0500 Subject: [PATCH 2/3] pkg-config: replace with `pkgconf` --- Formula/p/pkg-config.rb | 92 ----------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 Formula/p/pkg-config.rb diff --git a/Formula/p/pkg-config.rb b/Formula/p/pkg-config.rb deleted file mode 100644 index 3dbf0afa8a943..0000000000000 --- a/Formula/p/pkg-config.rb +++ /dev/null @@ -1,92 +0,0 @@ -class PkgConfig < Formula - desc "Manage compile and link flags for libraries" - homepage "https://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 - - livecheck do - url "https://pkg-config.freedesktop.org/releases/" - regex(/href=.*?pkg-config[._-]v?(\d+(?:\.\d+)+)\./i) - end - - bottle do - sha256 arm64_sequoia: "ee6fe55249da7637626c82195cba7f4251c64066cc067935d35317c484460a09" - sha256 arm64_sonoma: "7b59abc0b5381065b1eab174217307af9324e0d02edf903171b29250ae58aeaf" - sha256 arm64_ventura: "3ff612c5e44b945c8c0cc6df7d3edb407ca67cddad9c89f9ab99ced494b7a8c2" - sha256 arm64_monterey: "2af9bceb60b70a259f236f1d46d2bb24c4d0a4af8cd63d974dde4d76313711e0" - sha256 arm64_big_sur: "ffd4491f62201d14b7eca6beff954a2ab265351589cd5b3b79b8bbb414485574" - sha256 sequoia: "55f4268c3d6f320932ce736e8ad862a98b27048a30481f85c0679d8c655fb0f6" - sha256 sonoma: "421571f340277c62c5cc6fd68737bd7c4e085de113452ea49b33bcd46509bb12" - sha256 ventura: "c44b1544815518726d280d92d6f6df09bd45e41ad20fd43424725c1c20760be8" - sha256 monterey: "a6ba80711f98b65d8a2bf2c9278540860415e9b5e545da338a4d94f39d119285" - sha256 big_sur: "0040b6ebe07f60549800b211343fd5fb3cf83c866d9f62e40f5fb2f38b71e161" - sha256 catalina: "80f141e695f73bd058fd82e9f539dc67471666ff6800c5e280b5af7d3050f435" - sha256 mojave: "0d14b797dba0e0ab595c9afba8ab7ef9c901b60b4f806b36580ef95ebb370232" - sha256 high_sierra: "8c6160305abd948b8cf3e0d5c6bb0df192fa765bbb9535dda0b573cb60abbe52" - 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 - - def install - pc_path = %W[ - #{HOMEBREW_PREFIX}/lib/pkgconfig - #{HOMEBREW_PREFIX}/share/pkgconfig - ] - pc_path << if OS.mac? - system_include_path = "#{MacOS.sdk_path_if_needed}/usr/include" - - pc_path << "/usr/local/lib/pkgconfig" - pc_path << "/usr/lib/pkgconfig" - "#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}" - else - system_include_path = "/usr/include" - - "#{HOMEBREW_LIBRARY}/Homebrew/os/linux/pkgconfig" - end - - pc_path = pc_path.uniq.join(File::PATH_SEPARATOR) - - # Work-around for build issue with Xcode 15.3 - # https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/81 - ENV.append_to_cflags "-Wno-int-conversion" - - system "./configure", "--disable-debug", - "--prefix=#{prefix}", - "--disable-host-tool", - "--with-internal-glib", - "--with-pc-path=#{pc_path}", - "--with-system-include-path=#{system_include_path}" - system "make" - system "make", "install" - end - - test do - (testpath/"foo.pc").write <<~EOS - prefix=/usr - exec_prefix=${prefix} - includedir=${prefix}/include - libdir=${exec_prefix}/lib - - Name: foo - Description: The foo library - Version: 1.0.0 - Cflags: -I${includedir}/foo - Libs: -L${libdir} -lfoo - EOS - - ENV["PKG_CONFIG_LIBDIR"] = testpath - system bin/"pkg-config", "--validate", "foo" - 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") - end -end From 2fb756508be49f99faeaa4af9915629fb2a90232 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Tue, 12 Nov 2024 03:39:58 +0000 Subject: [PATCH 3/3] pkgconf: update 2.3.0_1 bottle. --- Formula/p/pkgconf.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Formula/p/pkgconf.rb b/Formula/p/pkgconf.rb index 7772248e2c3e0..cf716188065e0 100644 --- a/Formula/p/pkgconf.rb +++ b/Formula/p/pkgconf.rb @@ -13,15 +13,12 @@ class Pkgconf < Formula end bottle do - sha256 arm64_sequoia: "18c4da47fd2032c4edfac853b772e1a16a745a0c67335b86931fb2bec8c10933" - sha256 arm64_sonoma: "4d7c5803943bf2dcc8cb9ff8c838ea4283eeab24f49982df044cbc3031856fd8" - sha256 arm64_ventura: "e0b2a95c807578a166fab8467305f1d54db32fe0656a4d6cb746c2356146b074" - sha256 arm64_monterey: "ac13529811ba6f3e57f7f4048711720d073e10a8797768073626f5d6daabbf76" - sha256 sequoia: "9b44fe313d296fa10617d6b58ea1eab78bf217b6f00478ad98b01e0375475472" - sha256 sonoma: "1db60da1d512bb109dd455f03856e790a156137f9d77f1f507ac72d538a1c1e2" - sha256 ventura: "5f272a6b79920f7c236eaa01d94fc8da99ebc79947a56d1808a19d436571c9c8" - sha256 monterey: "802a81f3ca1ea1a14699d6e2359e0ccd30ef310142c6c305b17d881cbd6d2ed0" - sha256 x86_64_linux: "67710376078e1191ece25d69214d9ced135195b07c24a386db0d9aee590c8ead" + sha256 arm64_sequoia: "e20314280a6fccd1153b13f137f9e7a15fc4450c877d548360a259c22266efa0" + sha256 arm64_sonoma: "5f83615f295e78e593c767d84f3eddf61bfb0b849a1e6a5ea343506b30b2c620" + sha256 arm64_ventura: "715c2c815d44a6c06da7e249c6b7d6f10c51784866c1ca43c22e5d56c45d5ebd" + sha256 sonoma: "b180115e5725a12657fa74d80f0c8f15e852d6c84b7f982b72b5be4f5cd0e97a" + sha256 ventura: "7077e63921d21433ef33d38a2a4cd14f2b08bccf6647bcc25b3f285135e9038c" + sha256 x86_64_linux: "4fe98600d631d8d816217b96f905beb7ee40f2b736a3b74621973f908b6d295a" end head do