From patchwork Tue Jan 8 14:38:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 154975 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4953862jaa; Tue, 8 Jan 2019 06:39:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN7L3Zla+aM3nF3C5iH23G8TSjmVpLQSKXn28NI66Y7CxipxMPX6uF1AfE8ZL3WryKQNoY3j X-Received: by 2002:a17:902:2bc5:: with SMTP id l63mr2047772plb.107.1546958340907; Tue, 08 Jan 2019 06:39:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546958340; cv=none; d=google.com; s=arc-20160816; b=Gzpd0vlugrdEFifqpeN8mSLapvK26TI8dKYau316gQMZ8L7fzV2/tXpfUvFECDNRIb dyyh7AZZyaW438ZncOqTlW23eGRwhznuDTDp5XdDS+uA2UKizOACbuThOpV+MzUHlVKO KClt3igCgwgrqwlh+BsUSygUEUi+t+fJZl+18zo63waemVnkam4l8sQdjPapvLoMRwTv W26qUDHw/fzH6nnIzvV42gCU2KKlxLs6eLIZhJ5XPX9CzkXwF35IGSMPXo7zwZUjGwB6 Tvw77yRYEsuaUbzjF3XEIxVR666jXfUm4xUrzf/rQTe2k+9pXcVSEfARoc5wRFt5ufhK 264g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=itw0aBVQ7pmG29WvNiX6p7p5FYSw9wEJ4N4gynKjZYY=; b=paI9A9cRA/ehXqcbupFBc+3etojZuol1//KxcxwUFrUCAuf0dAjJT71Xo1kxMw7n2g +QJ1+oZjCpaFIOq7YGO+ZG85Q4MKPZvE/swF9DHHJyHu4S6phufHQtQxR7aymaDJhfr0 ObXK1TDRieHZWxfeO/E2QOodUYY0fCmT7vSAchRm7FD+kfRxGhW9HLUupyTlopnWbR1z wXuC70j7vDo6s0gakFslOV4+oO5F8l1B/um8zS7syEHUV8n5Vfxu6XCo7EtA7WXRvTwy jO0PpJLeXEGkvZyINuG/aAZ3C0hFXPjopg/usAnJIPzvtYbIjRZ4tEMwGu+pUqqg3qua QrFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=QmyFNsc1; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id a1si5791311pgk.495.2019.01.08.06.39.00; Tue, 08 Jan 2019 06:39:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=QmyFNsc1; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id AA6127BD94; Tue, 8 Jan 2019 14:38:56 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mail.openembedded.org (Postfix) with ESMTP id ABC27605BF for ; Tue, 8 Jan 2019 14:38:54 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id f188so4597371wmf.5 for ; Tue, 08 Jan 2019 06:38:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=vpcV7eoT+yG5rhSSbV3EYgSmqhyE2tiatylu+JLqszg=; b=QmyFNsc1QK6ETAMQ3YMG5sjLFawcv6m4se9N7FHjlk7bRMVdev7JObwVgYabwXk+tf Xp+qwgvOM+SMXau/Yxkptudgek4HJD/36tLfiJ4yRAlYAdgGQEov/mWbajnjlfAErDcx JPXYWbUK8Bf8lD8Hycy77DQiHVETWygyUZjLZCcsAYg4DoAMor6ItuyqapjvuFIzrxwr mbJWK/t5xztvW0OemRApDniNBVYHbCSZkurGXUsKU3+xgTZ+pHrUC+8eWtH04FcdgYuj WaUZX5jXmv8yj/H5q8NgT64Rb12IpM3/icjkT4qyO+pgSk+KO4n9dGprPp2K/433eig3 +cPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=vpcV7eoT+yG5rhSSbV3EYgSmqhyE2tiatylu+JLqszg=; b=Gp+MzRyBErQZJ+BQ8qcW/gx532R4Xjnx8B5oRfPGXg9hjafVoYbNPdjU0TtZUtRwjp jEeuridCSKpJbajF2rRNMN2qsXtAezX1dJFBZzFSY5SfK3qlv2fhGM2ehIQ1KbrBrHae AfIrFIacsXNUqmkjFG+uh2VU0/DHCMN474v5Zw5oP+mnCJEBJgNelG5QqzdPF9VIv8a2 YiNUlwB8o144K9rTrpXcnZ/41/wFPUtY4TLV7tOSFOZ5jhGqwVCinEtalQSvqr2V5XAL dV8a4XLAWO11sGgwnXDnj0gvC9D0WtDvlMliH0fd66OfSS9EXFvJ72zc2Vtw2q5X3AC+ mdyA== X-Gm-Message-State: AJcUukeLz6V7ot+i5s/d1G/Xto0/5aajMb/ITXQ6A16Hden767fwl6yX R1J35xiZhJU50OjA3l6Eb7+fEKtPsgQ= X-Received: by 2002:a1c:cec1:: with SMTP id e184mr2070646wmg.75.1546958335123; Tue, 08 Jan 2019 06:38:55 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id m4sm11803498wmi.3.2019.01.08.06.38.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jan 2019 06:38:54 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 8 Jan 2019 14:38:49 +0000 Message-Id: <20190108143851.20544-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH 1/3] gsettings: allow the schemas to be in any package X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org 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. Signed-off-by: Ross Burton --- meta/classes/gsettings.bbclass | 48 +++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 22 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/gsettings.bbclass b/meta/classes/gsettings.bbclass index eae3dc7999f..47cf00102ec 100644 --- a/meta/classes/gsettings.bbclass +++ b/meta/classes/gsettings.bbclass @@ -7,32 +7,36 @@ # TODO use a trigger so that this runs once per package operation run - -RDEPENDS_${PN} += "glib-2.0-utils" - -FILES_${PN} += "${datadir}/glib-2.0/schemas" - -PACKAGE_WRITE_DEPS += "glib-2.0-native" +GSETTINGS_PACKAGE ?= "${PN}" + +python __anonymous() { + pkg = d.getVar("GSETTINGS_PACKAGE") + if pkg: + d.appendVar("PACKAGE_WRITE_DEPS", " glib-2.0-native") + d.appendVar("RDEPENDS_" + pkg, " glib-2.0-utils") + d.appendVar("FILES_" + pkg, " ${datadir}/glib-2.0/schemas") +} gsettings_postinstrm () { glib-compile-schemas $D${datadir}/glib-2.0/schemas } python populate_packages_append () { - pkg = d.getVar('PN') - bb.note("adding gsettings postinst scripts to %s" % pkg) - - postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst') - if not postinst: - postinst = '#!/bin/sh\n' - postinst += d.getVar('gsettings_postinstrm') - d.setVar('pkg_postinst_%s' % pkg, postinst) - - bb.note("adding gsettings postrm scripts to %s" % pkg) - - postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm') - if not postrm: - postrm = '#!/bin/sh\n' - postrm += d.getVar('gsettings_postinstrm') - d.setVar('pkg_postrm_%s' % pkg, postrm) + pkg = d.getVar('GSETTINGS_PACKAGE') + if pkg: + bb.note("adding gsettings postinst scripts to %s" % pkg) + + postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst') + if not postinst: + postinst = '#!/bin/sh\n' + postinst += d.getVar('gsettings_postinstrm') + d.setVar('pkg_postinst_%s' % pkg, postinst) + + bb.note("adding gsettings postrm scripts to %s" % pkg) + + postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm') + if not postrm: + postrm = '#!/bin/sh\n' + postrm += d.getVar('gsettings_postinstrm') + d.setVar('pkg_postrm_%s' % pkg, postrm) }