[OE-core] [oe-core][PATCH 2/7] python3: fix file conflict when multilib enabled

Zhang Xiao xiao.zhang at windriver.com
Mon Mar 12 09:12:58 UTC 2018


Config file python3.5m-config conflicts between 32 and 64 bit packages.
Use update-alternatives to add base_libdir as suffix to avoid it.

Signed-off-by: Zhang Xiao <xiao.zhang at windriver.com>
---
 meta/recipes-devtools/python/python3_3.5.4.bb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/python/python3_3.5.4.bb b/meta/recipes-devtools/python/python3_3.5.4.bb
index a94d0096f1..7544e3318c 100644
--- a/meta/recipes-devtools/python/python3_3.5.4.bb
+++ b/meta/recipes-devtools/python/python3_3.5.4.bb
@@ -48,7 +48,13 @@ UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
 
 S = "${WORKDIR}/Python-${PV}"
 
-inherit autotools multilib_header python3native pkgconfig
+inherit autotools multilib_header python3native pkgconfig update-alternatives
+
+MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}"
+
+ALTERNATIVE_${PN}-core = "python3.5m-config"
+ALTERNATIVE_LINK_NAME[python3.5m-config] = "${bindir}/python3.5m-config"
+ALTERNATIVE_TARGET[python3.5m-config] = "${bindir}/python3.5m-config-${MULTILIB_SUFFIX}"
 
 CONFIGUREOPTS += " --with-system-ffi "
 
@@ -204,6 +210,8 @@ py_package_preprocess () {
 	${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \
 	     -c "from py_compile import compile; compile('./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py', optimize=2)"
 	cd -
+
+	mv ${PKGD}/${bindir}/python3.5m-config ${PKGD}/${bindir}/python3.5m-config-${MULTILIB_SUFFIX}
 }
 
 # manual dependency additions
-- 
2.11.0




More information about the Openembedded-core mailing list