Add pkg-config shim for libplist in libgpod formula to ensure compatibility with Homebrew's library naming conventions during installation.

This commit is contained in:
2026-01-22 14:33:16 +09:00
parent 09c49423bf
commit b65f33f6bd

View File

@@ -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"