Skip to contentSkip to conversation

A few misc. commits I had pending

PATCH Applied Christopher Larson 2 participants 8 messages May 1, 2012 – May 3, 2012

lore
Share & tools
lore
#0 lore raw

cover A few misc. commits I had pending

Most of these are pretty simple and obvious fixes, but this also changes base.bbclass to use isinstance instead of bb.event.getName(), and also shifts the information used to display the build config summary at the start of the build into bitbake.conf as variables, so it's possible to easily add to the list of variables and content to be emitted there. As one example, I have a change to csl-versions.inc which adds the external toolchain version string to the summary.

The following changes since commit 26d822ad059dd4839cc6fee2a65714e73cc146e1:

nfs-utils: don't try to unload nfsd module (2012-05-01 14:28:47 +0100)

are available in the git repository at:
git://github.com/kergoth/oe-core misc-fixes

Christopher Larson (6):
mesa: add missing flex-native/bison-native deps
distcc: use PACKAGECONFIG for x11 distro feature
libpcap: use PACKAGECONFIG for bluetooth distro feature
libsndfile1: use PACKAGECONFIG for alsa distro feature bitbake.conf: shift build config summary control to here base.bbclass: use isinstance for base_eventhandler

 meta/classes/base.bbclass                          |   56 ++++++++++++-------
 meta/conf/bitbake.conf                             |    7 +++
 meta/recipes-connectivity/libpcap/libpcap.inc      |    5 ++-
 meta/recipes-devtools/distcc/distcc_2.18.3.bb      |   14 +++--
 meta/recipes-graphics/mesa/mesa-common.inc         |    2 +-
 .../libsndfile/libsndfile1_1.0.25.bb               |    5 ++-
 6 files changed, 59 insertions(+), 30 deletions(-)

Christopher Larson (6):
mesa: add missing flex-native/bison-native deps
distcc: use PACKAGECONFIG for x11 distro feature
libpcap: use PACKAGECONFIG for bluetooth distro feature
libsndfile1: use PACKAGECONFIG for alsa distro feature bitbake.conf: shift build config summary control to here base.bbclass: use isinstance for base_eventhandler

 meta/classes/base.bbclass                          |   56 ++++++++++++-------
 meta/conf/bitbake.conf                             |    7 +++
 meta/recipes-connectivity/libpcap/libpcap.inc      |    5 ++-
 meta/recipes-devtools/distcc/distcc_2.18.3.bb      |   14 +++--
 meta/recipes-graphics/mesa/mesa-common.inc         |    2 +-
 .../libsndfile/libsndfile1_1.0.25.bb               |    5 ++-
 6 files changed, 59 insertions(+), 30 deletions(-)
Signature · 1 line
1.7.7
#1 lore raw

PATCH 1/6 mesa: add missing flex-native/bison-native deps

From: Christopher Larson <[email protected]>

A quick glance at configure.ac shows that both are required to build mesa, but we were relying on their being built implicitly via other recipes in the dependency chain. Make it explicit.

---
 meta/recipes-graphics/mesa/mesa-common.inc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-graphics/mesa/mesa-common.inc +1 -1
index 1c376b7..f697e67 100644
@@ -19,7 +19,7 @@ PE = "2"
 PROTO_DEPS = "xf86driproto glproto"
 LIB_DEPS = "virtual/libx11 libxext libxxf86vm libxdamage libxfixes libxml2-native"
 
-DEPENDS = "makedepend-native python-native ${PROTO_DEPS} ${LIB_DEPS}"
+DEPENDS = "makedepend-native python-native flex-native bison-native ${PROTO_DEPS} ${LIB_DEPS}"
 
 PROVIDES = "virtual/libgl"
 
Signature · 1 line
1.7.7
#2 lore raw

PATCH 2/6 distcc: use PACKAGECONFIG for x11 distro feature

In reply to Christopher Larson

From: Christopher Larson <[email protected]>

---
 meta/recipes-devtools/distcc/distcc_2.18.3.bb |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
meta/recipes-devtools/distcc/distcc_2.18.3.bb +8 -6
index ec6ffb3..de181e5 100644
@@ -4,11 +4,15 @@ compilation of C/C++/ObjC code across machines on a network."
 SECTION = "devel"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-PR = "r7"
+PR = "r8"
 
-DEPENDS = "avahi ${GTKDEP}"
-GTKDEP_libc-uclibc = ""
-GTKDEP = "gtk+"
+DEPENDS = "avahi"
+
+GTKCONFIG = "gtk"
+GTKCONFIG_libc-uclibc = ""
+
+PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', '${GTKCONFIG}', '', d)}"
+PACKAGECONFIG[gtk] = "--with-gtk,--without-gtk --without-gnome,gtk+"
 
 RRECOMMENDS_${PN} = "avahi-daemon"
 
@@ -28,8 +32,6 @@ inherit autotools pkgconfig update-rc.d
 
 INITSCRIPT_NAME = "distcc"
 
-EXTRA_OECONF = "--with-gtk"
-EXTRA_OECONF_libc-uclibc = "--without-gtk --without-gnome"
 do_install_append() {
     install -d ${D}${sysconfdir}/init.d/
     install -d ${D}${sysconfdir}/default
Signature · 1 line
1.7.7
#3 lore raw

PATCH 3/6 libpcap: use PACKAGECONFIG for bluetooth distro feature

In reply to Christopher Larson

From: Christopher Larson <[email protected]>

---
 meta/recipes-connectivity/libpcap/libpcap.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
meta/recipes-connectivity/libpcap/libpcap.inc +4 -1
index 6051bbc..427078f 100644
@@ -10,7 +10,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867 \
                     file://pcap.h;beginline=1;endline=34;md5=8d6cf7e17d5745010d633e30bc529ea9"
 DEPENDS = "flex-native bison-native"
 
-INC_PR = "r0"
+PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'bluetooth', 'bluetooth', '', d)}"
+PACKAGECONFIG[bluetooth] = "--enable-bluetooth,--disable-bluetooth,bluez4"
+
+INC_PR = "r1"
 
 SRC_URI = "http://www.tcpdump.org/release/libpcap-${PV}.tar.gz"
 
Signature · 1 line
1.7.7
#4 lore raw

PATCH 4/6 libsndfile1: use PACKAGECONFIG for alsa distro feature

In reply to Christopher Larson
---
 .../libsndfile/libsndfile1_1.0.25.bb               |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
meta/recipes-multimedia/libsndfile/libsndfile1_1.0.25.bb +4 -1
index bbe2f1d..0c91fe3 100644
@@ -4,7 +4,7 @@ AUTHOR = "Erik de Castro Lopo"
 DEPENDS = "sqlite3"
 SECTION = "libs/multimedia"
 LICENSE = "LGPLv2.1"
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz"
 
@@ -15,6 +15,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=e77fe93202736b47c07035910f47974a"
 
 S = "${WORKDIR}/libsndfile-${PV}"
 
+PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
+PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
+
 EXTRA_OECONF = "--disable-external-libs"
 
 inherit autotools lib_package pkgconfig
Signature · 1 line
1.7.7
#5 lore raw

PATCH 5/6 bitbake.conf: shift build config summary control to here

In reply to Christopher Larson
---
 meta/classes/base.bbclass |   48 ++++++++++++++++++++++++++++++--------------
 meta/conf/bitbake.conf    |    7 ++++++
 2 files changed, 40 insertions(+), 15 deletions(-)
meta/classes/base.bbclass +33 -15
index a984eae..07ef9a2 100644
@@ -225,6 +225,27 @@ def get_layers_branch_rev(d):
 	return layers_branch_rev
 
 
+BUILDCFG_FUNCS ??= "buildcfg_vars get_layers_branch_rev buildcfg_neededvars"
+BUILDCFG_FUNCS[type] = "list"
+
+def buildcfg_vars(d):
+	statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
+	for var in statusvars:
+		value = d.getVar(var, True)
+		if value is not None:
+			yield '%-17s = "%s"' % (var, value)
+
+def buildcfg_neededvars(d):
+	needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
+	pesteruser = []
+	for v in needed_vars:
+		val = d.getVar(v, True)
+		if not val or val == 'INVALID':
+			pesteruser.append(v)
+
+	if pesteruser:
+		bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
+
 addhandler base_eventhandler
 python base_eventhandler() {
 	from bb.event import getName
@@ -232,22 +253,19 @@ python base_eventhandler() {
 	name = getName(e)
 
 	if name.startswith("BuildStarted"):
-		e.data.setVar( 'BB_VERSION', bb.__version__)
-		statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES', 'TARGET_FPU']
-		statuslines = ["%-17s = \"%s\"" % (i, e.data.getVar(i, True) or '') for i in statusvars]
-
-		statuslines += get_layers_branch_rev(e.data)
-		statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
-		bb.plain(statusmsg)
+		e.data.setVar('BB_VERSION', bb.__version__)
+		statuslines = []
+		for func in oe.data.typed_value('BUILDCFG_FUNCS', e.data):
+			g = globals()
+			if func not in g:
+				bb.warn("Build configuration function '%s' does not exist" % func)
+			else:
+				flines = g[func](e.data)
+				if flines:
+					statuslines.extend(flines)
 
-		needed_vars = [ "TARGET_ARCH", "TARGET_OS" ]
-		pesteruser = []
-		for v in needed_vars:
-			val = e.data.getVar(v, True)
-			if not val or val == 'INVALID':
-				pesteruser.append(v)
-		if pesteruser:
-			bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
+		statusheader = e.data.getVar('BUILDCFG_HEADER', True)
+		bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
 
         if name == "ConfigParsed":
                 generate_git_config(e)
meta/conf/bitbake.conf +7 -0
index 9f4e4d4..dc68690 100644
@@ -609,6 +609,13 @@ export PATCH_GET="0"
 # Not sure about the rest of this yet.
 ##################################################################
 
+# Pre-build configuration output
+BUILDCFG_HEADER = "Build Configuration:"
+BUILDCFG_VARS = "BB_VERSION TARGET_ARCH TARGET_OS MACHINE DISTRO DISTRO_VERSION TUNE_FEATURES TARGET_FPU"
+BUILDCFG_VARS[type] = "list"
+BUILDCFG_NEEDEDVARS = "TARGET_ARCH TARGET_OS"
+BUILDCFG_NEEDEDVARS[type] = "list"
+
 # Other
 
 export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}/${libdir}/pkgconfig"
Signature · 1 line
1.7.7
#6 lore raw

PATCH 6/6 base.bbclass: use isinstance for base_eventhandler

In reply to Christopher Larson
---
 meta/classes/base.bbclass |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
meta/classes/base.bbclass +6 -10
index 07ef9a2..bb39b7b 100644
@@ -248,12 +248,13 @@ def buildcfg_neededvars(d):
 
 addhandler base_eventhandler
 python base_eventhandler() {
-	from bb.event import getName
-
-	name = getName(e)
-
-	if name.startswith("BuildStarted"):
+        if isinstance(e, bb.event.ConfigParsed):
 		e.data.setVar('BB_VERSION', bb.__version__)
+                generate_git_config(e)
+                pkgarch_mapping(e.data)
+                preferred_ml_updates(e.data)
+
+	if isinstance(e, bb.event.BuildStarted):
 		statuslines = []
 		for func in oe.data.typed_value('BUILDCFG_FUNCS', e.data):
 			g = globals()
@@ -266,11 +267,6 @@ python base_eventhandler() {
 
 		statusheader = e.data.getVar('BUILDCFG_HEADER', True)
 		bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
-
-        if name == "ConfigParsed":
-                generate_git_config(e)
-                pkgarch_mapping(e.data)
-                preferred_ml_updates(e.data)
 }
 
 addtask configure after do_patch
Signature · 1 line
1.7.7
Applied
#7 lore raw
In reply to Christopher Larson
Quoted 39 lines · Christopher Larson

Most of these are pretty simple and obvious fixes, but this also changes base.bbclass to use isinstance instead of bb.event.getName(), and also shifts the information used to display the build config summary at the start of the build into bitbake.conf as variables, so it's possible to easily add to the list of variables and content to be emitted there. As one example, I have a change to csl-versions.inc which adds the external toolchain version string to the summary.

The following changes since commit 26d822ad059dd4839cc6fee2a65714e73cc146e1:

   nfs-utils: don't try to unload nfsd module (2012-05-01 14:28:47 +0100)

are available in the git repository at:
git://github.com/kergoth/oe-core misc-fixes

Christopher Larson (6):
mesa: add missing flex-native/bison-native deps
distcc: use PACKAGECONFIG for x11 distro feature
libpcap: use PACKAGECONFIG for bluetooth distro feature
libsndfile1: use PACKAGECONFIG for alsa distro feature bitbake.conf: shift build config summary control to here base.bbclass: use isinstance for base_eventhandler

  meta/classes/base.bbclass                          |   56 ++++++++++++-------
  meta/conf/bitbake.conf                             |    7 +++
  meta/recipes-connectivity/libpcap/libpcap.inc      |    5 ++-
  meta/recipes-devtools/distcc/distcc_2.18.3.bb      |   14 +++--
  meta/recipes-graphics/mesa/mesa-common.inc         |    2 +-
  .../libsndfile/libsndfile1_1.0.25.bb               |    5 ++-
  6 files changed, 59 insertions(+), 30 deletions(-)

Christopher Larson (6):
mesa: add missing flex-native/bison-native deps
distcc: use PACKAGECONFIG for x11 distro feature
libpcap: use PACKAGECONFIG for bluetooth distro feature
libsndfile1: use PACKAGECONFIG for alsa distro feature bitbake.conf: shift build config summary control to here base.bbclass: use isinstance for base_eventhandler

Quoted 8 lines
  meta/classes/base.bbclass                          |   56 ++++++++++++-------
  meta/conf/bitbake.conf                             |    7 +++
  meta/recipes-connectivity/libpcap/libpcap.inc      |    5 ++-
  meta/recipes-devtools/distcc/distcc_2.18.3.bb      |   14 +++--
  meta/recipes-graphics/mesa/mesa-common.inc         |    2 +-
  .../libsndfile/libsndfile1_1.0.25.bb               |    5 ++-
  6 files changed, 59 insertions(+), 30 deletions(-)

Merged into OE-Core

Thanks
Sau!