From patchwork Thu Jan 10 13:52:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 155174 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1919461jaa; Thu, 10 Jan 2019 05:53:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN7i6SP8vPAZAtY+Biu/04QYoxxlTNL0Lw1f7VfZ/07S1Ns5p2nYWMk0VipdHucT2CkQsOpR X-Received: by 2002:a63:2c0e:: with SMTP id s14mr9643420pgs.132.1547128412786; Thu, 10 Jan 2019 05:53:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547128412; cv=none; d=google.com; s=arc-20160816; b=n3j/k+9I2AcUP64O4Fwhs/RlQZq/kWgY0vhLYmdW5/EmshIYgO/Y6iJ3/2s6Qaai9N 0+zwcUfVYXKF3WqWUl88r4QflpLPPjq4lmtU7ZjuJB2LhoGfJO+i5WDTXMU7adLdWynD NG7xXwOwxqp1uL97KenMjPaq7+eoWTU7Gz1bsgQYSTrKpwR7n5wahgY0lScqKPHsUW23 bbrCmJvY9Eo91TQqmm9owIbxTiZUX+pUcSX4m+upBLfPJT4ZWcH9NeH86TRe2TrEiDX6 3PnXO8n6PtjiMgKRub/pw17m4iwLPuA1XsuqkT0LAlHqx+L7e1aCF+QPw6rIKa1rKYIH 9kFQ== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=1TTdetOE1eGBpLdDlCprmi7G8O9olCiuCkP2wrQE5HE=; b=oV6UTazQUkBuo39o0P/fl7A/0vhEh6aPLmGzu82Vtjvhl6jCaAwcu8i8TAAJvfl6cd Np0iI2JN+B+DIHyldZnpvHOmVkkIVR880TmzVq/PhJ+XpjSWWAg6iim/n1YLgBmEc3uv H4aUJ7Aua00rZm7IK1d4zRgTZ8hwSZ5BuZIR2XESkRVIpJBnjDdbK2rGgwvkkfTzDiiz hsvMy4u3K2ui/xNy+ZC1jVn32W8IcopxrCIov6lqWY+AkjmhgpZ+sFY/yHhWpjAgN9MZ 2HhWxLcUlUuopOLxumjOMlT0NWsI6LZEUth/L39L90GXx9gPrRlP5Wt5T9+mFLX9iVD8 aG+w== 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=u9TYiCiV; 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 g26si17289966pfi.184.2019.01.10.05.53.32; Thu, 10 Jan 2019 05:53:32 -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=u9TYiCiV; 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 8F94A7C0A6; Thu, 10 Jan 2019 13:53:27 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mail.openembedded.org (Postfix) with ESMTP id 986A27C098 for ; Thu, 10 Jan 2019 13:53:05 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id z5so11425336wrt.11 for ; Thu, 10 Jan 2019 05:53:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uKcXpPblS0G7ARKmNZzvgcvBar7OVELjXP7jWr9qLjc=; b=u9TYiCiVJ1rzjBaWq77PwjW/hur7RoX9QA6/Ie8Y1U0rvupkcgCNz8/st89usMYIVr V39tae9supE3Vo4Rf0U5yq5+C8Wo3S3lxeLofUStAlBwxCrIFajS4C5Wol+1iAFoGFoa ua86ZrOQDRpbT7mtca1LJXIOucFG22tN+SRVXdri6sWfAYvRDgojetdI1ejg0t6AES8P voWzcITQUq+uA0zg9IudC6s8TXudpnUt/oiy1XDiz9OEhLA5wKKqS/wyPMclU3Axnons q64k4hkmutEOQdp4PaJd6rthInK+PdgRMZQFbUSrf6+Ng6v4pAHg9a0NJQ9TgspChL9Y bQlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uKcXpPblS0G7ARKmNZzvgcvBar7OVELjXP7jWr9qLjc=; b=qYKH0Vo7yD36TkVaxXvkvcEEPglbOFmx/GTqTJXbk6gAbRe01Rwj+KOhpn8lH46ZsT 87SpY1GrTK+jDQb7s5ZKBnFEwFNSEysiScBnjj/pzITVgCd4LYTppLQFXd1LL6ehFyUH 2cOjAWwmFKstilKblDJI3tX8OPXE1LNV5RzIZcekbnYiTJ4grkvYeHalw364mXUuUFM7 N72glWyZjsJNRDfC2mAz0TMwviuDtrBw0Pr/XcaEQ7tAGtiugZfEgoafcP6Zg1mkx/tX 9FsKbdwIeNLp8viwgZCoX+UFW7U22nWOkoqryfjDaunCdJmeBLNrHCezP5T4NSJKeamG +D6Q== X-Gm-Message-State: AJcUukdmun60+PTE8QPTlUBWKjnltnvsczL0MDb59GktGCrD9PtSxXiv 9yXULL9PKzMLLHbXtBaFoUuMYOMcnWs= X-Received: by 2002:a5d:4046:: with SMTP id w6mr9817210wrp.92.1547128386193; Thu, 10 Jan 2019 05:53:06 -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 q9sm78248587wrp.0.2019.01.10.05.53.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 05:53:05 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 10 Jan 2019 13:52:59 +0000 Message-Id: <20190110135301.1888-3-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190110135301.1888-1-ross.burton@intel.com> References: <20190110135301.1888-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 3/5] 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. (From OE-Core rev: 28e84a07dd74636554bdf7622da167a1fe1af963) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- 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..33afc96a9ce 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, " ${MLPREFIX}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) }