Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librsvg 2.59.2 #202992

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 10 additions & 55 deletions Formula/lib/librsvg.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Librsvg < Formula
desc "Library to render SVG files using Cairo"
homepage "https://wiki.gnome.org/Projects/LibRsvg"
url "https://download.gnome.org/sources/librsvg/2.58/librsvg-2.58.4.tar.xz"
sha256 "296e3760d2347d0767c3e291dec962ab36baecd25c4898c6e8150a731f967c7b"
url "https://download.gnome.org/sources/librsvg/2.59/librsvg-2.59.2.tar.xz"
sha256 "ecd293fb0cc338c170171bbc7bcfbea6725d041c95f31385dc935409933e4597"
license "LGPL-2.1-or-later"

# librsvg doesn't use GNOME's "even-numbered minor is stable" version scheme.
Expand All @@ -24,8 +24,11 @@ class Librsvg < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "2c71dffd85fd7b3553766305adf685a59fc00b87d3120f0e96b199f079ac0fda"
end

depends_on "cargo-c" => :build
depends_on "gobject-introspection" => :build
depends_on "pkgconf" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkgconf" => [:build, :test]
depends_on "rust" => :build
depends_on "cairo"
depends_on "gdk-pixbuf"
Expand All @@ -43,24 +46,9 @@ class Librsvg < Formula
end

def install
args = %w[
--disable-Bsymbolic
--enable-tools=yes
--enable-pixbuf-loader=yes
--enable-introspection=yes
]

system "./configure", *args, *std_configure_args

# disable updating gdk-pixbuf cache, we will do this manually in post_install
# https://github.com/Homebrew/homebrew/issues/40833
inreplace "gdk-pixbuf-loader/Makefile",
"$(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ;",
""

system "make", "install",
"gdk_pixbuf_binarydir=#{lib}/gdk-pixbuf-2.0/2.10.0/loaders",
"gdk_pixbuf_moduledir=#{lib}/gdk-pixbuf-2.0/2.10.0/loaders"
system "meson", "setup", "build", "-Dpixbuf-loader=disabled", *std_meson_args
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Dpixbuf-loader=disabled looks suspicious given that we used to pass --enable-pixbuf-loader=yes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, this change looks responsible for this failure: https://github.com/Homebrew/homebrew-core/actions/runs/12585492280/job/35078161710?pr=202992#step:3:234

  (<unknown>:24532): Gtk-WARNING **: 16:51:08.887: Found an icon but could not load it. Most likely gdk-pixbuf does not provide SVG support.
  [2025-01-02 16:51:08.888] [gtk] [critical] 
  unhandled exception (type Glib::Error) in signal handler:
  domain: gtk-icon-theme-error-quark
  code  : 0
  what  : Icon 'cherrytree' not present in theme Adwaita

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds about right, let me find another way to fix the build issue 👍

system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end

def post_install
Expand All @@ -79,40 +67,7 @@ def post_install
return 0;
}
C
cairo = Formula["cairo"]
fontconfig = Formula["fontconfig"]
freetype = Formula["freetype"]
gdk_pixbuf = Formula["gdk-pixbuf"]
gettext = Formula["gettext"]
glib = Formula["glib"]
libpng = Formula["libpng"]
pixman = Formula["pixman"]
flags = %W[
-I#{cairo.opt_include}/cairo
-I#{fontconfig.opt_include}
-I#{freetype.opt_include}/freetype2
-I#{gdk_pixbuf.opt_include}/gdk-pixbuf-2.0
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{include}/librsvg-2.0
-I#{libpng.opt_include}/libpng16
-I#{pixman.opt_include}/pixman-1
-D_REENTRANT
-L#{cairo.opt_lib}
-L#{gdk_pixbuf.opt_lib}
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{lib}
-lcairo
-lgdk_pixbuf-2.0
-lgio-2.0
-lglib-2.0
-lgobject-2.0
-lm
-lrsvg-2
]
flags << "-lintl" if OS.mac?
flags = shell_output("pkgconf --cflags --libs librsvg-2.0").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
Expand Down
1 change: 1 addition & 0 deletions audit_exceptions/gnome_devel_allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"libadwaita": "1.5",
"libart": "2.3",
"libepoxy": "1.5",
"librsvg": "2.59",
"libshumate": "1.3",
"libxml2": "2.13",
"libxslt": "1.1",
Expand Down
Loading