Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2, 2/2] package/librsvg: fix loaders.cache with with per-package directories
Date: Sun, 20 Feb 2022 23:11:20 +0100	[thread overview]
Message-ID: <20220220221120.GA522310@scaer> (raw)
In-Reply-To: <20220220121637.200393-2-fontaine.fabrice@gmail.com>

Fabrice, All,

On 2022-02-20 13:16 +0100, Fabrice Fontaine spake thusly:
> host-librsvg invokes the gdk-pixbuf-queryloaders to update loaders.cache
> (which is originally built by host-gdk-pixbuf). loaders.cache contains
> the list of all the gdk-pixbuf modules; that includes paths to
> dlopen()ed shared libs. host-librsvg must update this file to add the
> path to its SVG shared library.
> 
> By default, gdk-pixbuf-queryloaders uses a hardcoded path to find the
> installed shared libs and this path will point to the location of the
> host-gdk-pixbuf per-package directory. Obviously, this is wrong, the SVG
> library installed by host-librsvg is installed in its own per-package
> directory.
> 
> So set GDK_PIXBUF_MODULEDIR to gdk_pixbuf_moduledir before calling
> gdk-pixbuf-query-loaders to build a correct loaders.cache.
> gdk_pixbuf_moduledir is already retrieved from host-pkgconfig in
> configure.ac and so will point to the correct location (thanks to
> PPD_FIXUP_PATHS).
> 
> After this update, the loaders.cache will be correctly updated in
> host-librsvg per-package directory and so the loaders.cache installed in
> adwaita-icon-theme per-package directory will also be correct (thanks to
> PPD_FIXUP_PATHS).
> 
> This will fix the following PPD build failure of adwaita-icon-theme:
> 
> Can't load file: Unrecognized image file format
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/0e00059b09b4445eaaec1030997883187c6a80d6
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Thank you very much for expanding on your previous commit log. It indeed
helps a lot to explain what is happening.

Still, I felt I needed to understand a bit more about the issue: why did
we have to fix it at build time for a file that is never isntalled?

Also, since we now configure gdk-pixbuf in a relocatable way, why was
the issue still happening?

So I investigated a bit, and substancially rewrote the commit log with
my findings.

Still, I must say that your second commit log was already very good, and
it really helped me understand the overall issue. Thanks for that! :-)

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
> Changes v1 -> v2 (after review of Yann E. Morin):
>  - Enhance commit message
>  - Add patch upstream status
> 
>  ...r-Makefile.am-set-GDK_PIXBUF_MODULED.patch | 41 +++++++++++++++++++
>  package/librsvg/librsvg.mk                    |  2 +
>  2 files changed, 43 insertions(+)
>  create mode 100644 package/librsvg/0001-gdk-pixbuf-loader-Makefile.am-set-GDK_PIXBUF_MODULED.patch
> 
> diff --git a/package/librsvg/0001-gdk-pixbuf-loader-Makefile.am-set-GDK_PIXBUF_MODULED.patch b/package/librsvg/0001-gdk-pixbuf-loader-Makefile.am-set-GDK_PIXBUF_MODULED.patch
> new file mode 100644
> index 0000000000..761ff92605
> --- /dev/null
> +++ b/package/librsvg/0001-gdk-pixbuf-loader-Makefile.am-set-GDK_PIXBUF_MODULED.patch
> @@ -0,0 +1,41 @@
> +From 2c472bf55289ccbd7f305aa3e98d6fd70be4e3ab Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Sat, 19 Feb 2022 12:02:10 +0100
> +Subject: [PATCH] gdk-pixbuf-loader/Makefile.am: set GDK_PIXBUF_MODULEDIR
> +
> +Set GDK_PIXBUF_MODULEDIR to gdk_pixbuf_moduledir before calling
> +gdk-pixbuf-query-loaders to build a correct gdk_pixbuf_cache_file and
> +gdk-pixbuf.loaders on 'exotic' systems
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Upstream status:
> +https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/668]
> +---
> + gdk-pixbuf-loader/Makefile.am | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/gdk-pixbuf-loader/Makefile.am b/gdk-pixbuf-loader/Makefile.am
> +index c3493736..de1f9641 100644
> +--- a/gdk-pixbuf-loader/Makefile.am
> ++++ b/gdk-pixbuf-loader/Makefile.am
> +@@ -49,7 +49,7 @@ rsvg_loader_LDADD = \
> + EXTRA_rsvg_loader_DEPENDENCIES = libpixbufloader-svg.la gdk-pixbuf-loaders
> + 
> + gdk-pixbuf-loaders: Makefile
> +-	$(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null
> ++	$(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && GDK_PIXBUF_MODULEDIR=$(gdk_pixbuf_moduledir) $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null
> + 
> + if CROSS_COMPILING
> + RUN_QUERY_LOADER_TEST=false
> +@@ -68,7 +68,7 @@ endif
> + install-data-hook:
> + 	@if $(RUN_QUERY_LOADER_TEST) ; then \
> + 		$(mkinstalldirs) $(DESTDIR)$(gdk_pixbuf_binarydir) ; \
> +-		$(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \
> ++		GDK_PIXBUF_MODULEDIR=$(gdk_pixbuf_moduledir) $(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \
> + 	else \
> + 	  echo "***" ; \
> + 	  echo "*** Warning: loaders.cache not built" ; \
> +-- 
> +2.34.1
> +
> diff --git a/package/librsvg/librsvg.mk b/package/librsvg/librsvg.mk
> index e4b1942b79..07a14b4366 100644
> --- a/package/librsvg/librsvg.mk
> +++ b/package/librsvg/librsvg.mk
> @@ -20,6 +20,8 @@ HOST_LIBRSVG_DEPENDENCIES = host-cairo host-gdk-pixbuf host-libglib2 host-libxml
>  LIBRSVG_LICENSE = LGPL-2.1+
>  LIBRSVG_LICENSE_FILES = COPYING.LIB
>  LIBRSVG_CPE_ID_VENDOR = gnome
> +# We're patching gdk-pixbuf-loader/Makefile.am
> +LIBRSVG_AUTORECONF = YES
>  
>  ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
>  LIBRSVG_CONF_OPTS += --enable-introspection
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-02-20 22:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-20 12:16 [Buildroot] [PATCH v2, 1/2] package/gdk-pixbuf: enable relocatable option Fabrice Fontaine
2022-02-20 12:16 ` [Buildroot] [PATCH v2, 2/2] package/librsvg: fix loaders.cache with with per-package directories Fabrice Fontaine
2022-02-20 22:11   ` Yann E. MORIN [this message]
2022-02-20 20:24 ` [Buildroot] [PATCH v2, 1/2] package/gdk-pixbuf: enable relocatable option Yann E. MORIN
2022-03-10 21:50 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220220221120.GA522310@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox