All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 5/5] package/librsvg: fix svg with gdk-pixbuf
@ 2024-09-05 16:24 Guillaume GC. Chaye
  2024-09-05 19:32 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume GC. Chaye @ 2024-09-05 16:24 UTC (permalink / raw)
  To: buildroot; +Cc: Guillaume GC. Chaye, Fabrice Fontaine

Signed-off-by: Guillaume GC. Chaye <guillaume.chaye@zeetim.com>
---
 package/librsvg/librsvg.mk | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/package/librsvg/librsvg.mk b/package/librsvg/librsvg.mk
index 81a6667817..0187218a98 100644
--- a/package/librsvg/librsvg.mk
+++ b/package/librsvg/librsvg.mk
@@ -12,7 +12,7 @@ LIBRSVG_INSTALL_STAGING = YES
 LIBRSVG_CONF_ENV = \
 	LIBS=$(TARGET_NLS_LIBS) \
 	RUST_TARGET=$(RUSTC_TARGET_NAME)
-LIBRSVG_CONF_OPTS = --disable-pixbuf-loader --disable-tools
+LIBRSVG_CONF_OPTS = --disable-tools
 HOST_LIBRSVG_CONF_OPTS = --enable-introspection=no
 LIBRSVG_DEPENDENCIES = cairo host-gdk-pixbuf gdk-pixbuf host-rustc libglib2 libxml2 pango \
 	$(TARGET_NLS_DEPENDENCIES)
@@ -30,5 +30,22 @@ else
 LIBRSVG_CONF_OPTS += --disable-introspection
 endif
 
+# gdk-pixbuf requires the loaders.cache file populated to work properly
+# Rather than doing so at runtime, since the fs can be read-only, do so
+# here after building and installing to target.
+# And since the cache file will contain relative host directory names we
+# need to prepend them with /usr/.
+ifeq ($(BR2_STATIC_LIBS),)
+define LIBRSVG_PIXBUF_UPDATE_CACHE
+	GDK_PIXBUF_MODULEDIR=$(HOST_DIR)/lib/gdk-pixbuf-2.0/2.10.0/loaders \
+		$(HOST_DIR)/bin/gdk-pixbuf-query-loaders \
+		> $(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
+	$(SED) 's,^"lib,"/usr/lib,g' \
+		$(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
+endef
+LIBRSVG_POST_INSTALL_TARGET_HOOKS += LIBRSVG_PIXBUF_UPDATE_CACHE
+endif
+
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-05 19:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-05 16:24 [Buildroot] [PATCH 5/5] package/librsvg: fix svg with gdk-pixbuf Guillaume GC. Chaye
2024-09-05 19:32 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.