From b65f33f6bd46d2cc373c1e42e234e15af016472c Mon Sep 17 00:00:00 2001 From: David Helkowski Date: Thu, 22 Jan 2026 14:33:16 +0900 Subject: [PATCH] Add pkg-config shim for libplist in libgpod formula to ensure compatibility with Homebrew's library naming conventions during installation. --- Formula/libgpod.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Formula/libgpod.rb b/Formula/libgpod.rb index 49f12a789..04e0b0a97 100644 --- a/Formula/libgpod.rb +++ b/Formula/libgpod.rb @@ -19,6 +19,25 @@ class Libgpod < Formula depends_on "sqlite" def install + # libgpod's configure.ac checks for pkg-config module name "libplist". + # Homebrew provides "libplist-2.0", so we provide a tiny shim .pc file to + # satisfy the expected name. + (buildpath/"brew-pkgconfig").mkpath + (buildpath/"brew-pkgconfig/libplist.pc").write <<~EOS + prefix=#{Formula["libplist"].opt_prefix} + exec_prefix=${prefix} + libdir=#{Formula["libplist"].opt_lib} + includedir=#{Formula["libplist"].opt_include} + + Name: libplist + Description: Apple property list library (Homebrew shim for libgpod) + Version: #{Formula["libplist"].version} + Libs: -L${libdir} -lplist-2.0 + Cflags: -I${includedir} + EOS + + ENV.prepend_path "PKG_CONFIG_PATH", buildpath/"brew-pkgconfig" + # Ensure pkg-config can find Homebrew keg .pc files during configure. ENV.prepend_path "PKG_CONFIG_PATH", Formula["libplist"].opt_lib/"pkgconfig" ENV.prepend_path "PKG_CONFIG_PATH", Formula["sqlite"].opt_lib/"pkgconfig"