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