Patchwork [5/5] gnomebase.bbclass: skip packages inheriting gnomebase unless x11 is defined

login
register
mail settings
Submitter Andreas Oberritter
Date Feb. 22, 2012, 11:26 a.m.
Message ID <1329910007-8441-6-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/21567/
State New
Headers show

Comments

Andreas Oberritter - Feb. 22, 2012, 11:26 a.m.
* Drop dependency on GNOME if x11 is disabled.
* Exceptions may be listed in a whitelist.
* Current exceptions are: libcroco, librsvg and pango.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/classes/gnomebase.bbclass |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/classes/gnomebase.bbclass b/meta/classes/gnomebase.bbclass
index a4209a0..f81d79b 100644
--- a/meta/classes/gnomebase.bbclass
+++ b/meta/classes/gnomebase.bbclass
@@ -6,7 +6,7 @@  def gnome_verdir(v):
 SECTION ?= "x11/gnome"
 SRC_URI = "${GNOME_MIRROR}/${BPN}/${@gnome_verdir("${PV}")}/${BPN}-${PV}.tar.bz2;name=archive"
 
-DEPENDS += "gnome-common"
+DEPENDS += "${@base_contains('DISTRO_FEATURES', 'x11', 'gnome-common', '', d)}"
 
 FILES_${PN} += "${datadir}/application-registry  \
 	${datadir}/mime-info \
@@ -28,3 +28,8 @@  do_install_append() {
 	rm -f ${D}${datadir}/applications/*.cache
 }
 
+python () {
+        whitelist = [ "libcroco", "librsvg", "pango" ]
+        if not d.getVar('BPN', True) in whitelist and not oe.utils.contains ('DISTRO_FEATURES', 'x11', True, False, d):
+                raise bb.parse.SkipPackage("'x11' not in DISTRO_FEATURES")
+}