* [PATCH] gtk-icon-cache: Allow using gtk4
@ 2022-02-24 7:23 Zoltan Boszormenyi
2022-02-24 12:48 ` [OE-core] " Ross Burton
0 siblings, 1 reply; 3+ messages in thread
From: Zoltan Boszormenyi @ 2022-02-24 7:23 UTC (permalink / raw)
To: openembedded-core; +Cc: Zoltán Böszörményi
From: Zoltán Böszörményi <zboszor@gmail.com>
meta-openembedded has gtk4 which has its own version of
gtk-update-icon-cache. Allow programs that want to use gtk4
use the proper version of the gtk-update-icon-cache utility
and the proper build and runtime dependencies.
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
meta/classes/gtk-icon-cache.bbclass | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
index 0248ba285e..ec97467e15 100644
--- a/meta/classes/gtk-icon-cache.bbclass
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -1,17 +1,22 @@
FILES:${PN} += "${datadir}/icons/hicolor"
-#gtk+3 reqiure GTK3DISTROFEATURES, DEPENDS on it make all the
+GTKIC_VERSION ??= '3'
+
+GTKPN = "${@ 'gtk4' if d.getVar('GTKIC_VERSION') == '4' else 'gtk+3' }"
+GTKIC_CMD = "${@ 'gtk-update-icon-cache-3.0.0' if d.getVar('GTKIC_VERSION') == '4' else 'gtk4-update-icon-cache' }"
+
+#gtk+3/gtk4 require GTK3DISTROFEATURES, DEPENDS on it make all the
#recipes inherit this class require GTK3DISTROFEATURES
inherit features_check
ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
DEPENDS +=" ${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} \
${@['gdk-pixbuf', '']['${BPN}' == 'gdk-pixbuf']} \
- ${@['gtk+3', '']['${BPN}' == 'gtk+3']} \
- gtk+3-native \
+ ${@['${GTKPN}', '']['${BPN}' == '${GTKPN}']} \
+ ${GTKPN}-native \
"
-PACKAGE_WRITE_DEPS += "gtk+3-native gdk-pixbuf-native"
+PACKAGE_WRITE_DEPS += "${GTKPN}-native gdk-pixbuf-native"
gtk_icon_cache_postinst() {
if [ "x$D" != "x" ]; then
@@ -25,7 +30,7 @@ else
for icondir in /usr/share/icons/* ; do
if [ -d $icondir ] ; then
- gtk-update-icon-cache -fqt $icondir
+ ${GTKIC_CMD} -fqt $icondir
fi
done
fi
@@ -39,7 +44,7 @@ if [ "x$D" != "x" ]; then
else
for icondir in /usr/share/icons/* ; do
if [ -d $icondir ] ; then
- gtk-update-icon-cache -qt $icondir
+ ${GTKIC_CMD} -qt $icondir
fi
done
fi
@@ -58,13 +63,13 @@ python populate_packages:append () {
rdepends = ' ' + d.getVar('MLPREFIX', False) + "hicolor-icon-theme"
d.appendVar('RDEPENDS:%s' % pkg, rdepends)
- #gtk_icon_cache_postinst depend on gdk-pixbuf and gtk+3
+ #gtk_icon_cache_postinst depend on gdk-pixbuf and gtk+3/gtk4
bb.note("adding gdk-pixbuf dependency to %s" % pkg)
rdepends = ' ' + d.getVar('MLPREFIX', False) + "gdk-pixbuf"
d.appendVar('RDEPENDS:%s' % pkg, rdepends)
- bb.note("adding gtk+3 dependency to %s" % pkg)
- rdepends = ' ' + d.getVar('MLPREFIX', False) + "gtk+3"
+ bb.note("adding %s dependency to %s" % (d.getVar('GTKPN'), pkg))
+ rdepends = ' ' + d.getVar('MLPREFIX', False) + d.getVar('GTKPN')
d.appendVar('RDEPENDS:%s' % pkg, rdepends)
bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH] gtk-icon-cache: Allow using gtk4
2022-02-24 7:23 [PATCH] gtk-icon-cache: Allow using gtk4 Zoltan Boszormenyi
@ 2022-02-24 12:48 ` Ross Burton
2022-02-24 12:59 ` Zoltan Boszormenyi
0 siblings, 1 reply; 3+ messages in thread
From: Ross Burton @ 2022-02-24 12:48 UTC (permalink / raw)
To: zboszor; +Cc: openembedded-core, Zoltán Böszörményi
On Thu, 24 Feb 2022 at 07:23, Zoltan Boszormenyi via
lists.openembedded.org <zboszor=pr.hu@lists.openembedded.org> wrote:
> + ${@['${GTKPN}', '']['${BPN}' == '${GTKPN}']} \
I know this was the syntax originally here, but please change this to
use the "a if b else c" syntax used elsewhere.
Ross
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH] gtk-icon-cache: Allow using gtk4
2022-02-24 12:48 ` [OE-core] " Ross Burton
@ 2022-02-24 12:59 ` Zoltan Boszormenyi
0 siblings, 0 replies; 3+ messages in thread
From: Zoltan Boszormenyi @ 2022-02-24 12:59 UTC (permalink / raw)
To: Ross Burton; +Cc: openembedded-core, Zoltán Böszörményi
2022. 02. 24. 13:48 keltezéssel, Ross Burton írta:
> On Thu, 24 Feb 2022 at 07:23, Zoltan Boszormenyi via
> lists.openembedded.org <zboszor=pr.hu@lists.openembedded.org> wrote:
>> + ${@['${GTKPN}', '']['${BPN}' == '${GTKPN}']} \
>
> I know this was the syntax originally here, but please change this to
> use the "a if b else c" syntax used elsewhere.
I will send a new version, thanks.
>
> Ross
>
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-24 12:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 7:23 [PATCH] gtk-icon-cache: Allow using gtk4 Zoltan Boszormenyi
2022-02-24 12:48 ` [OE-core] " Ross Burton
2022-02-24 12:59 ` Zoltan Boszormenyi
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.