summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/gconf.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 14:35:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-12 15:27:17 +0100
commitfd1517e2b51a170f2427122c6b95396db251d827 (patch)
treedabfe3e631339c2fc99a9ee7febb0f9c128e325e /meta/classes-recipe/gconf.bbclass
parent10317912ee319ccf7f83605d438b5cbf9663f296 (diff)
downloadpoky-fd1517e2b51a170f2427122c6b95396db251d827.tar.gz
classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/gconf.bbclass')
-rw-r--r--meta/classes-recipe/gconf.bbclass77
1 files changed, 77 insertions, 0 deletions
diff --git a/meta/classes-recipe/gconf.bbclass b/meta/classes-recipe/gconf.bbclass
new file mode 100644
index 0000000000..b81851bc78
--- /dev/null
+++ b/meta/classes-recipe/gconf.bbclass
@@ -0,0 +1,77 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7DEPENDS += "gconf"
8PACKAGE_WRITE_DEPS += "gconf-native"
9
10# These are for when gconftool is used natively and the prefix isn't necessarily
11# the sysroot. TODO: replicate the postinst logic for -native packages going
12# into sysroot as they won't be running their own install-time schema
13# registration (disabled below) nor the postinst script (as they don't happen).
14export GCONF_SCHEMA_INSTALL_SOURCE = "xml:merged:${STAGING_DIR_NATIVE}${sysconfdir}/gconf/gconf.xml.defaults"
15export GCONF_BACKEND_DIR = "${STAGING_LIBDIR_NATIVE}/GConf/2"
16
17# Disable install-time schema registration as we're a packaging system so this
18# happens in the postinst script, not at install time. Set both the configure
19# script option and the traditional envionment variable just to make sure.
20EXTRA_OECONF += "--disable-schemas-install"
21export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL = "1"
22
23gconf_postinst() {
24if [ "x$D" != "x" ]; then
25 export GCONF_CONFIG_SOURCE="xml::$D${sysconfdir}/gconf/gconf.xml.defaults"
26else
27 export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
28fi
29
30SCHEMA_LOCATION=$D/etc/gconf/schemas
31for SCHEMA in ${SCHEMA_FILES}; do
32 if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
33 HOME=$D/root gconftool-2 \
34 --makefile-install-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
35 fi
36done
37}
38
39gconf_prerm() {
40SCHEMA_LOCATION=/etc/gconf/schemas
41for SCHEMA in ${SCHEMA_FILES}; do
42 if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
43 HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
44 gconftool-2 \
45 --makefile-uninstall-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
46 fi
47done
48}
49
50python populate_packages:append () {
51 import re
52 packages = d.getVar('PACKAGES').split()
53 pkgdest = d.getVar('PKGDEST')
54
55 for pkg in packages:
56 schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg)
57 schemas = []
58 schema_re = re.compile(r".*\.schemas$")
59 if os.path.exists(schema_dir):
60 for f in os.listdir(schema_dir):
61 if schema_re.match(f):
62 schemas.append(f)
63 if schemas != []:
64 bb.note("adding gconf postinst and prerm scripts to %s" % pkg)
65 d.setVar('SCHEMA_FILES', " ".join(schemas))
66 postinst = d.getVar('pkg_postinst:%s' % pkg)
67 if not postinst:
68 postinst = '#!/bin/sh\n'
69 postinst += d.getVar('gconf_postinst')
70 d.setVar('pkg_postinst:%s' % pkg, postinst)
71 prerm = d.getVar('pkg_prerm:%s' % pkg)
72 if not prerm:
73 prerm = '#!/bin/sh\n'
74 prerm += d.getVar('gconf_prerm')
75 d.setVar('pkg_prerm:%s' % pkg, prerm)
76 d.appendVar("RDEPENDS:%s" % pkg, ' ' + d.getVar('MLPREFIX', False) + 'gconf')
77}