diff options
-rw-r--r-- | meta/classes/gsettings.bbclass | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/meta/classes/gsettings.bbclass b/meta/classes/gsettings.bbclass index eae3dc7999..33afc96a9c 100644 --- a/meta/classes/gsettings.bbclass +++ b/meta/classes/gsettings.bbclass | |||
@@ -7,32 +7,36 @@ | |||
7 | 7 | ||
8 | # TODO use a trigger so that this runs once per package operation run | 8 | # TODO use a trigger so that this runs once per package operation run |
9 | 9 | ||
10 | 10 | GSETTINGS_PACKAGE ?= "${PN}" | |
11 | RDEPENDS_${PN} += "glib-2.0-utils" | 11 | |
12 | 12 | python __anonymous() { | |
13 | FILES_${PN} += "${datadir}/glib-2.0/schemas" | 13 | pkg = d.getVar("GSETTINGS_PACKAGE") |
14 | 14 | if pkg: | |
15 | PACKAGE_WRITE_DEPS += "glib-2.0-native" | 15 | d.appendVar("PACKAGE_WRITE_DEPS", " glib-2.0-native") |
16 | d.appendVar("RDEPENDS_" + pkg, " ${MLPREFIX}glib-2.0-utils") | ||
17 | d.appendVar("FILES_" + pkg, " ${datadir}/glib-2.0/schemas") | ||
18 | } | ||
16 | 19 | ||
17 | gsettings_postinstrm () { | 20 | gsettings_postinstrm () { |
18 | glib-compile-schemas $D${datadir}/glib-2.0/schemas | 21 | glib-compile-schemas $D${datadir}/glib-2.0/schemas |
19 | } | 22 | } |
20 | 23 | ||
21 | python populate_packages_append () { | 24 | python populate_packages_append () { |
22 | pkg = d.getVar('PN') | 25 | pkg = d.getVar('GSETTINGS_PACKAGE') |
23 | bb.note("adding gsettings postinst scripts to %s" % pkg) | 26 | if pkg: |
24 | 27 | bb.note("adding gsettings postinst scripts to %s" % pkg) | |
25 | postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst') | 28 | |
26 | if not postinst: | 29 | postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst') |
27 | postinst = '#!/bin/sh\n' | 30 | if not postinst: |
28 | postinst += d.getVar('gsettings_postinstrm') | 31 | postinst = '#!/bin/sh\n' |
29 | d.setVar('pkg_postinst_%s' % pkg, postinst) | 32 | postinst += d.getVar('gsettings_postinstrm') |
30 | 33 | d.setVar('pkg_postinst_%s' % pkg, postinst) | |
31 | bb.note("adding gsettings postrm scripts to %s" % pkg) | 34 | |
32 | 35 | bb.note("adding gsettings postrm scripts to %s" % pkg) | |
33 | postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm') | 36 | |
34 | if not postrm: | 37 | postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm') |
35 | postrm = '#!/bin/sh\n' | 38 | if not postrm: |
36 | postrm += d.getVar('gsettings_postinstrm') | 39 | postrm = '#!/bin/sh\n' |
37 | d.setVar('pkg_postrm_%s' % pkg, postrm) | 40 | postrm += d.getVar('gsettings_postinstrm') |
41 | d.setVar('pkg_postrm_%s' % pkg, postrm) | ||
38 | } | 42 | } |