diff options
author | Ross Burton <ross.burton@intel.com> | 2019-01-04 15:23:17 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-11 10:39:09 +0000 |
commit | c62ad6939fb798abf346e49f696b5ebbfc9ab4e9 (patch) | |
tree | 07c2c8087a9f482f1eccd26aca4ecb73123febba /meta/classes/gsettings.bbclass | |
parent | 1e4627ffbbeb8fe62108283c14ac01f6e2e3e98b (diff) | |
download | poky-c62ad6939fb798abf346e49f696b5ebbfc9ab4e9.tar.gz |
gsettings: allow the schemas to be in any package
Instead of assuming that the schemas are located in ${PN}, add a
GSETTINGS_PACKAGE variable for the package name and default it to ${PN}.
For recipe that can conditionally ship schemas, support GSETTINGS_PACKAGE being
empty gracefully by doing nothing.
(From OE-Core rev: c2b9c34ce4af151cc0422e14af775c6c962de051)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/gsettings.bbclass')
-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 | } |