Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 1 | FILES:${PN} += "${datadir}/icons/hicolor" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 2 | |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 3 | #gtk+3 reqiure GTK3DISTROFEATURES, DEPENDS on it make all the |
| 4 | #recipes inherit this class require GTK3DISTROFEATURES |
| 5 | inherit features_check |
| 6 | ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" |
| 7 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 8 | DEPENDS +=" ${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} \ |
| 9 | ${@['gdk-pixbuf', '']['${BPN}' == 'gdk-pixbuf']} \ |
| 10 | ${@['gtk+3', '']['${BPN}' == 'gtk+3']} \ |
| 11 | gtk+3-native \ |
| 12 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 14 | PACKAGE_WRITE_DEPS += "gtk+3-native gdk-pixbuf-native" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | gtk_icon_cache_postinst() { |
| 17 | if [ "x$D" != "x" ]; then |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 18 | $INTERCEPT_DIR/postinst_intercept update_gtk_icon_cache ${PKG} \ |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 19 | mlprefix=${MLPREFIX} \ |
| 20 | libdir_native=${libdir_native} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | else |
| 22 | |
| 23 | # Update the pixbuf loaders in case they haven't been registered yet |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 24 | ${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | |
| 26 | for icondir in /usr/share/icons/* ; do |
| 27 | if [ -d $icondir ] ; then |
| 28 | gtk-update-icon-cache -fqt $icondir |
| 29 | fi |
| 30 | done |
| 31 | fi |
| 32 | } |
| 33 | |
| 34 | gtk_icon_cache_postrm() { |
| 35 | if [ "x$D" != "x" ]; then |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 36 | $INTERCEPT_DIR/postinst_intercept update_gtk_icon_cache ${PKG} \ |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 37 | mlprefix=${MLPREFIX} \ |
| 38 | libdir=${libdir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | else |
| 40 | for icondir in /usr/share/icons/* ; do |
| 41 | if [ -d $icondir ] ; then |
| 42 | gtk-update-icon-cache -qt $icondir |
| 43 | fi |
| 44 | done |
| 45 | fi |
| 46 | } |
| 47 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 48 | python populate_packages:append () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 49 | packages = d.getVar('PACKAGES').split() |
| 50 | pkgdest = d.getVar('PKGDEST') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | |
| 52 | for pkg in packages: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 53 | icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir')) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | if not os.path.exists(icon_dir): |
| 55 | continue |
| 56 | |
| 57 | bb.note("adding hicolor-icon-theme dependency to %s" % pkg) |
| 58 | rdepends = ' ' + d.getVar('MLPREFIX', False) + "hicolor-icon-theme" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 59 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 60 | |
| 61 | #gtk_icon_cache_postinst depend on gdk-pixbuf and gtk+3 |
| 62 | bb.note("adding gdk-pixbuf dependency to %s" % pkg) |
| 63 | rdepends = ' ' + d.getVar('MLPREFIX', False) + "gdk-pixbuf" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 64 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 65 | |
| 66 | bb.note("adding gtk+3 dependency to %s" % pkg) |
| 67 | rdepends = ' ' + d.getVar('MLPREFIX', False) + "gtk+3" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 68 | d.appendVar('RDEPENDS:%s' % pkg, rdepends) |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 69 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 70 | bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg) |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | postinst = d.getVar('pkg_postinst:%s' % pkg) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | if not postinst: |
| 74 | postinst = '#!/bin/sh\n' |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 75 | postinst += d.getVar('gtk_icon_cache_postinst') |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | d.setVar('pkg_postinst:%s' % pkg, postinst) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 78 | postrm = d.getVar('pkg_postrm:%s' % pkg) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 79 | if not postrm: |
| 80 | postrm = '#!/bin/sh\n' |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 81 | postrm += d.getVar('gtk_icon_cache_postrm') |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 82 | d.setVar('pkg_postrm:%s' % pkg, postrm) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 83 | } |
| 84 | |