Skip to contentSkip to conversation

bitbake: staging of binary over symlink breaks sysroot (lzma x xz)

RFC PATCH In review Stanislav Brabec 6 participants 14 messages Jul 28, 2010 – Aug 4, 2010

lore
Share & tools
lore
#0 lore raw

I just built an angstrom image and thinks failed.

lzma image depends on lzma-native, grep and other programs that use .xz suffix for tarballs depend on xz-native.
This fact itself is bad - it creates file conflicts in the sysroot.

But things were even worse:
- xz-native staged xz binary and lzma as a symlink to xz.
- lzma-native tried to stage lzma 4 minutes later

But staging of lzma apparently went wrong. Instead of removal of lzma symlink and installation of lzma binary, bitbake followed the symlink and staged lzma as xz with a result of broken build environment.

I have bitbake-1.8.18.

Signature · 3 lines
________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus
#1 lore raw

Stanislav,

we were discussing in irc about lzma and xz.
I'd add that it seems bitbake.conf is not yet xz aware while base.bbclass seems lzma-unaware

Regards

Andrea

P.S.

Quoted 3 lines · Stanislav Brabec

I just built an angstrom image and thinks failed.
I have bitbake-1.8.18.

FWIW last night I could build 3 images (and the cpio.lzma) with bitbake 1.10

#2 lore raw
In reply to Stanislav Brabec

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

Quoted 10 lines

I just built an angstrom image and thinks failed.

lzma image depends on lzma-native, grep and other programs that use .xz suffix for tarballs depend on xz-native.
This fact itself is bad - it creates file conflicts in the sysroot.

But things were even worse:
- xz-native staged xz binary and lzma as a symlink to xz.
- lzma-native tried to stage lzma 4 minutes later

Quoted 6 lines

But staging of lzma apparently went wrong. Instead of removal of lzma symlink and installation of lzma binary, bitbake followed the symlink and staged lzma as xz with a result of broken build environment.

I have bitbake-1.8.18.

Yes :-(
same here and other people I know are struggling trying to build.

/marco

#3 lore raw
In reply to Stanislav Brabec

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

Quoted 10 lines

I just built an angstrom image and thinks failed.

lzma image depends on lzma-native, grep and other programs that use .xz suffix for tarballs depend on xz-native.
This fact itself is bad - it creates file conflicts in the sysroot.

But things were even worse:
- xz-native staged xz binary and lzma as a symlink to xz.
- lzma-native tried to stage lzma 4 minutes later

Quoted 6 lines

But staging of lzma apparently went wrong. Instead of removal of lzma symlink and installation of lzma binary, bitbake followed the symlink and staged lzma as xz with a result of broken build environment.

I have bitbake-1.8.18.

In the meantime we are waiting for a patch I used
bitbake xz-native
prior to launch
bitbake x11-image

/marco

#4 lore raw
Quoted 15 lines · Marco Cavallini

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

Quoted 14 lines

I just built an angstrom image and thinks failed.

lzma image depends on lzma-native, grep and other programs that use .xz suffix for tarballs depend on xz-native.
This fact itself is bad - it creates file conflicts in the sysroot.

But things were even worse:
- xz-native staged xz binary and lzma as a symlink to xz.
- lzma-native tried to stage lzma 4 minutes later

But staging of lzma apparently went wrong. Instead of removal of lzma symlink and installation of lzma binary, bitbake followed the symlink and staged lzma as xz with a result of broken build environment.

Quoted 8 lines
Quoted 2 lines

I have bitbake-1.8.18.

In the meantime we are waiting for a patch I used
bitbake xz-native
prior to launch
bitbake x11-image

To rectify this extra manual step, one would need to something like the attached (untested). This does not take care of diverting lzma/xz binaries which is a separate issue.

classes/autotools.bbclass +12 -5
index b2de2b1..e4ad3bf 100644
@@ -1,8 +1,14 @@
 # use autotools_stage_all for native packages
 AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
 
-def autotools_deps(d):
-	if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
+def autotools_deps(d, virtclass=None):
+	if virtclass:
+		virtclass_str = "_virtclass-%s" % (virtclass)
+	else:
+		virtclass_str = ""
+	if ((virtclass and bb.data.inherits_class(virtclass, d)) \
+	     or (virtclass is None)) \
+		and bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS' + virtclass_str, d, 1):
 		return ''
 
 	pn = bb.data.getVar('PN', d, 1)
@@ -17,7 +23,7 @@ def autotools_deps(d):
 		if not bb.data.inherits_class('native', d) \
                         and not bb.data.inherits_class('cross', d) \
                         and not bb.data.inherits_class('sdk', d) \
-                        and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
+                        and not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d, 1):
                     deps += 'libtool-cross '
 
 	return deps + 'gnu-config-native '
@@ -25,8 +31,8 @@ def autotools_deps(d):
 EXTRA_OEMAKE = ""
 
 DEPENDS_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-native_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d)}"
+DEPENDS_virtclass-native_prepend = "${@autotools_deps(d, 'native')}"
+DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d, 'nativesdk')}"
 
 inherit siteinfo
 
@@ -86,6 +92,7 @@ oe_runconf () {
 }
 
 autotools_do_configure() {
+	[ "x${INHIBIT_AUTOTOOLS_DEPS_virtclass-native}" = "x" ] &&
 	case ${PN} in
 	autoconf*)
 	;;
classes/base.bbclass +14 -6
index 1847491..c4856d1 100644
@@ -57,7 +57,11 @@ oe_runmake() {
 	${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
 }
 
-def base_deps(d):
+def base_deps(d, virtclass=None):
+	if virtclass:
+		virtclass_str = "_virtclass-%s" % (virtclass)
+	else:
+		virtclass_str = ""
 	#
 	# Ideally this will check a flag so we will operate properly in
 	# the case where host == build == target, for now we don't work in
@@ -71,7 +75,7 @@ def base_deps(d):
 	# INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
 	# we need that built is the responsibility of the patch function / class, not
 	# the application.
-	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
+	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d):
 		if (bb.data.getVar('HOST_SYS', d, 1) !=
 	     	    bb.data.getVar('BUILD_SYS', d, 1)):
 			deps += " virtual/${TARGET_PREFIX}gcc virtual/libc "
@@ -84,8 +88,8 @@ def base_deps(d):
 	return deps
 
 DEPENDS_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-native_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d)} "
+DEPENDS_virtclass-native_prepend="${@base_deps(d, 'native')} "
+DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d, 'nativesdk')} "
 
 
 SCENEFUNCS += "base_scenefunction"
@@ -420,12 +424,16 @@ python () {
 
     # unzip-native should already be staged before unpacking ZIP recipes
     need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
 
-    if ".zip" in src_uri or need_unzip == "1":
+    if ".zip" in srcuri or need_unzip == "1":
         depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
         depends = depends + " unzip-native:do_populate_sysroot"
         bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    for ext in ['xz']: #['gzip', 'bzip2', 'xz']:
+        if '.' + ext in srcuri:
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + ext + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)
 
     # 'multimachine' handling
     mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
classes/native.bbclass +1 -3
index 3437836..57de77e 100644
@@ -89,7 +89,7 @@ PKG_CONFIG_SYSROOT_DIR = ""
 
 ORIG_DEPENDS := "${DEPENDS}"
 
-DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+DEPENDS_virtclass-native ?= "${@['${ORIG_DEPENDS}',''][bb.data.getVar('INHIBIT_DEFAULT_DEPS_virtclass-native', d, True) or False]}"
 
 python __anonymous () {
     # If we've a legacy native do_stage, we need to neuter do_install
@@ -111,7 +111,6 @@ python __anonymous () {
             if dep.endswith("-cross"):
                 newdeps.append(dep.replace("-cross", "-native"))
             elif not dep.endswith("-native"):
-     
                 newdeps.append(dep + "-native")
             else:
                 newdeps.append(dep)
@@ -121,7 +120,6 @@ python __anonymous () {
             if prov.find(pn) != -1:
                 continue
             if not prov.endswith("-native"):
-    
                 provides = provides.replace(prov, prov + "-native")
         bb.data.setVar("PROVIDES", provides, d)
         bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
recipes/grep/grep_2.6.3.bb +0 -2
index 981c062..5c76bab 100644
@@ -3,8 +3,6 @@ SECTION = "console/utils"
 DESCRIPTION = "grep GNU utility"
 PR = "r2"
 
-do_unpack[depends] += "xz-native:do_populate_sysroot"
-
 SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
            file://uclibc-fix.patch"
 
recipes/xz/xz_4.999.9beta.bb +3 -1
index 8733023..24278e0 100644
@@ -1,5 +1,7 @@
+INHIBIT_AUTOTOOLS_DEPS_virtclass-native = "1"
+INHIBIT_DEFAULT_DEPS_virtclass-native = "1"
 require xz.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.bz2;name=xz"
 SRC_URI[xz.md5sum] = "cc4044fcc073b8bcf3164d1d0df82161"
 SRC_URI[xz.sha256sum] = "330312c4397608d8b7be362cc7edbfeafa6101614bc2164d816ea767656aa15c"
#5 lore raw
Quoted 39 lines · Bernhard Reutner-Fischer
Quoted 15 lines · Marco Cavallini

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

Quoted 14 lines

I just built an angstrom image and thinks failed.

lzma image depends on lzma-native, grep and other programs that use .xz suffix for tarballs depend on xz-native.
This fact itself is bad - it creates file conflicts in the sysroot.

But things were even worse:
- xz-native staged xz binary and lzma as a symlink to xz.
- lzma-native tried to stage lzma 4 minutes later

But staging of lzma apparently went wrong. Instead of removal of lzma symlink and installation of lzma binary, bitbake followed the symlink and staged lzma as xz with a result of broken build environment.

Quoted 8 lines
Quoted 2 lines

I have bitbake-1.8.18.

In the meantime we are waiting for a patch I used
bitbake xz-native
prior to launch
bitbake x11-image

To rectify this extra manual step, one would need to something like the attached (untested). This does not take care of diverting lzma/xz binaries which is a separate issue.

classes/native.bbclass +0 -0
index 3437836..57de77e 100644
@@ -89,7 +89,7 @@ PKG_CONFIG_SYSROOT_DIR = ""
 

ORIG_DEPENDS := "${DEPENDS}"

classes/native.bbclass PKG_CONFIG_SYSROOT_DIR = "" · line 92

Quoted 2 lines
classes/native.bbclass +1 -1
-DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+DEPENDS_virtclass-native ?= "${@['${ORIG_DEPENDS}',''][bb.data.getVar('INHIBIT_DEFAULT_DEPS_virtclass-native', d, True) or False]}"

and if that reads
DEPENDS_virtclass-native ?= "${@base_conditional('INHIBIT_DEFAULT_DEPS_virtclass-native', '1', '', '${ORIG_DEPENDS}', d)}" then it actually does what it's supposed to do ;)

#6 lore raw

RFC PATCH 1/1 : automatically depend xz compressed URIs on xz-native [was: Re: bitbake: staging of binary over symlink breaks sysroot (lzma x xz)]

Quoted 21 lines · Bernhard Reutner-Fischer
Quoted 20 lines · Bernhard Reutner-Fischer
Quoted 19 lines · Marco Cavallini

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

Quoted 16 lines

I just built an angstrom image and thinks failed.

lzma image depends on lzma-native, grep and other programs that use .xz suffix for tarballs depend on xz-native.
This fact itself is bad - it creates file conflicts in the sysroot.

But things were even worse:
- xz-native staged xz binary and lzma as a symlink to xz.
- lzma-native tried to stage lzma 4 minutes later

But staging of lzma apparently went wrong. Instead of removal of lzma symlink and installation of lzma binary, bitbake followed the symlink and staged lzma as xz with a result of broken build environment.

I have bitbake-1.8.18.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

In the meantime we are waiting for a patch I used
bitbake xz-native
prior to launch
bitbake x11-image

To rectify this extra manual step, one would need to something like the attached (untested). This does not take care of diverting lzma/xz binaries which is a separate issue.

comments on the attached RFC patch?
TIA,

classes/autotools.bbclass +12 -5
index b2de2b1..b2901ff 100644
@@ -1,8 +1,14 @@
 # use autotools_stage_all for native packages
 AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
 
-def autotools_deps(d):
-	if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
+def autotools_deps(d, virtclass=None):
+	if virtclass:
+		virtclass_str = "_virtclass-%s" % (virtclass)
+	else:
+		virtclass_str = ""
+	if ((virtclass and bb.data.inherits_class(virtclass, d)) \
+	     or (virtclass is None)) \
+		and bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS' + virtclass_str, d, 1):
 		return ''
 
 	pn = bb.data.getVar('PN', d, 1)
@@ -17,7 +23,7 @@ def autotools_deps(d):
 		if not bb.data.inherits_class('native', d) \
                         and not bb.data.inherits_class('cross', d) \
                         and not bb.data.inherits_class('sdk', d) \
-                        and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
+                        and not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d, 1):
                     deps += 'libtool-cross '
 
 	return deps + 'gnu-config-native '
@@ -25,8 +31,8 @@ def autotools_deps(d):
 EXTRA_OEMAKE = ""
 
 DEPENDS_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-native_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d)}"
+DEPENDS_virtclass-native_prepend = "${@autotools_deps(d, 'native')}"
+DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d, 'nativesdk')}"
 
 inherit siteinfo
 
@@ -86,6 +92,7 @@ oe_runconf () {
 }
 
 autotools_do_configure() {
+	[ "x${INHIBIT_AUTORECONF}" = "x" ] &&
 	case ${PN} in
 	autoconf*)
 	;;
classes/base.bbclass +14 -6
index 1847491..c4856d1 100644
@@ -57,7 +57,11 @@ oe_runmake() {
 	${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
 }
 
-def base_deps(d):
+def base_deps(d, virtclass=None):
+	if virtclass:
+		virtclass_str = "_virtclass-%s" % (virtclass)
+	else:
+		virtclass_str = ""
 	#
 	# Ideally this will check a flag so we will operate properly in
 	# the case where host == build == target, for now we don't work in
@@ -71,7 +75,7 @@ def base_deps(d):
 	# INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
 	# we need that built is the responsibility of the patch function / class, not
 	# the application.
-	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
+	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d):
 		if (bb.data.getVar('HOST_SYS', d, 1) !=
 	     	    bb.data.getVar('BUILD_SYS', d, 1)):
 			deps += " virtual/${TARGET_PREFIX}gcc virtual/libc "
@@ -84,8 +88,8 @@ def base_deps(d):
 	return deps
 
 DEPENDS_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-native_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d)} "
+DEPENDS_virtclass-native_prepend="${@base_deps(d, 'native')} "
+DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d, 'nativesdk')} "
 
 
 SCENEFUNCS += "base_scenefunction"
@@ -420,12 +424,16 @@ python () {
 
     # unzip-native should already be staged before unpacking ZIP recipes
     need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
 
-    if ".zip" in src_uri or need_unzip == "1":
+    if ".zip" in srcuri or need_unzip == "1":
         depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
         depends = depends + " unzip-native:do_populate_sysroot"
         bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    for ext in ['xz']: #['gzip', 'bzip2', 'xz']:
+        if '.' + ext in srcuri:
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + ext + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)
 
     # 'multimachine' handling
     mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
classes/native.bbclass +2 -4
index 3437836..9539d30 100644
@@ -88,8 +88,7 @@ PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
 PKG_CONFIG_SYSROOT_DIR = ""
 
 ORIG_DEPENDS := "${DEPENDS}"
-
-DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+DEPENDS_virtclass-native ?= "${@base_conditional('INHIBIT_DEFAULT_DEPS_virtclass-native', '1', '', '${ORIG_DEPENDS}', d)}"
 
 python __anonymous () {
     # If we've a legacy native do_stage, we need to neuter do_install
@@ -111,7 +110,6 @@ python __anonymous () {
             if dep.endswith("-cross"):
                 newdeps.append(dep.replace("-cross", "-native"))
             elif not dep.endswith("-native"):
-     
                 newdeps.append(dep + "-native")
             else:
                 newdeps.append(dep)
@@ -121,9 +119,9 @@ python __anonymous () {
             if prov.find(pn) != -1:
                 continue
             if not prov.endswith("-native"):
-    
                 provides = provides.replace(prov, prov + "-native")
         bb.data.setVar("PROVIDES", provides, d)
         bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
+        bb.data.setVar("INHIBIT_AUTORECONF", bb.data.getVar("INHIBIT_AUTORECONF_virtclass-native", d, True), d)
 }
 
recipes/grep/grep_2.6.3.bb +0 -2
index 981c062..5c76bab 100644
@@ -3,8 +3,6 @@ SECTION = "console/utils"
 DESCRIPTION = "grep GNU utility"
 PR = "r2"
 
-do_unpack[depends] += "xz-native:do_populate_sysroot"
-
 SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
            file://uclibc-fix.patch"
 
recipes/xz/xz_4.999.9beta.bb +4 -1
index 8733023..fe49412 100644
@@ -1,5 +1,8 @@
+INHIBIT_AUTOTOOLS_DEPS_virtclass-native = "1"
+INHIBIT_DEFAULT_DEPS_virtclass-native = "1"
+INHIBIT_AUTORECONF_virtclass-native = "1"
 require xz.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.bz2;name=xz"
 SRC_URI[xz.md5sum] = "cc4044fcc073b8bcf3164d1d0df82161"
 SRC_URI[xz.sha256sum] = "330312c4397608d8b7be362cc7edbfeafa6101614bc2164d816ea767656aa15c"
#7 lore raw

Re: [PATCH, RFC]: automatically depend xz compressed URIs on xz-native [was: Re: bitbake: staging of binary over symlink breaks sysroot (lzma x xz)]

Quoted 7 lines · Bernhard Reutner-Fischer
Quoted 3 lines · Bernhard Reutner-Fischer
Quoted 2 lines · Bernhard Reutner-Fischer
Quoted 1 line · Marco Cavallini

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

comments on the attached RFC patch?
TIA,

-snip-

Quoted 6 lines
classes/base.bbclass +0 -1
@@ -420,12 +424,16 @@ python () {
 
     # unzip-native should already be staged before unpacking ZIP recipes
     need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
 

classes/base.bbclass python () { · line 436

Quoted 10 lines
classes/base.bbclass +6 -1
-    if ".zip" in src_uri or need_unzip == "1":
+    if ".zip" in srcuri or need_unzip == "1":
         depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
         depends = depends + " unzip-native:do_populate_sysroot"
         bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    for ext in ['xz']: #['gzip', 'bzip2', 'xz']:
+        if '.' + ext in srcuri:
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + ext + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)

what does above hunk do.

Quoted 54 lines
classes/base.bbclass +0 -0
     # 'multimachine' handling
     mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
classes/native.bbclass +2 -4
index 3437836..9539d30 100644
@@ -88,8 +88,7 @@ PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
 PKG_CONFIG_SYSROOT_DIR = ""
 
 ORIG_DEPENDS := "${DEPENDS}"
-
-DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+DEPENDS_virtclass-native ?= "${@base_conditional('INHIBIT_DEFAULT_DEPS_virtclass-native', '1', '', '${ORIG_DEPENDS}', d)}"
 
 python __anonymous () {
     # If we've a legacy native do_stage, we need to neuter do_install
@@ -111,7 +110,6 @@ python __anonymous () {
             if dep.endswith("-cross"):
                 newdeps.append(dep.replace("-cross", "-native"))
             elif not dep.endswith("-native"):
-     
                 newdeps.append(dep + "-native")
             else:
                 newdeps.append(dep)
@@ -121,9 +119,9 @@ python __anonymous () {
             if prov.find(pn) != -1:
                 continue
             if not prov.endswith("-native"):
-    
                 provides = provides.replace(prov, prov + "-native")
         bb.data.setVar("PROVIDES", provides, d)
         bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
+        bb.data.setVar("INHIBIT_AUTORECONF", bb.data.getVar("INHIBIT_AUTORECONF_virtclass-native", d, True), d)
 }
 
recipes/grep/grep_2.6.3.bb +0 -2
index 981c062..5c76bab 100644
@@ -3,8 +3,6 @@ SECTION = "console/utils"
 DESCRIPTION = "grep GNU utility"
 PR = "r2"
 
-do_unpack[depends] += "xz-native:do_populate_sysroot"
-
 SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
            file://uclibc-fix.patch"
 
recipes/xz/xz_4.999.9beta.bb +0 -0
index 8733023..fe49412 100644

recipes/xz/xz_4.999.9beta.bb line 8

Quoted 9 lines
recipes/xz/xz_4.999.9beta.bb +4 -1
@@ -1,5 +1,8 @@
+INHIBIT_AUTOTOOLS_DEPS_virtclass-native = "1"
+INHIBIT_DEFAULT_DEPS_virtclass-native = "1"
+INHIBIT_AUTORECONF_virtclass-native = "1"
 require xz.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.bz2;name=xz"
 SRC_URI[xz.md5sum] = "cc4044fcc073b8bcf3164d1d0df82161"
 SRC_URI[xz.sha256sum] = "330312c4397608d8b7be362cc7edbfeafa6101614bc2164d816ea767656aa15c"

in general approach looks ok to me. It would be nice that while you are at it other packages which are needed early like git etc can use this approach as well.

Thanks
-Khem

Quoted 4 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#8 lore raw

Re: [PATCH, RFC]: automatically depend xz compressed URIs on xz-native [was: Re: bitbake: staging of binary over symlink breaks sysroot (lzma x xz)]

Quoted 16 lines · Khem Raj
Quoted 7 lines · Bernhard Reutner-Fischer
Quoted 3 lines · Bernhard Reutner-Fischer
Quoted 2 lines · Bernhard Reutner-Fischer
Quoted 1 line · Marco Cavallini

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

comments on the attached RFC patch?
TIA,

-snip-

Quoted 6 lines
classes/base.bbclass +0 -1
@@ -420,12 +424,16 @@ python () {
 
     # unzip-native should already be staged before unpacking ZIP recipes
     need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
 
Quoted 12 lines

classes/base.bbclass python () { · line 436

Quoted 10 lines
classes/base.bbclass +6 -1
-    if ".zip" in src_uri or need_unzip == "1":
+    if ".zip" in srcuri or need_unzip == "1":
         depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
         depends = depends + " unzip-native:do_populate_sysroot"
         bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    for ext in ['xz']: #['gzip', 'bzip2', 'xz']:
+        if '.' + ext in srcuri:
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + ext + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)

what does above hunk do.

srcuri=proto://some.thing.tar.xz
if ".xz" in srcuri then depend do_unpack on '
xz-native:do_populate_sysroot'

Re-reading the hunk it should better read:
import re
for (ext,tool) in [('xz','xz')]: # ('gz','gzip'),('bz','bzip2')
rex = re.compile('.*\.' + ext + '$')
if rex.match(srcuri):
depends = bb.data.getVarFlag('do_unpack', 'depends', d) or "" depends += ' ' + tool + '-native:do_populate_sysroot' bb.data.setVarFlag('do_unpack', 'depends', depends, d)

Quoted 3 lines

in general approach looks ok to me. It would be nice that while you are at it other packages which are needed early like git etc can use this approach as well.

Agree. One step at a time, let's first handle the unpackers though, k?

#9 lore raw

Re: [PATCH, RFC]: automatically depend xz compressed URIs on xz-native [was: Re: bitbake: staging of binary over symlink breaks sysroot (lzma x xz)]

Quoted 30 lines · Bernhard Reutner-Fischer
Quoted 16 lines · Khem Raj
Quoted 7 lines · Bernhard Reutner-Fischer
Quoted 3 lines · Bernhard Reutner-Fischer
Quoted 2 lines · Bernhard Reutner-Fischer
Quoted 1 line · Marco Cavallini

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

comments on the attached RFC patch?
TIA,

-snip-

Quoted 6 lines
classes/base.bbclass +0 -1
@@ -420,12 +424,16 @@ python () {
 
     # unzip-native should already be staged before unpacking ZIP recipes
     need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
 
Quoted 12 lines

classes/base.bbclass python () { · line 436

Quoted 10 lines
classes/base.bbclass +6 -1
-    if ".zip" in src_uri or need_unzip == "1":
+    if ".zip" in srcuri or need_unzip == "1":
         depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
         depends = depends + " unzip-native:do_populate_sysroot"
         bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    for ext in ['xz']: #['gzip', 'bzip2', 'xz']:
+        if '.' + ext in srcuri:
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + ext + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)

what does above hunk do.

Quoted 7 lines

srcuri=proto://some.thing.tar.xz
if ".xz" in srcuri then depend do_unpack on '
xz-native:do_populate_sysroot'

Re-reading the hunk it should better read:
import re
for (ext,tool) in [('xz','xz')]: # ('gz','gzip'),('bz','bzip2')

                                     ^

that will turn the rest into comment is that ok ?

Quoted 6 lines

rex = re.compile('.*\.' + ext + '$')
if rex.match(srcuri):
depends = bb.data.getVarFlag('do_unpack', 'depends', d) or "" depends += ' ' + tool + '-native:do_populate_sysroot' bb.data.setVarFlag('do_unpack', 'depends', depends, d)

Quoted 6 lines
Quoted 3 lines

in general approach looks ok to me. It would be nice that while you are at it other packages which are needed early like git etc can use this approach as well.

Agree. One step at a time, let's first handle the unpackers though, k?

yes however I wanted to keep this in notice.

Quoted 4 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#10 lore raw

Re: [PATCH, RFC]: automatically depend xz compressed URIs on xz-native [was: Re: bitbake: staging of binary over symlink breaks sysroot (lzma x xz)]

Quoted 35 lines · Khem Raj
Quoted 34 lines · Bernhard Reutner-Fischer
Quoted 16 lines · Khem Raj
Quoted 7 lines · Bernhard Reutner-Fischer
Quoted 3 lines · Bernhard Reutner-Fischer
Quoted 2 lines · Bernhard Reutner-Fischer
Quoted 1 line · Marco Cavallini

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

comments on the attached RFC patch?
TIA,

-snip-

Quoted 6 lines
classes/base.bbclass +0 -1
@@ -420,12 +424,16 @@ python () {
 
     # unzip-native should already be staged before unpacking ZIP recipes
     need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
 
Quoted 12 lines

classes/base.bbclass python () { · line 436

Quoted 10 lines
classes/base.bbclass +6 -1
-    if ".zip" in src_uri or need_unzip == "1":
+    if ".zip" in srcuri or need_unzip == "1":
         depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
         depends = depends + " unzip-native:do_populate_sysroot"
         bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    for ext in ['xz']: #['gzip', 'bzip2', 'xz']:
+        if '.' + ext in srcuri:
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + ext + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)

what does above hunk do.

srcuri=proto://some.thing.tar.xz
if ".xz" in srcuri then depend do_unpack on '
xz-native:do_populate_sysroot'

Quoted 6 lines
Quoted 3 lines

Re-reading the hunk it should better read:
import re
for (ext,tool) in [('xz','xz')]: # ('gz','gzip'),('bz','bzip2')

                                    ^

that will turn the rest into comment is that ok ?

I didn't try the other two, so yes, it's ok.
Feedback on doing the same for bzip2 is welcome but keep in mind that you _need_ gzip (or busybox with gz decompressor) on the host to unpack bzip2.tar.gz.

Quoted 15 lines
Quoted 7 lines

rex = re.compile('.*\.' + ext + '$')
if rex.match(srcuri):
depends = bb.data.getVarFlag('do_unpack', 'depends', d) or "" depends += ' ' + tool + '-native:do_populate_sysroot' bb.data.setVarFlag('do_unpack', 'depends', depends, d)

Quoted 6 lines
Quoted 3 lines

in general approach looks ok to me. It would be nice that while you are at it other packages which are needed early like git etc can use this approach as well.

Agree. One step at a time, let's first handle the unpackers though, k?

yes however I wanted to keep this in notice.

#11 lore raw

Re: [PATCH, RFC]: automatically depend xz compressed URIs on xz-native [was: Re: bitbake: staging of binary over symlink breaks sysroot (lzma x xz)]

Quoted 32 lines · Bernhard Reutner-Fischer
Quoted 31 lines · Khem Raj
Quoted 30 lines · Bernhard Reutner-Fischer
Quoted 14 lines · Khem Raj
Quoted 6 lines · Bernhard Reutner-Fischer
Quoted 3 lines · Bernhard Reutner-Fischer
Quoted 2 lines · Bernhard Reutner-Fischer
Quoted 1 line · Marco Cavallini

Stanislav Brabec ha scritto, Il 28/07/2010 11:30:

comments on the attached RFC patch?
TIA,

-snip-

Quoted 6 lines
classes/base.bbclass +0 -1
@@ -420,12 +424,16 @@ python () {
 
     # unzip-native should already be staged before unpacking ZIP recipes
     need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
 
Quoted 11 lines

classes/base.bbclass python () { · line 436

Quoted 10 lines
classes/base.bbclass +6 -1
-    if ".zip" in src_uri or need_unzip == "1":
+    if ".zip" in srcuri or need_unzip == "1":
         depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
         depends = depends + " unzip-native:do_populate_sysroot"
         bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    for ext in ['xz']: #['gzip', 'bzip2', 'xz']:
+        if '.' + ext in srcuri:
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + ext + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)

what does above hunk do.

srcuri=proto://some.thing.tar.xz
if ".xz" in srcuri then depend do_unpack on '
xz-native:do_populate_sysroot'

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Re-reading the hunk it should better read:
import re
for (ext,tool) in [('xz','xz')]: # ('gz','gzip'),('bz','bzip2')

                                    ^

that will turn the rest into comment is that ok ?

I didn't try the other two, so yes, it's ok.

Well, now that it's a tuple zip/unzip could go in there for sure, and we leave gz/gzip and bz/bzip2 commented out for now. Later we could add them, and put them into the default ASSUME_PROVIDED list in local.conf or something...

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#12 lore raw

PATCH 1/1 base.bbclass: depend unpacking on native unpackers

Automatically depend do_unpack on the corresponding native unpacker.

If your package's SRC_URIs do not contain unambiguous extensions or are misnamed (like .exe for ZIP'ed files) then add e.g.:
do_unpack[depends] += " unzip-native:do_populate_sysroot"

---
 classes/autotools.bbclass    |   17 ++++++++++++-----
 classes/base.bbclass         |   31 ++++++++++++++++---------------
 classes/native.bbclass       |    6 ++----
 recipes/xz/xz_4.999.9beta.bb |    5 ++++-
 4 files changed, 34 insertions(+), 25 deletions(-)
classes/autotools.bbclass +12 -5
index b2de2b1..b2901ff 100644
@@ -1,8 +1,14 @@
 # use autotools_stage_all for native packages
 AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
 
-def autotools_deps(d):
-	if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
+def autotools_deps(d, virtclass=None):
+	if virtclass:
+		virtclass_str = "_virtclass-%s" % (virtclass)
+	else:
+		virtclass_str = ""
+	if ((virtclass and bb.data.inherits_class(virtclass, d)) \
+	     or (virtclass is None)) \
+		and bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS' + virtclass_str, d, 1):
 		return ''
 
 	pn = bb.data.getVar('PN', d, 1)
@@ -17,7 +23,7 @@ def autotools_deps(d):
 		if not bb.data.inherits_class('native', d) \
                         and not bb.data.inherits_class('cross', d) \
                         and not bb.data.inherits_class('sdk', d) \
-                        and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
+                        and not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d, 1):
                     deps += 'libtool-cross '
 
 	return deps + 'gnu-config-native '
@@ -25,8 +31,8 @@ def autotools_deps(d):
 EXTRA_OEMAKE = ""
 
 DEPENDS_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-native_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d)}"
+DEPENDS_virtclass-native_prepend = "${@autotools_deps(d, 'native')}"
+DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d, 'nativesdk')}"
 
 inherit siteinfo
 
@@ -86,6 +92,7 @@ oe_runconf () {
 }
 
 autotools_do_configure() {
+	[ "x${INHIBIT_AUTORECONF}" = "x" ] &&
 	case ${PN} in
 	autoconf*)
 	;;
classes/base.bbclass +16 -15
index 1847491..c4bdece 100644
@@ -57,7 +57,11 @@ oe_runmake() {
 	${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
 }
 
-def base_deps(d):
+def base_deps(d, virtclass=None):
+	if virtclass:
+		virtclass_str = "_virtclass-%s" % (virtclass)
+	else:
+		virtclass_str = ""
 	#
 	# Ideally this will check a flag so we will operate properly in
 	# the case where host == build == target, for now we don't work in
@@ -71,7 +75,7 @@ def base_deps(d):
 	# INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
 	# we need that built is the responsibility of the patch function / class, not
 	# the application.
-	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
+	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d):
 		if (bb.data.getVar('HOST_SYS', d, 1) !=
 	     	    bb.data.getVar('BUILD_SYS', d, 1)):
 			deps += " virtual/${TARGET_PREFIX}gcc virtual/libc "
@@ -84,8 +88,8 @@ def base_deps(d):
 	return deps
 
 DEPENDS_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-native_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d)} "
+DEPENDS_virtclass-native_prepend="${@base_deps(d, 'native')} "
+DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d, 'nativesdk')} "
 
 
 SCENEFUNCS += "base_scenefunction"
@@ -374,26 +378,24 @@ do_build[func] = "1"
 
 python () {
     import exceptions
+    import re
 
     source_mirror_fetch = bb.data.getVar('SOURCE_MIRROR_FETCH', d, 0)
     if not source_mirror_fetch:
         need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1)
         if need_host:
-            import re
             this_host = bb.data.getVar('HOST_SYS', d, 1)
             if not re.match(need_host, this_host):
                 raise bb.parse.SkipPackage("incompatible with host %s" % this_host)
 
         need_machine = bb.data.getVar('COMPATIBLE_MACHINE', d, 1)
         if need_machine:
-            import re
             this_machine = bb.data.getVar('MACHINE', d, 1)
             if this_machine and not re.match(need_machine, this_machine):
                 raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine)
 
         need_target = bb.data.getVar('COMPATIBLE_TARGET_SYS', d, 1)
         if need_target:
-            import re
             this_target = bb.data.getVar('TARGET_SYS', d, 1)
             if this_target and not re.match(need_target, this_target):
                 raise bb.parse.SkipPackage("incompatible with target system %s" % this_target)
@@ -418,14 +420,13 @@ python () {
         depends = depends + " git-native:do_populate_sysroot"
         bb.data.setVarFlag('do_fetch', 'depends', depends, d)
 
-    # unzip-native should already be staged before unpacking ZIP recipes
-    need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
-
-    if ".zip" in src_uri or need_unzip == "1":
-        depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
-        depends = depends + " unzip-native:do_populate_sysroot"
-        bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    # Make sure that native unpackers are staged before trying to unpack
+    for (ext, tool) in [('xz','xz'),('zip','unzip')]:
+        rex = re.compile('\.' + ext + '($|;|\s)')
+        if rex.search(srcuri):
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + tool + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)
 
     # 'multimachine' handling
     mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
classes/native.bbclass +2 -4
index 345bd80..e38fe20 100644
@@ -88,8 +88,7 @@ PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
 PKG_CONFIG_SYSROOT_DIR = ""
 
 ORIG_DEPENDS := "${DEPENDS}"
-
-DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+DEPENDS_virtclass-native ?= "${@base_conditional('INHIBIT_DEFAULT_DEPS_virtclass-native', '1', '', '${ORIG_DEPENDS}', d)}"
 
 def native_virtclass_add_override(d):
     if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
@@ -117,7 +116,6 @@ python __anonymous () {
             if dep.endswith("-cross"):
                 newdeps.append(dep.replace("-cross", "-native"))
             elif not dep.endswith("-native"):
-     
                 newdeps.append(dep + "-native")
             else:
                 newdeps.append(dep)
@@ -127,8 +125,8 @@ python __anonymous () {
             if prov.find(pn) != -1:
                 continue
             if not prov.endswith("-native"):
-    
                 provides = provides.replace(prov, prov + "-native")
         bb.data.setVar("PROVIDES", provides, d)
+        bb.data.setVar("INHIBIT_AUTORECONF", bb.data.getVar("INHIBIT_AUTORECONF_virtclass-native", d, True), d)
 }
 
recipes/xz/xz_4.999.9beta.bb +4 -1
index 8733023..fe49412 100644
@@ -1,5 +1,8 @@
+INHIBIT_AUTOTOOLS_DEPS_virtclass-native = "1"
+INHIBIT_DEFAULT_DEPS_virtclass-native = "1"
+INHIBIT_AUTORECONF_virtclass-native = "1"
 require xz.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.bz2;name=xz"
 SRC_URI[xz.md5sum] = "cc4044fcc073b8bcf3164d1d0df82161"
 SRC_URI[xz.sha256sum] = "330312c4397608d8b7be362cc7edbfeafa6101614bc2164d816ea767656aa15c"
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#13 lore raw

Re: [PATCH] base.bbclass: depend unpacking on native unpackers

Quoted 7 lines · Bernhard Reutner-Fischer

Automatically depend do_unpack on the corresponding native unpacker.

If your package's SRC_URIs do not contain unambiguous extensions or are misnamed (like .exe for ZIP'ed files) then add e.g.:
do_unpack[depends] += " unzip-native:do_populate_sysroot"

Quoted 197 lines
---
 classes/autotools.bbclass    |   17 ++++++++++++-----
 classes/base.bbclass         |   31 ++++++++++++++++---------------
 classes/native.bbclass       |    6 ++----
 recipes/xz/xz_4.999.9beta.bb |    5 ++++-
 4 files changed, 34 insertions(+), 25 deletions(-)
classes/autotools.bbclass +12 -5
index b2de2b1..b2901ff 100644
@@ -1,8 +1,14 @@
 # use autotools_stage_all for native packages
 AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
 
-def autotools_deps(d):
-	if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
+def autotools_deps(d, virtclass=None):
+	if virtclass:
+		virtclass_str = "_virtclass-%s" % (virtclass)
+	else:
+		virtclass_str = ""
+	if ((virtclass and bb.data.inherits_class(virtclass, d)) \
+	     or (virtclass is None)) \
+		and bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS' + virtclass_str, d, 1):
 		return ''
 
 	pn = bb.data.getVar('PN', d, 1)
@@ -17,7 +23,7 @@ def autotools_deps(d):
 		if not bb.data.inherits_class('native', d) \
                         and not bb.data.inherits_class('cross', d) \
                         and not bb.data.inherits_class('sdk', d) \
-                        and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
+                        and not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d, 1):
                     deps += 'libtool-cross '
 
 	return deps + 'gnu-config-native '
@@ -25,8 +31,8 @@ def autotools_deps(d):
 EXTRA_OEMAKE = ""
 
 DEPENDS_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-native_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d)}"
+DEPENDS_virtclass-native_prepend = "${@autotools_deps(d, 'native')}"
+DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d, 'nativesdk')}"
 
 inherit siteinfo
 
@@ -86,6 +92,7 @@ oe_runconf () {
 }
 
 autotools_do_configure() {
+	[ "x${INHIBIT_AUTORECONF}" = "x" ] &&
 	case ${PN} in
 	autoconf*)
 	;;
classes/base.bbclass +16 -15
index 1847491..c4bdece 100644
@@ -57,7 +57,11 @@ oe_runmake() {
 	${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
 }
 
-def base_deps(d):
+def base_deps(d, virtclass=None):
+	if virtclass:
+		virtclass_str = "_virtclass-%s" % (virtclass)
+	else:
+		virtclass_str = ""
 	#
 	# Ideally this will check a flag so we will operate properly in
 	# the case where host == build == target, for now we don't work in
@@ -71,7 +75,7 @@ def base_deps(d):
 	# INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
 	# we need that built is the responsibility of the patch function / class, not
 	# the application.
-	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
+	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d):
 		if (bb.data.getVar('HOST_SYS', d, 1) !=
 	     	    bb.data.getVar('BUILD_SYS', d, 1)):
 			deps += " virtual/${TARGET_PREFIX}gcc virtual/libc "
@@ -84,8 +88,8 @@ def base_deps(d):
 	return deps
 
 DEPENDS_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-native_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d)} "
+DEPENDS_virtclass-native_prepend="${@base_deps(d, 'native')} "
+DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d, 'nativesdk')} "
 
 
 SCENEFUNCS += "base_scenefunction"
@@ -374,26 +378,24 @@ do_build[func] = "1"
 
 python () {
     import exceptions
+    import re
 
     source_mirror_fetch = bb.data.getVar('SOURCE_MIRROR_FETCH', d, 0)
     if not source_mirror_fetch:
         need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1)
         if need_host:
-            import re
             this_host = bb.data.getVar('HOST_SYS', d, 1)
             if not re.match(need_host, this_host):
                 raise bb.parse.SkipPackage("incompatible with host %s" % this_host)
 
         need_machine = bb.data.getVar('COMPATIBLE_MACHINE', d, 1)
         if need_machine:
-            import re
             this_machine = bb.data.getVar('MACHINE', d, 1)
             if this_machine and not re.match(need_machine, this_machine):
                 raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine)
 
         need_target = bb.data.getVar('COMPATIBLE_TARGET_SYS', d, 1)
         if need_target:
-            import re
             this_target = bb.data.getVar('TARGET_SYS', d, 1)
             if this_target and not re.match(need_target, this_target):
                 raise bb.parse.SkipPackage("incompatible with target system %s" % this_target)
@@ -418,14 +420,13 @@ python () {
         depends = depends + " git-native:do_populate_sysroot"
         bb.data.setVarFlag('do_fetch', 'depends', depends, d)
 
-    # unzip-native should already be staged before unpacking ZIP recipes
-    need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
-    src_uri = bb.data.getVar('SRC_URI', d, 1)
-
-    if ".zip" in src_uri or need_unzip == "1":
-        depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
-        depends = depends + " unzip-native:do_populate_sysroot"
-        bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+    # Make sure that native unpackers are staged before trying to unpack
+    for (ext, tool) in [('xz','xz'),('zip','unzip')]:
+        rex = re.compile('\.' + ext + '($|;|\s)')
+        if rex.search(srcuri):
+            depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+            depends += ' ' + tool + '-native:do_populate_sysroot'
+            bb.data.setVarFlag('do_unpack', 'depends', depends, d)
 
     # 'multimachine' handling
     mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
classes/native.bbclass +2 -4
index 345bd80..e38fe20 100644
@@ -88,8 +88,7 @@ PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
 PKG_CONFIG_SYSROOT_DIR = ""
 
 ORIG_DEPENDS := "${DEPENDS}"
-
-DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+DEPENDS_virtclass-native ?= "${@base_conditional('INHIBIT_DEFAULT_DEPS_virtclass-native', '1', '', '${ORIG_DEPENDS}', d)}"
 
 def native_virtclass_add_override(d):
     if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
@@ -117,7 +116,6 @@ python __anonymous () {
             if dep.endswith("-cross"):
                 newdeps.append(dep.replace("-cross", "-native"))
             elif not dep.endswith("-native"):
-     
                 newdeps.append(dep + "-native")
             else:
                 newdeps.append(dep)
@@ -127,8 +125,8 @@ python __anonymous () {
             if prov.find(pn) != -1:
                 continue
             if not prov.endswith("-native"):
-    
                 provides = provides.replace(prov, prov + "-native")
         bb.data.setVar("PROVIDES", provides, d)
+        bb.data.setVar("INHIBIT_AUTORECONF", bb.data.getVar("INHIBIT_AUTORECONF_virtclass-native", d, True), d)
 }
 
recipes/xz/xz_4.999.9beta.bb +4 -1
index 8733023..fe49412 100644
@@ -1,5 +1,8 @@
+INHIBIT_AUTOTOOLS_DEPS_virtclass-native = "1"
+INHIBIT_DEFAULT_DEPS_virtclass-native = "1"
+INHIBIT_AUTORECONF_virtclass-native = "1"
 require xz.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.bz2;name=xz"
 SRC_URI[xz.md5sum] = "cc4044fcc073b8bcf3164d1d0df82161"
 SRC_URI[xz.sha256sum] = "330312c4397608d8b7be362cc7edbfeafa6101614bc2164d816ea767656aa15c"
Signature · 7 lines
1.7.1


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel