]> code.ossystems Code Review - openembedded-core.git/commitdiff
base.bbclass: Initial work to add GPLv2 Only Build with Whitelist for GPLv3 Native...
authorSaul Wold <Saul.Wold@intel.com>
Mon, 16 Aug 2010 21:48:04 +0000 (14:48 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 20 Aug 2010 15:53:36 +0000 (16:53 +0100)
[tweaks from Richard Purdie]

Signed-off-by: Saul Wold <Saul.Wold@intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
meta/classes/base.bbclass
meta/conf/distro/poky.conf

index 6ef2baba71ee40cb01837de7eb52b00814493f04..843c380a9e651b6bd7daa25e4ade2baaa0fd7827 100644 (file)
@@ -437,6 +437,7 @@ do_build[func] = "1"
 python () {
     import exceptions
 
+    pn = bb.data.getVar('PN', d, 1)
     # If we're building a target package we need to use fakeroot (pseudo)
     # in order to capture permissions, owners, groups and special files
     if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
@@ -464,7 +465,18 @@ python () {
             if this_machine and not re.match(need_machine, this_machine):
                 raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine)
 
-    pn = bb.data.getVar('PN', d, 1)
+
+        dont_want_license = bb.data.getVar('INCOMPATIBLE_LICENSE', d, 1)
+        if dont_want_license and not pn.endswith("-native") and not pn.endswith("-cross") and not pn.endswith("-cross-initial") and not pn.endswith("-cross-intermediate"):
+            gplv3_hosttools_whitelist = (bb.data.getVar("GPLv3_HOSTTOOLS_WHITELIST", d, 1) or "").split()
+            gplv3_lgplv2_whitelist = (bb.data.getVar("GPLv3_LGPLv2_WHITELIST", d, 1) or "").split()
+            gplv3_whitelist = (bb.data.getVar("GPLv3_WHITELIST", d, 1) or "").split()
+            if pn not in gplv3_hosttools_whitelist and pn not in gplv3_lgplv2_whitelist and pn not in gplv3_whitelist:
+                import re
+                this_license = bb.data.getVar('LICENSE', d, 1)
+                if this_license and re.search(dont_want_license, this_license):
+                    bb.note("SKIPPING %s because it's %s" % (pn, this_license))
+                    raise bb.parse.SkipPackage("incompatible with license %s" % this_license)
 
     # OBSOLETE in bitbake 1.7.4
     srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1)
index cd2067d40562252599f376c0d7752e311239f65c..8fb6742d5033cf55a9d08362b6bba2f07d705b07 100644 (file)
@@ -117,5 +117,11 @@ IMAGE_FEATURES ?= ""
 
 EXTRAOPKGCONFIG = "poky-feed-config-opkg"
 
+# This is a list of packages that are used by poky to build the distribution, they are not
+# directly part of the distribution. 
+GPLv3_HOSTTOOLS_WHITELIST = ""
+GPLv3_WHITELIST = "less gnome-common"
+GPLv3_LGPLv2_WHITELIST = "libassuan gnutls libtasn1 libidn" 
+
 require conf/distro/include/world-broken.inc
 require conf/distro/include/distro_tracking_fields.inc