Skip to contentSkip to conversation

DEPENDS not extended to -native for BBCLASSEXTENDS when added by PACKAGECONFIG

PATCH New Martin Jansa 1 participant 5 messages Feb 14, 2012 – Mar 16, 2012

lore
Share & tools
lore
#0 lore raw

oe-core gtk+ has:

X11DEPENDS = "virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite" DEPENDS = "glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native \
libgcrypt cairo gdk-pixbuf"
PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}"

meta-oe adds BBCLASSEXTEND = "native" because gtk+-native-2* is needed for gtk+3 to build:
http://git.openembedded.org/meta-openembedded/commit/?id=a4155ac38dce214cbb59f6243b29ca3df76e0d29

I would expect that all dependencies added by x11 PACKAGECONFIG will be expanded to -native variants like for every other dependency, but it's not true:

gtk-native.env:X11DEPENDS="virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
gtk-native.env:# DEPENDS=pkgconfig-native ${@autotools_dep_prepend(d)}${BASEDEPENDS} glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native ${X11DEPENDS} gtk-gative.env:DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native gnu-config-native glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

gtk-target.env:X11DEPENDS="virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
gtk-target.env:# DEPENDS=pkgconfig-native ${@autotools_dep_prepend(d)}${BASEDEPENDS} glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf ${X11DEPENDS}
gtk-target.env:DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native libtool-cross gnu-config-native virtual/arm-oe-linux-gnueabi-gcc virtual/arm-oe-linux-gnueabi-compilerlibs virtual/libc glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

And gtk+-native builds fails to configure because of missing libxrender-native (libx11-native is built by something else probably).

configure:23318: checking for XOpenDisplay
configure:23318: gcc -o conftest -DGDK_PIXBUF_DISABLE_DEPRECATED -isystem/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include -O2 -pipe -Wall -isystem/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -L/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -L/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-rpath-link,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-rpath,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-O1 conftest.c -lXext -lXrender -lX11 >&5
/usr/bin/ld: cannot find -lXrender
collect2: ld returned 1 exit status
configure:23318: $? = 1
configure: failed program was:
...
configure:23318: result: no
configure:23322: error: *** libX11 not found. Check 'config.log' for more details.

Regards,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#1 lore raw
Quoted 34 lines · Martin Jansa

oe-core gtk+ has:

X11DEPENDS = "virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite" DEPENDS = "glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native \
libgcrypt cairo gdk-pixbuf"
PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}"

meta-oe adds BBCLASSEXTEND = "native" because gtk+-native-2* is needed for gtk+3 to build:
http://git.openembedded.org/meta-openembedded/commit/?id=a4155ac38dce214cbb59f6243b29ca3df76e0d29

I would expect that all dependencies added by x11 PACKAGECONFIG will be expanded to -native variants like for every other dependency, but it's not true:

gtk-native.env:X11DEPENDS="virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
gtk-native.env:# DEPENDS=pkgconfig-native ${@autotools_dep_prepend(d)}${BASEDEPENDS} glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native ${X11DEPENDS} gtk-gative.env:DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native gnu-config-native glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

gtk-target.env:X11DEPENDS="virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
gtk-target.env:# DEPENDS=pkgconfig-native ${@autotools_dep_prepend(d)}${BASEDEPENDS} glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf ${X11DEPENDS}
gtk-target.env:DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native libtool-cross gnu-config-native virtual/arm-oe-linux-gnueabi-gcc virtual/arm-oe-linux-gnueabi-compilerlibs virtual/libc glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

And gtk+-native builds fails to configure because of missing libxrender-native (libx11-native is built by something else probably).

configure:23318: checking for XOpenDisplay
configure:23318: gcc -o conftest -DGDK_PIXBUF_DISABLE_DEPRECATED -isystem/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include -O2 -pipe -Wall -isystem/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -L/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -L/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-rpath-link,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-rpath,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-O1 conftest.c -lXext -lXrender -lX11 >&5
/usr/bin/ld: cannot find -lXrender
collect2: ld returned 1 exit status
configure:23318: $? = 1
configure: failed program was:
...
configure:23318: result: no
configure:23322: error: *** libX11 not found. Check 'config.log' for more details.

Quoted 1 line

Regards,

any idea about this? I'm tired of building virtual/libx11-native and libxrender-native manually after each gtk+-native build error :/.

Yes I can fix it in gtk+ bbappend by repeating PACKAGECONFIG/DISTRO_FEATURES logic fog DEPENDS_virtclass-native, but this seems like bug in PACKAGECONFIG handling and could be in more recipes.

Cheers,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
Quoted 37 lines · Martin Jansa
Quoted 34 lines · Martin Jansa

oe-core gtk+ has:

X11DEPENDS = "virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite" DEPENDS = "glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native \
libgcrypt cairo gdk-pixbuf"
PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}"

meta-oe adds BBCLASSEXTEND = "native" because gtk+-native-2* is needed for gtk+3 to build:
http://git.openembedded.org/meta-openembedded/commit/?id=a4155ac38dce214cbb59f6243b29ca3df76e0d29

I would expect that all dependencies added by x11 PACKAGECONFIG will be expanded to -native variants like for every other dependency, but it's not true:

gtk-native.env:X11DEPENDS="virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
gtk-native.env:# DEPENDS=pkgconfig-native ${@autotools_dep_prepend(d)}${BASEDEPENDS} glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native ${X11DEPENDS} gtk-gative.env:DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native gnu-config-native glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

gtk-target.env:X11DEPENDS="virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
gtk-target.env:# DEPENDS=pkgconfig-native ${@autotools_dep_prepend(d)}${BASEDEPENDS} glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf ${X11DEPENDS}
gtk-target.env:DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native libtool-cross gnu-config-native virtual/arm-oe-linux-gnueabi-gcc virtual/arm-oe-linux-gnueabi-compilerlibs virtual/libc glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

And gtk+-native builds fails to configure because of missing libxrender-native (libx11-native is built by something else probably).

configure:23318: checking for XOpenDisplay
configure:23318: gcc -o conftest -DGDK_PIXBUF_DISABLE_DEPRECATED -isystem/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include -O2 -pipe -Wall -isystem/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -L/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -L/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-rpath-link,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-rpath,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-O1 conftest.c -lXext -lXrender -lX11 >&5
/usr/bin/ld: cannot find -lXrender
collect2: ld returned 1 exit status
configure:23318: $? = 1
configure: failed program was:
...
configure:23318: result: no
configure:23322: error: *** libX11 not found. Check 'config.log' for more details.

Quoted 1 line

Regards,

Quoted 7 lines

any idea about this? I'm tired of building virtual/libx11-native and libxrender-native manually after each gtk+-native build error :/.

Yes I can fix it in gtk+ bbappend by repeating PACKAGECONFIG/DISTRO_FEATURES logic fog DEPENDS_virtclass-native, but this seems like bug in PACKAGECONFIG handling and could be in more recipes.

I've added bb.error to PACKAGECONFIG handling and virtclass-native handler and PACKAGECONFIG is executed _always_ after virtclass-native (or nativesdk), so all dependencies added by PACKAGECONFIG are not available for virtclass-native handler to process.

With tmp-eglibc/cache removed to force reparse of all recipes I have
this order of handlers:
OE qemux86-64@ ~/oe-core $ grep "\(cairo\)\|\(gtk+\)\|\(libsdl\)\|\(pango\)\|\(xserver-xorg\)" log
ERROR: Executing virtclass-native handle for gtk+
ERROR: Executing PACKAGECONFIG handle for gtk+
ERROR: Executing virtclass-native handle for gtk+-native
ERROR: Executing PACKAGECONFIG handle for gtk+-native
ERROR: Executing virtclass-native handle for gtk+
ERROR: Executing PACKAGECONFIG handle for gtk+
ERROR: Executing virtclass-native handle for gtk+
ERROR: Executing PACKAGECONFIG handle for gtk+
ERROR: Executing virtclass-native handle for libsdl
ERROR: Executing PACKAGECONFIG handle for libsdl
ERROR: Executing virtclass-native handle for libsdl-nativesdk
ERROR: Executing PACKAGECONFIG handle for libsdl-nativesdk
ERROR: Executing virtclass-native handle for pango
ERROR: Executing PACKAGECONFIG handle for pango
ERROR: Executing virtclass-native handle for pango-native
ERROR: Executing PACKAGECONFIG handle for pango-native
ERROR: Executing virtclass-native handle for cairo
ERROR: Executing PACKAGECONFIG handle for cairo
ERROR: Executing virtclass-native handle for cairo-native
ERROR: Executing PACKAGECONFIG handle for cairo-native
ERROR: Executing virtclass-native handle for xserver-xorg
ERROR: Executing PACKAGECONFIG handle for xserver-xorg
ERROR: Executing virtclass-native handle for xserver-xorg-lite
ERROR: Executing PACKAGECONFIG handle for xserver-xorg-lite
ERROR: Executing virtclass-native handle for python-pycairo
ERROR: Executing PACKAGECONFIG handle for gtk+
ERROR: Executing virtclass-native handle for gtk+-native
ERROR: Executing PACKAGECONFIG handle for gtk+-native
ERROR: Executing virtclass-native handle for pango
ERROR: Executing PACKAGECONFIG handle for pango
ERROR: Executing virtclass-native handle for pango-native
ERROR: Executing PACKAGECONFIG handle for pango-native
ERROR: Executing virtclass-native handle for cairo
ERROR: Executing PACKAGECONFIG handle for cairo
ERROR: Executing virtclass-native handle for cairo-native
ERROR: Executing PACKAGECONFIG handle for cairo-native
ERROR: Executing virtclass-native handle for pango
ERROR: Executing PACKAGECONFIG handle for pango
ERROR: Executing virtclass-native handle for cairo
ERROR: Executing PACKAGECONFIG handle for cairo

Can we convert PACKAGECONFIG from anonymous python function in base.bbclass to handler like native is and somehow define order of handlers (like with addtask)?

Cheers,

Quoted 5 lines

Cheers,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw
In reply to Martin Jansa
Quoted 18 lines · Martin Jansa

oe-core gtk+ has:

X11DEPENDS = "virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite" DEPENDS = "glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native \
libgcrypt cairo gdk-pixbuf"
PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}"

meta-oe adds BBCLASSEXTEND = "native" because gtk+-native-2* is needed for gtk+3 to build:
http://git.openembedded.org/meta-openembedded/commit/?id=a4155ac38dce214cbb59f6243b29ca3df76e0d29

I would expect that all dependencies added by x11 PACKAGECONFIG will be expanded to -native variants like for every other dependency, but it's not true:

gtk-native.env:X11DEPENDS="virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
gtk-native.env:# DEPENDS=pkgconfig-native ${@autotools_dep_prepend(d)}${BASEDEPENDS} glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native ${X11DEPENDS} gtk-gative.env:DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native gnu-config-native glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

Quoted 5 lines

gtk-target.env:X11DEPENDS="virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
gtk-target.env:# DEPENDS=pkgconfig-native ${@autotools_dep_prepend(d)}${BASEDEPENDS} glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf ${X11DEPENDS}
gtk-target.env:DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native libtool-cross gnu-config-native virtual/arm-oe-linux-gnueabi-gcc virtual/arm-oe-linux-gnueabi-compilerlibs virtual/libc glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

And gtk+-native builds fails to configure because of missing libxrender-native (libx11-native is built by something else probably).

Following patch fixes this case for me

OE om-gta02@shr ~/shr-core $ grep ^DEPENDS= gtk+-native.env3 DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native gnu-config-native glib-2.0-native pango-native atk-native jpeg-native libpng-native gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt-native cairo-native gdk-pixbuf-native virtual/libx11-native libxrender-native virtual/libx11-native libxext-native libxcursor-native libxrandr-native libxdamage-native libxrender-native libxcomposite-native"
OE om-gta02@shr ~/shr-core $ grep ^DEPENDS= gtk+.env3 DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native libtool-cross gnu-config-native virtual/arm-oe-linux-gnueabi-gcc virtual/arm-oe-linux-gnueabi-compilerlibs virtual/libc glib-2.0 pango atk jpeg libpng gtk-doc-native gdk-pixbuf-native docbook-utils-native libgcrypt cairo gdk-pixbuf virtual/libx11-native libxrender-native virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"

But it's harder to do e.g.

DEPENDS_virtclass-native = "some smaller set of only really needed foo and bar"

so even with only libx11-native and libxrender really mandatory depends (configure failing without them), I had to add few more BBCLASSEXTENDs:

#       new file:   meta-oe/recipes-graphics/xorg-lib/libxcomposite_0.4.3.bbappend
#       new file:   meta-oe/recipes-graphics/xorg-lib/libxcursor_1.1.12.bbappend
#       new file:   meta-oe/recipes-graphics/xorg-lib/libxdamage_1.1.3.bbappend
#       new file:   meta-oe/recipes-graphics/xorg-lib/libxfixes_5.0.bbappend
#       new file:   meta-oe/recipes-graphics/xorg-lib/libxrandr_1.3.2.bbappend
#       new file:   meta-oe/recipes-graphics/xorg-proto/compositeproto_0.4.2.bbappend
#       new file:   meta-oe/recipes-graphics/xorg-proto/damageproto_1.2.1.bbappend
#       new file:   meta-oe/recipes-graphics/xorg-proto/fixesproto_5.0.bbappend
#       new file:   meta-oe/recipes-graphics/xorg-proto/randrproto_1.3.2.bbappend

I'll probably send adding those BBCLASSEXTENDs to oe-core directly instead of meta-oe because with more .bbappends in meta-oe it will be harder to upgrade oe-core versions.

Cheers,

Quoted 15 lines

configure:23318: checking for XOpenDisplay
configure:23318: gcc -o conftest -DGDK_PIXBUF_DISABLE_DEPRECATED -isystem/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include -O2 -pipe -Wall -isystem/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -L/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -L/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-rpath-link,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-rpath,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/var/lib/jenkins/jobs/shr-core/workspace/shr-core/tmp-eglibc/sysroots/x86_64-linux/lib -Wl,-O1 conftest.c -lXext -lXrender -lX11 >&5
/usr/bin/ld: cannot find -lXrender
collect2: ld returned 1 exit status
configure:23318: $? = 1
configure: failed program was:
...
configure:23318: result: no
configure:23322: error: *** libX11 not found. Check 'config.log' for more details.

Regards,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#4 lore raw

PATCH 1/1 base.bbclass: extract *virtclass_map_dependencies logic from native/nativesdk bbclasses and call it from packageconfig

* if some package is using PACKAGECONFIG and also BBCLASSEXTEND then it could be called twice but without this PACKAGECONFIG was adding items to DEPENDS after virtclass handler so foo-native was depending on bar instead of bar-foo when bar was added by PACKAGECONFIG
see: http://lists.linuxtogo.org/pipermail/openembedded-core/2012-February/017772.html

---
 meta/classes/base.bbclass      |   77 ++++++++++++++++++++++++++++++++++++---
 meta/classes/native.bbclass    |   25 +------------
 meta/classes/nativesdk.bbclass |   27 +-------------
 3 files changed, 73 insertions(+), 56 deletions(-)
meta/classes/base.bbclass +71 -6
index c8ed544..14efa16 100644
@@ -223,6 +223,59 @@ def get_layers_branch_rev(d):
 			s1= layers_branch_rev[i][p1:]
 	return layers_branch_rev
 
+def native_virtclass_map_dependencies(d):
+    def map_dependencies(varname, d, suffix = ""):
+        if suffix:
+            varname = varname + "_" + suffix
+        deps = d.getVar(varname, True)
+        if not deps:
+            return
+        deps = bb.utils.explode_deps(deps)
+        newdeps = []
+        for dep in deps:
+            if dep.endswith("-cross"):
+                newdeps.append(dep.replace("-cross", "-native"))
+            elif not dep.endswith("-native"):
+                newdeps.append(dep + "-native")
+            else:
+                newdeps.append(dep)
+        d.setVar(varname, " ".join(newdeps))
+
+    map_dependencies("DEPENDS", d)
+    for pkg in [d.getVar("PN", True), "", "${PN}"]:
+        map_dependencies("RDEPENDS", d, pkg)
+        map_dependencies("RRECOMMENDS", d, pkg)
+        map_dependencies("RSUGGESTS", d, pkg)
+        map_dependencies("RPROVIDES", d, pkg)
+        map_dependencies("RREPLACES", d, pkg)
+
+def nativesdk_virtclass_map_dependencies(d):
+    def map_dependencies(varname, d, suffix = ""):
+        if suffix:
+            varname = varname + "_" + suffix
+        deps = d.getVar(varname, True)
+        if not deps:
+            return
+        deps = bb.utils.explode_deps(deps)
+        newdeps = []
+        for dep in deps:
+            if dep.endswith("-native") or dep.endswith("-cross"):
+                newdeps.append(dep)
+            elif dep.endswith("-gcc-intermediate") or dep.endswith("-gcc-initial") or dep.endswith("-gcc") or dep.endswith("-g++"):
+                newdeps.append(dep + "-crosssdk")
+            elif not dep.endswith("-nativesdk"):
+                newdeps.append(dep.replace("-nativesdk", "") + "-nativesdk")
+            else:
+                newdeps.append(dep)
+        d.setVar(varname, " ".join(newdeps))
+
+    map_dependencies("DEPENDS", d)
+    #for pkg in (d.getVar("PACKAGES", True).split() + [""]):
+    #    map_dependencies("RDEPENDS", d, pkg)
+    #    map_dependencies("RRECOMMENDS", d, pkg)
+    #    map_dependencies("RSUGGESTS", d, pkg)
+    #    map_dependencies("RPROVIDES", d, pkg)
+    #    map_dependencies("RREPLACES", d, pkg)
 
 addhandler base_eventhandler
 python base_eventhandler() {
@@ -293,8 +346,10 @@ do_build () {
 	:
 }
 
-python () {
-    import exceptions, string, re
+addhandler packageconfig_handler
+python packageconfig_handler () {
+    if not isinstance(e, bb.event.RecipePreFinalise):
+            return
 
     # Handle PACKAGECONFIG
     #
@@ -302,14 +357,14 @@ python () {
     #
     # PACKAGECONFIG ?? = "<default options>"
     # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends"
-    pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
+    pkgconfigflags = e.data.getVarFlags("PACKAGECONFIG") or {}
     if pkgconfigflags:
-        pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+        pkgconfig = (e.data.getVar('PACKAGECONFIG', True) or "").split()
         def appendVar(varname, appends):
             if not appends:
                 return
-            varname = d.expand(varname)
-            d.appendVar(varname, " " + " ".join(appends))
+            varname = e.data.expand(varname)
+            e.data.appendVar(varname, " " + " ".join(appends))
 
         extradeps = []
         extrardeps = []
@@ -332,6 +387,16 @@ python () {
         appendVar('DEPENDS', extradeps)
         appendVar('RDEPENDS_${PN}', extrardeps)
         appendVar('EXTRA_OECONF', extraconf)
+        classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
+        pn = e.data.getVar("PN", True)
+        if "native" in classextend and pn.endswith("-native"):
+            native_virtclass_map_dependencies(e.data)
+        if "nativesdk" in classextend and pn.endswith("-nativesdk"):
+            nativesdk_virtclass_map_dependencies(e.data)
+}
+
+python () {
+    import exceptions, string, re
 
     # If PRINC is set, try and increase the PR value by the amount specified
     princ = d.getVar('PRINC', True)
meta/classes/native.bbclass +1 -24
index 00196ba..2bf8e6d 100644
@@ -109,30 +109,7 @@ python native_virtclass_handler () {
     if not pn.endswith("-native"):
         return
 
-    def map_dependencies(varname, d, suffix = ""):
-        if suffix:
-            varname = varname + "_" + suffix
-        deps = d.getVar(varname, True)
-        if not deps:
-            return
-        deps = bb.utils.explode_deps(deps)
-        newdeps = []
-        for dep in deps:
-            if dep.endswith("-cross"):
-                newdeps.append(dep.replace("-cross", "-native"))
-            elif not dep.endswith("-native"):
-                newdeps.append(dep + "-native")
-            else:
-                newdeps.append(dep)
-        d.setVar(varname, " ".join(newdeps))
-
-    map_dependencies("DEPENDS", e.data)
-    for pkg in [e.data.getVar("PN", True), "", "${PN}"]:
-        map_dependencies("RDEPENDS", e.data, pkg)
-        map_dependencies("RRECOMMENDS", e.data, pkg)
-        map_dependencies("RSUGGESTS", e.data, pkg)
-        map_dependencies("RPROVIDES", e.data, pkg)
-        map_dependencies("RREPLACES", e.data, pkg)
+    native_virtclass_map_dependencies(e.data)
 
     provides = e.data.getVar("PROVIDES", True)
     for prov in provides.split():
meta/classes/nativesdk.bbclass +1 -26
index ceec53e..af8f9ef 100644
@@ -72,32 +72,7 @@ python () {
     if not pn.endswith("-nativesdk"):
         return
 
-    def map_dependencies(varname, d, suffix = ""):
-        if suffix:
-            varname = varname + "_" + suffix
-        deps = d.getVar(varname, True)
-        if not deps:
-            return
-        deps = bb.utils.explode_deps(deps)
-        newdeps = []
-        for dep in deps:
-            if dep.endswith("-native") or dep.endswith("-cross"):
-                newdeps.append(dep)
-            elif dep.endswith("-gcc-intermediate") or dep.endswith("-gcc-initial") or dep.endswith("-gcc") or dep.endswith("-g++"):
-                newdeps.append(dep + "-crosssdk")
-            elif not dep.endswith("-nativesdk"):
-                newdeps.append(dep.replace("-nativesdk", "") + "-nativesdk")
-            else:
-                newdeps.append(dep)
-        d.setVar(varname, " ".join(newdeps))
-
-    map_dependencies("DEPENDS", d)
-    #for pkg in (d.getVar("PACKAGES", True).split() + [""]):
-    #    map_dependencies("RDEPENDS", d, pkg)
-    #    map_dependencies("RRECOMMENDS", d, pkg)
-    #    map_dependencies("RSUGGESTS", d, pkg)
-    #    map_dependencies("RPROVIDES", d, pkg)
-    #    map_dependencies("RREPLACES", d, pkg)
+    nativesdk_virtclass_map_dependencies(d)
 
     provides = d.getVar("PROVIDES", True)
     for prov in provides.split():
Signature · 1 line
1.7.8.5