diff options
| author | Zoltán Böszörményi <zboszor@gmail.com> | 2022-02-24 14:11:21 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-25 12:41:23 +0000 |
| commit | f8c99d2d66c1fb89b13bc73660a4ca85889a4f8a (patch) | |
| tree | 0141937cad6046808492a19461ee4c66bba3e91a /meta/classes/gtk-icon-cache.bbclass | |
| parent | 889788bffcd19371863a0f032c5f1fd95c5105bd (diff) | |
| download | poky-f8c99d2d66c1fb89b13bc73660a4ca85889a4f8a.tar.gz | |
gtk-icon-cache: Allow using gtk4
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.
Also use a more readable syntax for conditional values in DEPENDS.
(From OE-Core rev: 2a927a581e599af8e544e17517cdda1cfaf63e16)
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/gtk-icon-cache.bbclass')
| -rw-r--r-- | meta/classes/gtk-icon-cache.bbclass | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass index 0248ba285e..6808339b90 100644 --- a/meta/classes/gtk-icon-cache.bbclass +++ b/meta/classes/gtk-icon-cache.bbclass | |||
| @@ -1,17 +1,22 @@ | |||
| 1 | FILES:${PN} += "${datadir}/icons/hicolor" | 1 | FILES:${PN} += "${datadir}/icons/hicolor" |
| 2 | 2 | ||
| 3 | #gtk+3 reqiure GTK3DISTROFEATURES, DEPENDS on it make all the | 3 | GTKIC_VERSION ??= '3' |
| 4 | |||
| 5 | GTKPN = "${@ 'gtk4' if d.getVar('GTKIC_VERSION') == '4' else 'gtk+3' }" | ||
| 6 | GTKIC_CMD = "${@ 'gtk-update-icon-cache-3.0.0' if d.getVar('GTKIC_VERSION') == '4' else 'gtk4-update-icon-cache' }" | ||
| 7 | |||
| 8 | #gtk+3/gtk4 require GTK3DISTROFEATURES, DEPENDS on it make all the | ||
| 4 | #recipes inherit this class require GTK3DISTROFEATURES | 9 | #recipes inherit this class require GTK3DISTROFEATURES |
| 5 | inherit features_check | 10 | inherit features_check |
| 6 | ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" | 11 | ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" |
| 7 | 12 | ||
| 8 | DEPENDS +=" ${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} \ | 13 | DEPENDS +=" ${@ '' if d.getVar('BPN') == 'hicolor-icon-theme' else 'hicolor-icon-theme' } \ |
| 9 | ${@['gdk-pixbuf', '']['${BPN}' == 'gdk-pixbuf']} \ | 14 | ${@ '' if d.getVar('BPN') == 'gdk-pixbuf' else 'gdk-pixbuf' } \ |
| 10 | ${@['gtk+3', '']['${BPN}' == 'gtk+3']} \ | 15 | ${@ '' if d.getVar('BPN') == d.getVar('GTKPN') else d.getVar('GTKPN') } \ |
| 11 | gtk+3-native \ | 16 | ${GTKPN}-native \ |
| 12 | " | 17 | " |
| 13 | 18 | ||
| 14 | PACKAGE_WRITE_DEPS += "gtk+3-native gdk-pixbuf-native" | 19 | PACKAGE_WRITE_DEPS += "${GTKPN}-native gdk-pixbuf-native" |
| 15 | 20 | ||
| 16 | gtk_icon_cache_postinst() { | 21 | gtk_icon_cache_postinst() { |
| 17 | if [ "x$D" != "x" ]; then | 22 | if [ "x$D" != "x" ]; then |
| @@ -25,7 +30,7 @@ else | |||
| 25 | 30 | ||
| 26 | for icondir in /usr/share/icons/* ; do | 31 | for icondir in /usr/share/icons/* ; do |
| 27 | if [ -d $icondir ] ; then | 32 | if [ -d $icondir ] ; then |
| 28 | gtk-update-icon-cache -fqt $icondir | 33 | ${GTKIC_CMD} -fqt $icondir |
| 29 | fi | 34 | fi |
| 30 | done | 35 | done |
| 31 | fi | 36 | fi |
| @@ -39,7 +44,7 @@ if [ "x$D" != "x" ]; then | |||
| 39 | else | 44 | else |
| 40 | for icondir in /usr/share/icons/* ; do | 45 | for icondir in /usr/share/icons/* ; do |
| 41 | if [ -d $icondir ] ; then | 46 | if [ -d $icondir ] ; then |
| 42 | gtk-update-icon-cache -qt $icondir | 47 | ${GTKIC_CMD} -qt $icondir |
| 43 | fi | 48 | fi |
| 44 | done | 49 | done |
| 45 | fi | 50 | fi |
| @@ -58,13 +63,13 @@ python populate_packages:append () { | |||
| 58 | rdepends = ' ' + d.getVar('MLPREFIX', False) + "hicolor-icon-theme" | 63 | rdepends = ' ' + d.getVar('MLPREFIX', False) + "hicolor-icon-theme" |
| 59 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) | 64 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) |
| 60 | 65 | ||
| 61 | #gtk_icon_cache_postinst depend on gdk-pixbuf and gtk+3 | 66 | #gtk_icon_cache_postinst depend on gdk-pixbuf and gtk+3/gtk4 |
| 62 | bb.note("adding gdk-pixbuf dependency to %s" % pkg) | 67 | bb.note("adding gdk-pixbuf dependency to %s" % pkg) |
| 63 | rdepends = ' ' + d.getVar('MLPREFIX', False) + "gdk-pixbuf" | 68 | rdepends = ' ' + d.getVar('MLPREFIX', False) + "gdk-pixbuf" |
| 64 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) | 69 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) |
| 65 | 70 | ||
| 66 | bb.note("adding gtk+3 dependency to %s" % pkg) | 71 | bb.note("adding %s dependency to %s" % (d.getVar('GTKPN'), pkg)) |
| 67 | rdepends = ' ' + d.getVar('MLPREFIX', False) + "gtk+3" | 72 | rdepends = ' ' + d.getVar('MLPREFIX', False) + d.getVar('GTKPN') |
| 68 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) | 73 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) |
| 69 | 74 | ||
| 70 | bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg) | 75 | bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg) |
