Skip to content

Commit

Permalink
Merge pull request #199018 from Homebrew/pkgconf-migrations-lib-3
Browse files Browse the repository at this point in the history
lib*: migrate to `pkgconf` (part 3)
  • Loading branch information
cho-m authored Nov 26, 2024
2 parents 6e5f42d + f830f45 commit c118fbf
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 62 deletions.
4 changes: 2 additions & 2 deletions Formula/lib/libgdata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Libgdata < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "vala" => :build

depends_on "glib"
Expand Down Expand Up @@ -76,7 +76,7 @@ def install

ENV.prepend_path "PKG_CONFIG_PATH", Formula["icu4c"].opt_lib/"pkgconfig" if OS.mac?
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libsoup@2"].opt_lib/"pkgconfig"
flags = shell_output("pkg-config --cflags --libs libgdata").chomp.split
flags = shell_output("pkgconf --cflags --libs libgdata").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
Expand Down
8 changes: 4 additions & 4 deletions Formula/lib/libgedit-amtk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LibgeditAmtk < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]

depends_on "glib"
depends_on "gtk+3"
Expand All @@ -35,7 +35,7 @@ class LibgeditAmtk < Formula
end

def install
system "meson", "setup", "build", *std_meson_args, "-Dgtk_doc=false"
system "meson", "setup", "build", "-Dgtk_doc=false", *std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end
Expand All @@ -50,8 +50,8 @@ def install
}
C

pkg_config_flags = shell_output("pkg-config --cflags --libs libgedit-amtk-5").chomp.split
system ENV.cc, "test.c", "-o", "test", *pkg_config_flags
flags = shell_output("pkgconf --cflags --libs libgedit-amtk-5").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end
4 changes: 2 additions & 2 deletions Formula/lib/libgedit-gfls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LibgeditGfls < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "glib"
depends_on "gtk+3"

Expand All @@ -47,7 +47,7 @@ def install
}
C

flags = shell_output("pkg-config --cflags --libs libgedit-gfls-1").strip.split
flags = shell_output("pkgconf --cflags --libs libgedit-gfls-1").strip.split
system ENV.cc, "test.c", "-o", "test", *flags
assert_equal "Unsaved Document 1", shell_output("./test")
end
Expand Down
4 changes: 2 additions & 2 deletions Formula/lib/libgedit-gtksourceview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LibgeditGtksourceview < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "cairo"
depends_on "gdk-pixbuf"
depends_on "glib"
Expand Down Expand Up @@ -47,7 +47,7 @@ def install
}
C

flags = shell_output("pkg-config --cflags --libs libgedit-gtksourceview-300").strip.split
flags = shell_output("pkgconf --cflags --libs libgedit-gtksourceview-300").strip.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
Expand Down
4 changes: 2 additions & 2 deletions Formula/lib/libgedit-tepl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LibgeditTepl < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "cairo"
depends_on "glib"
depends_on "gtk+3"
Expand Down Expand Up @@ -59,7 +59,7 @@ def install
}
C

flags = shell_output("pkg-config --cflags --libs libgedit-tepl-6").chomp.split
flags = shell_output("pkgconf --cflags --libs libgedit-tepl-6").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
Expand Down
4 changes: 2 additions & 2 deletions Formula/lib/libgee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Libgee < Formula
end

depends_on "gobject-introspection" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "vala" => :build

depends_on "glib"
Expand All @@ -40,7 +40,7 @@ def install
"@HAVE_INTROSPECTION_TRUE@typelibdir = $(libdir)/girepository-1.0"
end

system "./configure", *std_configure_args.reject { |s| s["--disable-debug"] }
system "./configure", *std_configure_args
system "make", "install"
end

Expand Down
6 changes: 2 additions & 4 deletions Formula/lib/libgig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ class Libgig < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "55b3244b6baa9d30aa0d625a9c27455437b8bb85a1feb61571dec1d4dd765e81"
end

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

on_linux do
depends_on "e2fsprogs"
end

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

Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libgit2-glib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Libgit2Glib < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "vala" => :build
depends_on "glib"
depends_on "libgit2"
Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libgit2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Libgit2 < Formula
end

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

Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Libgit2AT17 < Formula
keg_only :versioned_formula

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

Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libgnt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Libgnt < Formula
depends_on "gtk-doc" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build

depends_on "glib"
depends_on "ncurses"
Expand Down
6 changes: 2 additions & 4 deletions Formula/lib/libgosu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Libgosu < Formula
end

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

on_linux do
Expand All @@ -30,10 +30,8 @@ class Libgosu < Formula
depends_on "openal-soft"
end

fails_with gcc: "5"

def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, "-DCMAKE_INSTALL_RPATH=#{rpath}"
system "cmake", "-S", ".", "-B", "build", "-DCMAKE_INSTALL_RPATH=#{rpath}", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libgphoto2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Libgphoto2 < Formula
depends_on "gettext" => :build
end

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

depends_on "gd"
depends_on "jpeg-turbo"
Expand Down
10 changes: 5 additions & 5 deletions Formula/lib/libgsf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Libgsf < Formula
depends_on "libtool" => :build
end

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

uses_from_macos "bzip2"
Expand All @@ -36,7 +36,7 @@ class Libgsf < Formula

def install
configure = build.head? ? "./autogen.sh" : "./configure"
system configure, *std_configure_args, "--disable-silent-rules"
system configure, "--disable-silent-rules", *std_configure_args
system "make", "install"
end

Expand All @@ -51,10 +51,10 @@ def install
return 0;
}
C
system ENV.cc, "-I#{include}/libgsf-1",
system ENV.cc, "test.c", "-o", "test",
"-I#{include}/libgsf-1",
"-I#{Formula["glib"].opt_include}/glib-2.0",
"-I#{Formula["glib"].opt_lib}/glib-2.0/include",
testpath/"test.c", "-o", testpath/"test"
"-I#{Formula["glib"].opt_lib}/glib-2.0/include"
system "./test"
end
end
2 changes: 1 addition & 1 deletion Formula/lib/libgtop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Libgtop < Formula

depends_on "gobject-introspection" => :build
depends_on "intltool" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "gettext"
depends_on "glib"
depends_on "libxau"
Expand Down
6 changes: 3 additions & 3 deletions Formula/lib/libgusb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Libgusb < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "python-setuptools" => :build
depends_on "vala" => :build

Expand Down Expand Up @@ -64,8 +64,8 @@ def install
}
C

pkg_config_flags = shell_output("pkg-config --cflags --libs gusb").chomp.split
system ENV.cc, "test.c", "-o", "test", *pkg_config_flags
flags = shell_output("pkgconf --cflags --libs gusb").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end
6 changes: 3 additions & 3 deletions Formula/lib/libgweather.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Libgweather < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "pygobject3" => :build
depends_on "[email protected]" => :build

Expand Down Expand Up @@ -71,8 +71,8 @@ def post_install
}
C
ENV.prepend_path "PKG_CONFIG_PATH", Formula["icu4c"].opt_lib/"pkgconfig" if OS.mac?
pkg_config_flags = shell_output("pkg-config --cflags --libs gweather4").chomp.split
system ENV.cc, "-DGWEATHER_I_KNOW_THIS_IS_UNSTABLE=1", "test.c", "-o", "test", *pkg_config_flags
flags = shell_output("pkgconf --cflags --libs gweather4").chomp.split
system ENV.cc, "-DGWEATHER_I_KNOW_THIS_IS_UNSTABLE=1", "test.c", "-o", "test", *flags
system "./test"
end
end
2 changes: 1 addition & 1 deletion Formula/lib/libgxps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Libgxps < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build

depends_on "cairo"
depends_on "freetype"
Expand Down
6 changes: 3 additions & 3 deletions Formula/lib/libhandy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Libhandy < Formula
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "vala" => :build

depends_on "at-spi2-core"
Expand Down Expand Up @@ -54,8 +54,8 @@ def install
}
C

pkg_config_flags = shell_output("pkg-config --cflags --libs libhandy-1").strip.split
system ENV.cc, "test.c", "-o", "test", *pkg_config_flags
flags = shell_output("pkgconf --cflags --libs libhandy-1").strip.split
system ENV.cc, "test.c", "-o", "test", *flags
# Don't have X/Wayland in Docker
system "./test" if OS.mac?
end
Expand Down
8 changes: 4 additions & 4 deletions Formula/lib/libheif.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Libheif < Formula
end

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

depends_on "aom"
depends_on "jpeg-turbo"
Expand Down Expand Up @@ -59,14 +59,14 @@ def post_install
exout = testpath/"exampleheic.jpg"

assert_match output, shell_output("#{bin}/heif-convert #{example} #{exout}")
assert_predicate testpath/"exampleheic-1.jpg", :exist?
assert_predicate testpath/"exampleheic-2.jpg", :exist?
assert_path_exists testpath/"exampleheic-1.jpg"
assert_path_exists testpath/"exampleheic-2.jpg"

output = "File contains 1 image"
example = pkgshare/"example.avif"
exout = testpath/"exampleavif.jpg"

assert_match output, shell_output("#{bin}/heif-convert #{example} #{exout}")
assert_predicate testpath/"exampleavif.jpg", :exist?
assert_path_exists testpath/"exampleavif.jpg"
end
end
12 changes: 3 additions & 9 deletions Formula/lib/libhttpserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,15 @@ class Libhttpserver < Formula
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "libmicrohttpd"

uses_from_macos "curl" => :test

def install
args = [
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
]

system "./bootstrap"
mkdir "build" do
system "../configure", *args
system "../configure", "--disable-silent-rules", *std_configure_args
system "make", "install"
end
pkgshare.install "examples"
Expand All @@ -52,7 +46,7 @@ def install
system ENV.cxx, "minimal_hello_world.cpp",
"-std=c++17", "-o", "minimal_hello_world", "-L#{lib}", "-lhttpserver", "-lcurl"

fork { exec "./minimal_hello_world" }
spawn "./minimal_hello_world"
sleep 3 # grace time for server start

assert_match "Hello, World!", shell_output("curl http://127.0.0.1:#{port}/hello")
Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libhubbub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Libhubbub < Formula
end

depends_on "netsurf-buildsystem" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "libparserutils"

uses_from_macos "gperf" => :build
Expand Down
2 changes: 1 addition & 1 deletion Formula/lib/libical.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Libical < Formula
end

depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "pkgconf" => :build
depends_on "glib"
depends_on "icu4c@76"

Expand Down
Loading

0 comments on commit c118fbf

Please sign in to comment.