From bbe1c748394832984de57a43d503678bf94efc16 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Sun, 4 Feb 2018 08:14:02 +0100 Subject: [PATCH 1/2] adjust to python3 package restructuring In commit openembedded/openembedded-core@54ac820b8a6, the packaging of python3 base libraries changed. Amongst others, the packages, python3-argparse, python3-subprocess and python3-textutils, are merged into the python3 package. Hence, this commit adjusts the runtime dependencies in the meta-ros recipes accordingly. Signed-off-by: Lukas Bulwahn --- recipes-ros/catkin/catkin-runtime_0.6.19.bb | 5 +++-- recipes-ros/ros-comm/roslaunch_1.11.21.bb | 2 +- recipes-ros/rospack/rospack_2.2.8.bb | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/recipes-ros/catkin/catkin-runtime_0.6.19.bb b/recipes-ros/catkin/catkin-runtime_0.6.19.bb index 55617cc..2f5256c 100644 --- a/recipes-ros/catkin/catkin-runtime_0.6.19.bb +++ b/recipes-ros/catkin/catkin-runtime_0.6.19.bb @@ -15,8 +15,9 @@ FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR} ${ros_bindir}/catkin_find" RDEPENDS_${PN}_class-native = "" RDEPENDS_${PN} = "\ - ${PYTHON_PN}-catkin-pkg ${PYTHON_PN}-argparse ${PYTHON_PN}-misc ${PYTHON_PN}-multiprocessing \ - ${PYTHON_PN}-shell ${PYTHON_PN}-subprocess ${PYTHON_PN}-xml ${PYTHON_PN}-pkgutil" + ${PYTHON_PN}-catkin-pkg ${PYTHON_PN}-misc ${PYTHON_PN}-multiprocessing \ + ${PYTHON_PN}-shell ${PYTHON_PN}-xml ${PYTHON_PN}-pkgutil \ + ${@'python-argparse python-subprocess' if d.getVar('PYTHON_PN', True) == 'python2' else ''}" # Delete everything but the python packages in order to avoid # that the QA error [installed-vs-shipped] hits on us. diff --git a/recipes-ros/ros-comm/roslaunch_1.11.21.bb b/recipes-ros/ros-comm/roslaunch_1.11.21.bb index c643453..6d2fd7e 100644 --- a/recipes-ros/ros-comm/roslaunch_1.11.21.bb +++ b/recipes-ros/ros-comm/roslaunch_1.11.21.bb @@ -16,7 +16,7 @@ SRC_URI += "file://0001-increase-rosmaster-timeout.patch \ ROS_PKG_SUBDIR = "tools" RDEPENDS_${PN} = "\ - ${PYTHON_PN}-textutils \ + ${@'python-textutils' if d.getVar('PYTHON_PN', True) == 'python2' else ''} \ ${PYTHON_PN}-logging \ ${PYTHON_PN}-threading \ ${PYTHON_PN}-rospkg \ diff --git a/recipes-ros/rospack/rospack_2.2.8.bb b/recipes-ros/rospack/rospack_2.2.8.bb index 1d0d9d8..80a7fed 100644 --- a/recipes-ros/rospack/rospack_2.2.8.bb +++ b/recipes-ros/rospack/rospack_2.2.8.bb @@ -13,4 +13,5 @@ SRC_URI[sha256sum] = "a8fecbe03f9757510fe47137642e39a7c31b823d5bf7fa7890acc11691 inherit catkin -RDEPENDS_${PN} = "${PYTHON_PN}-rosdep ${PYTHON_PN}-subprocess" +RDEPENDS_${PN} = "${PYTHON_PN}-rosdep \ + ${@'python-subprocess' if d.getVar('PYTHON_PN', True) == 'python2' else ''}" From 6ddc0cc518ebcfdd6871774030bb5f91c09557d9 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Fri, 2 Feb 2018 20:54:36 +0100 Subject: [PATCH 2/2] python3: make python point to python3 (resolves #570) This commit is just a copy of the patch that Dmitry Rozhkov submitted to openembedded-core, but it was rejected there [1]. If only python3 is installed on an image nothing provides /usr/bin/python even though many scripts compatible with both python2 and python3 just state `#!/usr/bin/env python` in their shebang line. Make python and python3 recipes provide alternatives for /usr/bin/python and /usr/bin/python-config. By default python2 has higher priority over python3. In meta-ros, we need this behaviour for ROS_USE_PYTHON3 = "yes" because ROS packages are always written to be python2 and python3 compatible. [1] https://patchwork.openembedded.org/patch/139143/ Signed-off-by: Lukas Bulwahn --- recipes-devtools/python/python3_%.bbappend | 8 ++++++++ recipes-devtools/python/python_%.bbappend | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 recipes-devtools/python/python3_%.bbappend diff --git a/recipes-devtools/python/python3_%.bbappend b/recipes-devtools/python/python3_%.bbappend new file mode 100644 index 0000000..54ea791 --- /dev/null +++ b/recipes-devtools/python/python3_%.bbappend @@ -0,0 +1,8 @@ +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "80" +ALTERNATIVE_${PN}-core = "python python_config" +ALTERNATIVE_LINK_NAME[python] = "${bindir}/python" +ALTERNATIVE_LINK_NAME[python_config] = "${bindir}/python-config" +ALTERNATIVE_TARGET[python] = "${bindir}/python3" +ALTERNATIVE_TARGET[python_config] = "${bindir}/python3-config" diff --git a/recipes-devtools/python/python_%.bbappend b/recipes-devtools/python/python_%.bbappend index 5248cd7..a737a61 100644 --- a/recipes-devtools/python/python_%.bbappend +++ b/recipes-devtools/python/python_%.bbappend @@ -1,3 +1,10 @@ EXTRA_OECONF += "\ --enable-ipv6 \ " + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN}-core = "python python_config" +ALTERNATIVE_LINK_NAME[python] = "${bindir}/python" +ALTERNATIVE_LINK_NAME[python_config] = "${bindir}/python-config"