Skip to contentSkip to conversation

waf.bbclass: explicitly pass bindir and libdir if supported

PATCH In review Stefan Agner 2 participants 2 messages Dec 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 waf.bbclass: explicitly pass bindir and libdir if supported

From: Stefan Agner <[email protected]>

On some build hosts distros (e.g. Fedora 26) waf tries to be
smart about libdir detection and defaults to [EXEC_PREFIX/lib64].
This obviously is not what we want for 32-bit targets and usually
fails in the do_package phase:
WARNING: gstreamer1.0-plugins-imx-0.13.0-r0 do_package: QA Issue: gstreamer1.0-plugins-imx: Files/directories were installed but not shipped in any package:

    /usr/lib64/libgstimxcommon.so.0
    ...

Depending on version, waf knows prefix or prefix, bindir and libdir as default options. Explicitly pass the right set of arguments.

---
 meta/classes/waf.bbclass | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
meta/classes/waf.bbclass +16 -1
index c4698e910a..acbda278a2 100644
@@ -25,8 +25,23 @@ def get_waf_parallel_make(d):
 
     return ""
 
+python waf_preconfigure() {
+    from distutils.version import StrictVersion
+    srcsubdir = d.getVar('S')
+    wafbin = os.path.join(srcsubdir, 'waf')
+    status, result = oe.utils.getstatusoutput(wafbin + " --version")
+    if status != 0:
+        bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % status)
+        return
+    version = result.split()[1]
+    if StrictVersion(version) >= StrictVersion("1.8.7"):
+        d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
+}
+
+do_configure[prefuncs] += "waf_preconfigure"
+
 waf_do_configure() {
-	${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
+	${S}/waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF}
 }
 
 waf_do_compile()  {
Signature · 1 line
2.13.6
#1 lore raw
Quoted 7 lines · Stefan Agner

From: Stefan Agner <[email protected]>

On some build hosts distros (e.g. Fedora 26) waf tries to be
smart about libdir detection and defaults to [EXEC_PREFIX/lib64].
This obviously is not what we want for 32-bit targets and usually
fails in the do_package phase:
WARNING: gstreamer1.0-plugins-imx-0.13.0-r0 do_package: QA Issue: gstreamer1.0-plugins-imx: Files/directories were installed but not shipped in any package:

Quoted 8 lines
    /usr/lib64/libgstimxcommon.so.0
    ...

Depending on version, waf knows prefix or prefix, bindir and libdir as default options. Explicitly pass the right set of arguments.

I think it is the best we can do for now. Anything fancier than this is risky and would not be possible to be backported.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750