Skip to contentSkip to conversation

meta-python: make python-chardet coexist for both python2 and python3

PATCH In review Dima Zavin 2 participants 3 messages Aug 2, 2018 – Aug 5, 2018

lore
Share & tools
lore

Dima Zavin

author
#0 lore raw

PATCH 1/1 meta-python: make python-chardet coexist for both python2 and python3

---
 meta-python/recipes-devtools/python/python-chardet.inc | 7 +++++++
 1 file changed, 7 insertions(+)
meta-python/recipes-devtools/python/python-chardet.inc +7 -0
index 246a65aa6..1a85e7410 100644
@@ -22,3 +22,10 @@ RDEPENDS_${PN}_class-target += " \
     ${PYTHON_PN}-argparse \
     ${PYTHON_PN}-logging \
 "
+
+do_install_append () {
+    maj_ver=$(echo ${PYTHON_BASEVERSION} | cut -d . -f 1)
+    if [ "$maj_ver" == "3" ] ; then
+        mv ${D}${bindir}/chardetect ${D}${bindir}/chardetect3
+    fi
+}
Signature · 1 line
2.18.0.597.ga71716f1ad-goog
#1 lore raw

Hi Dima

Quoted 11 lines · Dima Zavin
---
 meta-python/recipes-devtools/python/python-chardet.inc | 7 +++++++
 1 file changed, 7 insertions(+)
meta-python/recipes-devtools/python/python-chardet.inc +0 -0
index 246a65aa6..1a85e7410 100644

meta-python/recipes-devtools/python/python-chardet.inc RDEPENDS_${PN}_class-target += " \ · line 31

Quoted 10 lines
meta-python/recipes-devtools/python/python-chardet.inc +7 -0
@@ -22,3 +22,10 @@ RDEPENDS_${PN}_class-target += " \
     ${PYTHON_PN}-argparse \
     ${PYTHON_PN}-logging \
 "
+
+do_install_append () {
+    maj_ver=$(echo ${PYTHON_BASEVERSION} | cut -d . -f 1)
+    if [ "$maj_ver" == "3" ] ; then
+        mv ${D}${bindir}/chardetect ${D}${bindir}/chardetect3
+    fi
+}

Its better to do the renaming in recipe for python3 version of this module for help see how its
done for cython

Quoted 8 lines

--
2.18.0.597.ga71716f1ad-goog

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

author
#2 lore raw

PATCH v2 1/1 python3-chardet: add a '3' suffix to binary to avoid conflicts with python2

---
 meta-python/recipes-devtools/python/python3-chardet_3.0.4.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta-python/recipes-devtools/python/python3-chardet_3.0.4.bb +5 -0
index 038043c56..38d8122ce 100644
@@ -1,2 +1,7 @@
 inherit setuptools3
 require python-chardet.inc
+
+do_install_append () {
+    # rename scripts that would conflict with the Python 2 build of chardet
+    mv ${D}${bindir}/chardetect ${D}${bindir}/chardetect3
+}
Signature · 1 line
2.18.0.597.ga71716f1ad-goog