Skip to content

Commit

Permalink
Merge pull request Homebrew#199001 from Homebrew/pkgconf-migrations-l…
Browse files Browse the repository at this point in the history
…ib-2

lib*: migrate to `pkgconf` (part 2)
  • Loading branch information
chenrui333 authored Nov 26, 2024
2 parents a696102 + 45a8173 commit f3b424f
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 70 deletions.
7 changes: 3 additions & 4 deletions Formula/lib/libdnet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ class Libdnet < Formula
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build

def install
# autoreconf to get '.dylib' extension on shared lib
ENV.append_path "ACLOCAL_PATH", "config"
system "autoreconf", "-ivf"
system "autoreconf", "--force", "--install", "--verbose"

args = std_configure_args - ["--disable-debug"]
system "./configure", *args, "--mandir=#{man}", "--disable-check"
system "./configure", "--mandir=#{man}", "--disable-check", *std_configure_args
system "make", "install"
end

Expand Down
6 changes: 3 additions & 3 deletions Formula/lib/libdom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Libdom < Formula
end

depends_on "netsurf-buildsystem" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "libhubbub"
depends_on "libwapcaplet"
uses_from_macos "expat"
Expand All @@ -47,8 +47,8 @@ def install
}
C

pkg_config_flags = shell_output("pkg-config --cflags --libs libdom").chomp.split
system ENV.cc, "test.c", "-o", "test", *pkg_config_flags
flags = shell_output("pkgconf --cflags --libs libdom").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end
2 changes: 1 addition & 1 deletion Formula/lib/libdpp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Libdpp < Formula
depends_on "cmake" => :build
depends_on "openssl@3"
depends_on "opus"
depends_on "pkg-config"
depends_on "pkgconf"

uses_from_macos "zlib"

Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libdrawtext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Libdrawtext < Formula
sha256 cellar: :any, big_sur: "2f01264e3b9729a123e24c71078c5b7b5c2189c2a2ed2a8481763080ed213ce1"
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "freetype"

on_linux do
Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libdrm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Libdrm < Formula
depends_on "docutils" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "libpciaccess"
depends_on :linux

Expand Down
11 changes: 5 additions & 6 deletions Formula/lib/libdv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Libdv < Formula
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
end

# remove SDL1 dependency by force
Expand All @@ -44,18 +44,17 @@ def install
# This flag is the preferred method over what macports uses.
# See the apple docs: https://cl.ly/2HeF bottom of the "Finding Imported Symbols" section
ENV.append "LDFLAGS", "-undefined dynamic_lookup"
system "autoreconf", "-fvi"
system "autoreconf", "--force", "--install", "--verbose"
end

# Fix compile with newer Clang
ENV.append_to_cflags "-Wno-implicit-function-declaration" if DevelopmentTools.clang_build_version >= 1403

system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
system "./configure", "--disable-asm",
"--disable-gtktest",
"--disable-gtk",
"--disable-asm",
"--disable-sdltest"
"--disable-sdltest",
*std_configure_args
system "make", "install"
end
end
Expand Down
7 changes: 3 additions & 4 deletions Formula/lib/libdvdnav.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ class Libdvdnav < Formula
depends_on "libtool" => :build
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "libdvdread"

def install
system "autoreconf", "-if" if build.head?
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "autoreconf", "--force", "--install", "--verbose" if build.head?
system "./configure", *std_configure_args
system "make", "install"
end
end
2 changes: 1 addition & 1 deletion Formula/lib/libebur128.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Libebur128 < Formula
end

depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "speex"

def install
Expand Down
3 changes: 1 addition & 2 deletions Formula/lib/libepoxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Libepoxy < Formula

depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build

on_linux do
depends_on "freeglut"
Expand All @@ -42,7 +42,6 @@ def install

test do
(testpath/"test.c").write <<~C
#include <epoxy/gl.h>
#ifdef OS_MAC
#include <OpenGL/CGLContext.h>
Expand Down
4 changes: 2 additions & 2 deletions Formula/lib/libestr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Libestr < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "6f131de3ed214869ab11a430e48f7e006d8b4ae1c181413f0d60aa9da85f4599"
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build

# Fix -flat_namespace being used on Big Sur and later.
patch do
Expand All @@ -36,7 +36,7 @@ class Libestr < Formula
end

def install
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
system "./configure", *std_configure_args
system "make"
system "make", "install"
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libetonyek.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Libetonyek < Formula
depends_on "boost" => :build
depends_on "glm" => :build
depends_on "mdds" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "librevenge"

uses_from_macos "libxml2"
Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libetpan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Libetpan < Formula
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "openssl@3"
end

Expand Down
6 changes: 2 additions & 4 deletions Formula/lib/libevent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ class Libevent < Formula
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "openssl@3"

def install
system "./autogen.sh"
system "./configure", "--disable-dependency-tracking",
"--disable-debug-mode",
"--prefix=#{prefix}"
system "./configure", "--disable-debug-mode", *std_configure_args
system "make"
system "make", "install"
end
Expand Down
8 changes: 3 additions & 5 deletions Formula/lib/libewf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Libewf < Formula
depends_on "libtool" => :build
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "openssl@3"

uses_from_macos "bzip2"
Expand All @@ -44,14 +44,12 @@ def install
system "./autogen.sh"
end

args = %W[
--disable-dependency-tracking
args = %w[
--disable-silent-rules
--prefix=#{prefix}
--with-libfuse=no
]

system "./configure", *args
system "./configure", *args, *std_configure_args
system "make", "install"
end

Expand Down
4 changes: 2 additions & 2 deletions Formula/lib/libexosip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Libexosip < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "07fe4531bd26a4c6fabb8833e55dc9b955c3f995c5c024177b9a9e3800785782"
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "c-ares"
depends_on "libosip"
depends_on "openssl@3"
Expand All @@ -38,7 +38,7 @@ def install
ENV.append "LDFLAGS", "-framework CoreFoundation -framework CoreServices " \
"-framework Security"
end
system "./configure", *std_configure_args, "--disable-silent-rules"
system "./configure", "--disable-silent-rules", *std_configure_args
system "make", "install"
end

Expand Down
6 changes: 2 additions & 4 deletions Formula/lib/libextractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Libextractor < Formula
sha256 x86_64_linux: "f3cbd363b695aecf683d92a8b56aa5cb9a8d7e3d81b6190892c8393de7f4d648"
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "libtool"

uses_from_macos "zlib"
Expand All @@ -27,9 +27,7 @@ class Libextractor < Formula
def install
ENV.deparallelize

system "./configure", "--disable-silent-rules",
"--disable-dependency-tracking",
"--prefix=#{prefix}"
system "./configure", "--disable-silent-rules", *std_configure_args
system "make", "install"
end

Expand Down
12 changes: 5 additions & 7 deletions Formula/lib/libfido2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Libfido2 < Formula

depends_on "cmake" => :build
depends_on "mandoc" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "libcbor"
depends_on "openssl@3"

Expand All @@ -29,11 +29,9 @@ class Libfido2 < Formula
end

def install
args = std_cmake_args
args = OS.linux? ? ["-DUDEV_RULES_DIR=#{lib}/udev/rules.d"] : []

args << "-DUDEV_RULES_DIR=#{lib}/udev/rules.d" if OS.linux?

system "cmake", "-S", ".", "-B", ".", *args
system "cmake", "-S", ".", "-B", ".", *args, *std_cmake_args
system "cmake", "--build", "."
system "cmake", "--build", ".", "--target", "man_symlink_html"
system "cmake", "--build", ".", "--target", "man_symlink"
Expand Down Expand Up @@ -61,8 +59,8 @@ def install
}
EOF

pkg_config_flags = shell_output("pkg-config --cflags --libs libfido2").chomp.split
system ENV.cc, "test.c", "-I#{include}", "-o", "test", *pkg_config_flags
flags = shell_output("pkgconf --cflags --libs libfido2").chomp.split
system ENV.cc, "test.c", "-I#{include}", "-o", "test", *flags
system "./test"
end
end
2 changes: 1 addition & 1 deletion Formula/lib/libfishsound.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Libfishsound < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "5db56944c47f7f4084a4645ef252841be006ad54ee48fb55530eda206e6732c3"
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "libvorbis"

# Fix -flat_namespace being used on Big Sur and later.
Expand Down
6 changes: 3 additions & 3 deletions Formula/lib/libfixbuf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Libfixbuf < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "b2c6294855ef75ae5b347c818c9caf938640f7dc128a52fca9db6ed7b079c71b"
end

depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]

depends_on "glib"
depends_on "openssl@3"
Expand Down Expand Up @@ -57,8 +57,8 @@ def install
}
C

pkg_config_flags = shell_output("pkg-config --cflags --libs libfixbuf").chomp.split
system ENV.cc, "test.c", "-o", "test", *pkg_config_flags
flags = shell_output("pkgconf --cflags --libs libfixbuf").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end
8 changes: 3 additions & 5 deletions Formula/lib/libfixposix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ class Libfixposix < Formula
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build

def install
system "autoreconf", "-fvi"
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "autoreconf", "--force", "--install", "--verbose"
system "./configure", "--disable-silent-rules", *std_configure_args
system "make", "install"
end

Expand Down
6 changes: 2 additions & 4 deletions Formula/lib/libfontenc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@ class Libfontenc < Formula
end

depends_on "font-util" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "util-macros" => :build
depends_on "xorgproto" => :build

uses_from_macos "zlib"

def install
args = %W[
--prefix=#{prefix}
--sysconfdir=#{etc}
--localstatedir=#{var}
--disable-dependency-tracking
--disable-silent-rules
]

system "./configure", *args
system "./configure", *args, *std_configure_args
system "make"
system "make", "install"
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libfreefare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Libfreefare < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "d3837eb7894980557e16a097e05bc2fa8d42429177f30359166820cca640cc52"
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "libnfc"
depends_on "openssl@3"

Expand Down
6 changes: 2 additions & 4 deletions Formula/lib/libfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,18 @@ class Libfs < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "c17d8ae2548594b5aae02734f0c2804858754e00f2e1b2dcc38d5bc86086aa5e"
end

depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "xtrans" => :build
depends_on "xorgproto"

def install
args = %W[
--prefix=#{prefix}
--sysconfdir=#{etc}
--localstatedir=#{var}
--disable-dependency-tracking
--disable-silent-rules
]

system "./configure", *args
system "./configure", *args, *std_configure_args
system "make"
system "make", "install"
end
Expand Down
Loading

0 comments on commit f3b424f

Please sign in to comment.