From efd6e9e1efb64b8582e75806373b280ace516744 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:13:00 +0300 Subject: [PATCH 01/14] catkin.bbclass: make expression more readable Signed-off-by: Dmitry Rozhkov --- classes/catkin.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/catkin.bbclass b/classes/catkin.bbclass index 7c55d5d..9f32c0e 100644 --- a/classes/catkin.bbclass +++ b/classes/catkin.bbclass @@ -4,7 +4,7 @@ inherit cmake distutils-base ros faulty-solibs -DEPENDS_prepend = "${@['catkin-native ', ''][(d.getVar('BPN', True) == 'catkin') | (d.getVar('BPN', True) == 'catkin-runtime')]}" +DEPENDS_prepend = "${@'' if (d.getVar('BPN', True) == 'catkin') or (d.getVar('BPN', True) == 'catkin-runtime') else 'catkin-native '}" EXTRA_OECMAKE_CATKIN = "\ -DCMAKE_PREFIX_PATH='${STAGING_DIR_HOST}${ros_prefix};${STAGING_DIR_HOST}${prefix};${STAGING_DIR_NATIVE}${ros_prefix};${STAGING_DIR_NATIVE}${prefix}' \ From 99e240eec1b203f3c6851a0606e8e5741ac5a6c6 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:25:41 +0300 Subject: [PATCH 02/14] python-catkin-pkg: add python3 flavour of the package Signed-off-by: Dmitry Rozhkov --- recipes-devtools/python/python-catkin-pkg.inc | 13 +++++++++++++ .../python/python-catkin-pkg_0.2.10.bb | 14 +------------- .../python/python3-catkin-pkg_0.2.10.bb | 3 +++ 3 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 recipes-devtools/python/python-catkin-pkg.inc create mode 100644 recipes-devtools/python/python3-catkin-pkg_0.2.10.bb diff --git a/recipes-devtools/python/python-catkin-pkg.inc b/recipes-devtools/python/python-catkin-pkg.inc new file mode 100644 index 0000000..b665292 --- /dev/null +++ b/recipes-devtools/python/python-catkin-pkg.inc @@ -0,0 +1,13 @@ +DESCRIPTION = "catkin package library" +SECTION = "devel/python" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709" +SRCNAME = "catkin_pkg" + +SRC_URI = "https://pypi.python.org/packages/source/c/catkin_pkg/catkin_pkg-${PV}.tar.gz" +SRC_URI[md5sum] = "da93566c65dddfa9f821e18944c5ee5e" +SRC_URI[sha256sum] = "d4d069eaeb29d6a9ee71773b20c41515b6e0feb9ea2765ebaf3e599d0ceef050" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +BBCLASSEXTEND = "native" diff --git a/recipes-devtools/python/python-catkin-pkg_0.2.10.bb b/recipes-devtools/python/python-catkin-pkg_0.2.10.bb index e08b0e5..b734a57 100644 --- a/recipes-devtools/python/python-catkin-pkg_0.2.10.bb +++ b/recipes-devtools/python/python-catkin-pkg_0.2.10.bb @@ -1,15 +1,3 @@ -DESCRIPTION = "catkin package library" -SECTION = "devel/python" -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709" -SRCNAME = "catkin_pkg" - -SRC_URI = "https://pypi.python.org/packages/source/c/catkin_pkg/catkin_pkg-${PV}.tar.gz" -SRC_URI[md5sum] = "da93566c65dddfa9f821e18944c5ee5e" -SRC_URI[sha256sum] = "d4d069eaeb29d6a9ee71773b20c41515b6e0feb9ea2765ebaf3e599d0ceef050" - -S = "${WORKDIR}/${SRCNAME}-${PV}" +require python-catkin-pkg.inc inherit distutils - -BBCLASSEXTEND = "native" diff --git a/recipes-devtools/python/python3-catkin-pkg_0.2.10.bb b/recipes-devtools/python/python3-catkin-pkg_0.2.10.bb new file mode 100644 index 0000000..c863663 --- /dev/null +++ b/recipes-devtools/python/python3-catkin-pkg_0.2.10.bb @@ -0,0 +1,3 @@ +require python-catkin-pkg.inc + +inherit distutils3 From 6d7593926edb712970123d36601939949298ec04 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:26:21 +0300 Subject: [PATCH 03/14] python-empy: add python3 flavour of the package Signed-off-by: Dmitry Rozhkov --- recipes-devtools/python/python-empy.inc | 13 +++++++++++++ recipes-devtools/python/python-empy_3.3.2.bb | 14 +------------- recipes-devtools/python/python3-empy_3.3.2.bb | 3 +++ 3 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 recipes-devtools/python/python-empy.inc create mode 100644 recipes-devtools/python/python3-empy_3.3.2.bb diff --git a/recipes-devtools/python/python-empy.inc b/recipes-devtools/python/python-empy.inc new file mode 100644 index 0000000..3a94a95 --- /dev/null +++ b/recipes-devtools/python/python-empy.inc @@ -0,0 +1,13 @@ +DESCRIPTION = "A powerful and robust templating system for Python" +SECTION = "devel/python" +LICENSE = "LGPL-2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34" +SRCNAME = "empy" + +SRC_URI = "http://www.alcyone.com/software/empy/empy-${PV}.tar.gz" +SRC_URI[md5sum] = "fbb34761cdf9acc4c65e298c9eced395" +SRC_URI[sha256sum] = "99f016af2770c48ab57a65df7aae251360dc69a1514c15851458a71d4ddfea9c" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +BBCLASSEXTEND = "native" diff --git a/recipes-devtools/python/python-empy_3.3.2.bb b/recipes-devtools/python/python-empy_3.3.2.bb index bfe11e4..ab0b9e8 100644 --- a/recipes-devtools/python/python-empy_3.3.2.bb +++ b/recipes-devtools/python/python-empy_3.3.2.bb @@ -1,15 +1,3 @@ -DESCRIPTION = "A powerful and robust templating system for Python" -SECTION = "devel/python" -LICENSE = "LGPL-2.1" -LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34" -SRCNAME = "empy" - -SRC_URI = "http://www.alcyone.com/software/empy/empy-${PV}.tar.gz" -SRC_URI[md5sum] = "fbb34761cdf9acc4c65e298c9eced395" -SRC_URI[sha256sum] = "99f016af2770c48ab57a65df7aae251360dc69a1514c15851458a71d4ddfea9c" - -S = "${WORKDIR}/${SRCNAME}-${PV}" +require python-empy.inc inherit distutils - -BBCLASSEXTEND = "native" diff --git a/recipes-devtools/python/python3-empy_3.3.2.bb b/recipes-devtools/python/python3-empy_3.3.2.bb new file mode 100644 index 0000000..8afb62a --- /dev/null +++ b/recipes-devtools/python/python3-empy_3.3.2.bb @@ -0,0 +1,3 @@ +require python-empy.inc + +inherit distutils3 From 98ee4cec35534b75db46423101d04422713b0b50 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:27:06 +0300 Subject: [PATCH 04/14] python-netifaces: add python3 flavour of the package Signed-off-by: Dmitry Rozhkov --- recipes-devtools/python/python-netifaces.inc | 11 +++++++++++ recipes-devtools/python/python-netifaces_0.10.5.bb | 12 +----------- recipes-devtools/python/python3-netifaces_0.10.5.bb | 3 +++ 3 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 recipes-devtools/python/python-netifaces.inc create mode 100644 recipes-devtools/python/python3-netifaces_0.10.5.bb diff --git a/recipes-devtools/python/python-netifaces.inc b/recipes-devtools/python/python-netifaces.inc new file mode 100644 index 0000000..0da40e9 --- /dev/null +++ b/recipes-devtools/python/python-netifaces.inc @@ -0,0 +1,11 @@ +DESCRIPTION = "Portable network interface information for Python" +SECTION = "devel/python" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=a53cbc7cb75660694e138ba973c148df" +SRCNAME = "netifaces" + +SRC_URI = "https://pypi.python.org/packages/a7/4c/8e0771a59fd6e55aac993a7cc1b6a0db993f299514c464ae6a1ecf83b31d/netifaces-0.10.5.tar.gz" +SRC_URI[md5sum] = "5b4d1f1310ed279e6df27ef3a9b71519" +SRC_URI[sha256sum] = "59d8ad52dd3116fcb6635e175751b250dc783fb011adba539558bd764e5d628b" + +S = "${WORKDIR}/${SRCNAME}-${PV}" diff --git a/recipes-devtools/python/python-netifaces_0.10.5.bb b/recipes-devtools/python/python-netifaces_0.10.5.bb index 82a63ac..155af68 100644 --- a/recipes-devtools/python/python-netifaces_0.10.5.bb +++ b/recipes-devtools/python/python-netifaces_0.10.5.bb @@ -1,13 +1,3 @@ -DESCRIPTION = "Portable network interface information for Python" -SECTION = "devel/python" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=a53cbc7cb75660694e138ba973c148df" -SRCNAME = "netifaces" - -SRC_URI = "https://pypi.python.org/packages/a7/4c/8e0771a59fd6e55aac993a7cc1b6a0db993f299514c464ae6a1ecf83b31d/netifaces-0.10.5.tar.gz" -SRC_URI[md5sum] = "5b4d1f1310ed279e6df27ef3a9b71519" -SRC_URI[sha256sum] = "59d8ad52dd3116fcb6635e175751b250dc783fb011adba539558bd764e5d628b" - -S = "${WORKDIR}/${SRCNAME}-${PV}" +require python-netifaces.inc inherit setuptools diff --git a/recipes-devtools/python/python3-netifaces_0.10.5.bb b/recipes-devtools/python/python3-netifaces_0.10.5.bb new file mode 100644 index 0000000..8e1fb8f --- /dev/null +++ b/recipes-devtools/python/python3-netifaces_0.10.5.bb @@ -0,0 +1,3 @@ +require python-netifaces.inc + +inherit setuptools3 From dc34b1230b976481d6729840da0bf89cd4116dc3 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:28:42 +0300 Subject: [PATCH 05/14] python-rosdep: add python3 flavour of the package Signed-off-by: Dmitry Rozhkov --- recipes-devtools/python/python-rosdep.inc | 17 +++++++++++++++++ .../python/python-rosdep_0.11.5.bb | 18 +----------------- .../python/python3-rosdep_0.11.5.bb | 5 +++++ 3 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 recipes-devtools/python/python-rosdep.inc create mode 100644 recipes-devtools/python/python3-rosdep_0.11.5.bb diff --git a/recipes-devtools/python/python-rosdep.inc b/recipes-devtools/python/python-rosdep.inc new file mode 100644 index 0000000..a01105d --- /dev/null +++ b/recipes-devtools/python/python-rosdep.inc @@ -0,0 +1,17 @@ +DESCRIPTION = "rosdep package manager abstraction tool for ROS" +SECTION = "devel/python" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709" +SRCNAME = "rosdep" + +SRC_URI = "http://download.ros.org/downloads/rosdep/rosdep-${PV}.tar.gz \ + file://0001-Remove-build-dependency-on-nose-from-setup.py-491.patch \ + " +SRC_URI[md5sum] = "2c5669bc5cafcb1df8cd21ce14844cc4" +SRC_URI[sha256sum] = "46e072074270a1ea25411829814f4bdc1f34b358c950e9b8a7b75b4a40efd96a" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +RDEPENDS_${PN} += "${PYTHON_PN}-catkin-pkg ${PYTHON_PN}-rospkg ${PYTHON_PN}-pyyaml ${PYTHON_PN}-netclient ${PYTHON_PN}-rosdistro" + +BBCLASSEXTEND += "native" diff --git a/recipes-devtools/python/python-rosdep_0.11.5.bb b/recipes-devtools/python/python-rosdep_0.11.5.bb index b8fe94a..fbb74a7 100644 --- a/recipes-devtools/python/python-rosdep_0.11.5.bb +++ b/recipes-devtools/python/python-rosdep_0.11.5.bb @@ -1,19 +1,3 @@ -DESCRIPTION = "rosdep package manager abstraction tool for ROS" -SECTION = "devel/python" -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709" -SRCNAME = "rosdep" - -SRC_URI = "http://download.ros.org/downloads/rosdep/rosdep-${PV}.tar.gz \ - file://0001-Remove-build-dependency-on-nose-from-setup.py-491.patch \ - " -SRC_URI[md5sum] = "2c5669bc5cafcb1df8cd21ce14844cc4" -SRC_URI[sha256sum] = "46e072074270a1ea25411829814f4bdc1f34b358c950e9b8a7b75b4a40efd96a" - -S = "${WORKDIR}/${SRCNAME}-${PV}" - -RDEPENDS_${PN} += "python-catkin-pkg python-rospkg python-pyyaml python-netclient python-rosdistro" +require python-rosdep.inc inherit setuptools - -BBCLASSEXTEND += "native" diff --git a/recipes-devtools/python/python3-rosdep_0.11.5.bb b/recipes-devtools/python/python3-rosdep_0.11.5.bb new file mode 100644 index 0000000..d11d9f7 --- /dev/null +++ b/recipes-devtools/python/python3-rosdep_0.11.5.bb @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/python-rosdep:" + +require python-rosdep.inc + +inherit setuptools3 From 6b79f13becc83cd5c7c9f77cdeb6de9755199fa1 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:30:01 +0300 Subject: [PATCH 06/14] python-rosdistro: add python3 flavour of the package Signed-off-by: Dmitry Rozhkov --- recipes-devtools/python/python-rosdistro.inc | 15 +++++++++++++++ .../python/python-rosdistro_0.4.7.bb | 16 +--------------- .../python/python3-rosdistro_0.4.7.bb | 3 +++ 3 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 recipes-devtools/python/python-rosdistro.inc create mode 100644 recipes-devtools/python/python3-rosdistro_0.4.7.bb diff --git a/recipes-devtools/python/python-rosdistro.inc b/recipes-devtools/python/python-rosdistro.inc new file mode 100644 index 0000000..17ac9cf --- /dev/null +++ b/recipes-devtools/python/python-rosdistro.inc @@ -0,0 +1,15 @@ +DESCRIPTION = "ROS package library" +SECTION = "devel/python" +LICENSE = "BSD & MIT" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=48623a4c0f1b1f65fae1dedd990a7f54" +SRCNAME = "rosdistro" + +SRC_URI = "http://download.ros.org/downloads/rosdistro/rosdistro-${PV}.tar.gz" +SRC_URI[md5sum] = "a699690fab755fd1b92b2ac04933e227" +SRC_URI[sha256sum] = "f44757336bcee4089f6f6d570248e7c4e09eebfe5238d6ae60d8bd35361eedc4" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +RDEPENDS_${PN} += "${PYTHON_PN}-pyyaml" + +BBCLASSEXTEND = "native" diff --git a/recipes-devtools/python/python-rosdistro_0.4.7.bb b/recipes-devtools/python/python-rosdistro_0.4.7.bb index 68b77a5..d6bd432 100644 --- a/recipes-devtools/python/python-rosdistro_0.4.7.bb +++ b/recipes-devtools/python/python-rosdistro_0.4.7.bb @@ -1,17 +1,3 @@ -DESCRIPTION = "ROS package library" -SECTION = "devel/python" -LICENSE = "BSD & MIT" -LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=48623a4c0f1b1f65fae1dedd990a7f54" -SRCNAME = "rosdistro" - -SRC_URI = "http://download.ros.org/downloads/rosdistro/rosdistro-${PV}.tar.gz" -SRC_URI[md5sum] = "a699690fab755fd1b92b2ac04933e227" -SRC_URI[sha256sum] = "f44757336bcee4089f6f6d570248e7c4e09eebfe5238d6ae60d8bd35361eedc4" - -S = "${WORKDIR}/${SRCNAME}-${PV}" - -RDEPENDS_${PN} += "python-pyyaml" +require python-rosdistro.inc inherit setuptools - -BBCLASSEXTEND = "native" diff --git a/recipes-devtools/python/python3-rosdistro_0.4.7.bb b/recipes-devtools/python/python3-rosdistro_0.4.7.bb new file mode 100644 index 0000000..b61409e --- /dev/null +++ b/recipes-devtools/python/python3-rosdistro_0.4.7.bb @@ -0,0 +1,3 @@ +require python-rosdistro.inc + +inherit setuptools3 From b4c015b4ea9e4fc6c613ce49cdb18ae3568ad57b Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:30:31 +0300 Subject: [PATCH 07/14] python-rospkg: add python3 flavour of the package Signed-off-by: Dmitry Rozhkov --- recipes-devtools/python/python-rospkg.inc | 15 +++++++++++++++ recipes-devtools/python/python-rospkg_1.0.40.bb | 16 +--------------- recipes-devtools/python/python3-rospkg_1.0.40.bb | 3 +++ 3 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 recipes-devtools/python/python-rospkg.inc create mode 100644 recipes-devtools/python/python3-rospkg_1.0.40.bb diff --git a/recipes-devtools/python/python-rospkg.inc b/recipes-devtools/python/python-rospkg.inc new file mode 100644 index 0000000..b9e35c9 --- /dev/null +++ b/recipes-devtools/python/python-rospkg.inc @@ -0,0 +1,15 @@ +DESCRIPTION = "ROS package library" +SECTION = "devel/python" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709" +SRCNAME = "rospkg" + +SRC_URI = "http://download.ros.org/downloads/rospkg/rospkg-${PV}.tar.gz" +SRC_URI[md5sum] = "36fa86450a397cbe531b214e088d06b7" +SRC_URI[sha256sum] = "ccd1d635319d41b79139b7336af64fc17a48a69ce0d728c1578c78f6350dbe1c" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +RDEPENDS_${PN} += "${PYTHON_PN}-xml" + +BBCLASSEXTEND = "native" diff --git a/recipes-devtools/python/python-rospkg_1.0.40.bb b/recipes-devtools/python/python-rospkg_1.0.40.bb index a446015..c6c8b97 100644 --- a/recipes-devtools/python/python-rospkg_1.0.40.bb +++ b/recipes-devtools/python/python-rospkg_1.0.40.bb @@ -1,17 +1,3 @@ -DESCRIPTION = "ROS package library" -SECTION = "devel/python" -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709" -SRCNAME = "rospkg" - -SRC_URI = "http://download.ros.org/downloads/rospkg/rospkg-${PV}.tar.gz" -SRC_URI[md5sum] = "36fa86450a397cbe531b214e088d06b7" -SRC_URI[sha256sum] = "ccd1d635319d41b79139b7336af64fc17a48a69ce0d728c1578c78f6350dbe1c" - -S = "${WORKDIR}/${SRCNAME}-${PV}" - -RDEPENDS_${PN} += "python-xml" +require python-rospkg.inc inherit setuptools - -BBCLASSEXTEND = "native" diff --git a/recipes-devtools/python/python3-rospkg_1.0.40.bb b/recipes-devtools/python/python3-rospkg_1.0.40.bb new file mode 100644 index 0000000..83a4944 --- /dev/null +++ b/recipes-devtools/python/python3-rospkg_1.0.40.bb @@ -0,0 +1,3 @@ +require python-rospkg.inc + +inherit setuptools3 From 88ec37531a22b57402fad1b0ab47a7c543c07d52 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:33:26 +0300 Subject: [PATCH 08/14] resource-retriever: backport python3 compatibility patch The added patch makes resource-retriever compatible with python3. Also drop python-urlgrabber which resource-retriever used to depend on. Signed-off-by: Dmitry Rozhkov --- .../python/python-urlgrabber_3.9.1.bb | 15 -- .../0001-Python3-compatibility-10.patch | 141 ++++++++++++++++++ .../resource-retriever_1.11.7.bb | 6 +- 3 files changed, 145 insertions(+), 17 deletions(-) delete mode 100644 recipes-devtools/python/python-urlgrabber_3.9.1.bb create mode 100644 recipes-ros/resource-retriever/resource-retriever/0001-Python3-compatibility-10.patch diff --git a/recipes-devtools/python/python-urlgrabber_3.9.1.bb b/recipes-devtools/python/python-urlgrabber_3.9.1.bb deleted file mode 100644 index aeb792d..0000000 --- a/recipes-devtools/python/python-urlgrabber_3.9.1.bb +++ /dev/null @@ -1,15 +0,0 @@ -DESCRIPTION = "A high-level cross-protocol url-grabber" -SECTION = "devel/python" -LICENSE = "LGPL-2.1" -LIC_FILES_CHKSUM = "file://LICENSE;md5=68ad62c64cc6c620126241fd429e68fe" -SRCNAME = "urlgrabber" - -DEPENDS = "python-pycurl-native python-pycurl" - -SRC_URI = "https://pypi.python.org/packages/source/u/${SRCNAME}/${SRCNAME}-${PV}.tar.gz" -SRC_URI[md5sum] = "00c8359bf71062d0946bacea521f80b4" -SRC_URI[sha256sum] = "4437076c8708e5754ea04540e46c7f4f233734ee3590bb8a96389264fb0650d0" - -S = "${WORKDIR}/${SRCNAME}-${PV}" - -inherit distutils diff --git a/recipes-ros/resource-retriever/resource-retriever/0001-Python3-compatibility-10.patch b/recipes-ros/resource-retriever/resource-retriever/0001-Python3-compatibility-10.patch new file mode 100644 index 0000000..eca93c2 --- /dev/null +++ b/recipes-ros/resource-retriever/resource-retriever/0001-Python3-compatibility-10.patch @@ -0,0 +1,141 @@ +From 2105ad5c201bacd9860ad21fa3b4de96eed0e124 Mon Sep 17 00:00:00 2001 +From: Ruben Smits +Date: Mon, 13 Feb 2017 18:02:23 +0100 +Subject: [PATCH] Python3 compatibility (#10) + +* Replace urlgrabber with urllib[2] + +As urlgrabber is not supported for Python 3 replace it with either the built-in urllib (Python 2) or urllib2 (Python 3) + +* Use rospkg instead of system call for rospack + +* Add test for python functionality + +* Fix rospkg dependency definition + +Upstream-Status: Backported +--- + package.xml | 2 +- + src/resource_retriever/__init__.py | 26 ++++++++++++++------------ + test/CMakeLists.txt | 2 ++ + test/test.py | 36 ++++++++++++++++++++++++++++++++++++ + 4 files changed, 53 insertions(+), 13 deletions(-) + create mode 100644 test/test.py + +diff --git a/package.xml b/package.xml +index fc1d789..4b447dc 100644 +--- a/package.xml ++++ b/package.xml +@@ -28,6 +28,6 @@ + curl + rosconsole + roslib +- python-urlgrabber ++ python-rospkg + + +diff --git a/src/resource_retriever/__init__.py b/src/resource_retriever/__init__.py +index d92baca..747a63f 100644 +--- a/src/resource_retriever/__init__.py ++++ b/src/resource_retriever/__init__.py +@@ -33,17 +33,16 @@ + + import roslib; roslib.load_manifest('resource_retriever') + import subprocess +-import urlgrabber, string ++import rospkg ++try: ++ from urllib.request import urlopen ++ from urllib.error import URLError ++except ImportError: ++ from urllib2 import urlopen ++ from urllib2 import URLError + + PACKAGE_PREFIX = 'package://' +- +-def rospack_find(package): +- process = subprocess.Popen(['rospack', 'find', package], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +- (stdout, stderr) = process.communicate() +- if len(stderr) > 0: +- raise Exception(stderr) +- else: +- return string.strip(stdout) ++r = rospkg.RosPack() + + def get_filename(url, use_protocol=True ): + mod_url = url +@@ -55,7 +54,7 @@ def get_filename(url, use_protocol=True ): + + package = mod_url[0:pos] + mod_url = mod_url[pos:] +- package_path = rospack_find(package) ++ package_path = r.get_path(package) + + if use_protocol: + protocol = "file://" +@@ -65,5 +64,8 @@ def get_filename(url, use_protocol=True ): + return mod_url + + def get(url): +- return urlgrabber.urlopen(get_filename(url)) +- ++ filename = get_filename(url) ++ try: ++ return urlopen(filename).read() ++ except URLError: ++ raise Exception("Invalid URL: {}".format(filename)) +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index f133bf6..e311f59 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -2,3 +2,5 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}) + + catkin_add_gtest(${PROJECT_NAME}_utest test.cpp) + target_link_libraries(${PROJECT_NAME}_utest ${PROJECT_NAME}) ++ ++catkin_add_nosetests(test.py) +diff --git a/test/test.py b/test/test.py +new file mode 100644 +index 0000000..ce1843f +--- /dev/null ++++ b/test/test.py +@@ -0,0 +1,36 @@ ++import resource_retriever as r ++ ++import os ++import rospkg ++from nose.tools import raises ++ ++rospack = rospkg.RosPack() ++ ++def test_get_by_package(): ++ res = r.get("package://resource_retriever/test/test.txt") ++ assert len(res) == 1 ++ assert res == 'A'.encode() ++ ++def test_get_large_file(): ++ res_path = os.path.join(rospack.get_path("resource_retriever"), "test/large_file.dat") ++ with open(res_path, 'w') as f: ++ for _ in range(1024*1024*50): ++ f.write('A') ++ res = r.get("package://resource_retriever/test/large_file.dat") ++ assert len(res) == 1024*1024*50 ++ ++def test_http(): ++ res = r.get("http://packages.ros.org/ros.key") ++ assert len(res) > 0 ++ ++@raises(Exception) ++def test_invalid_file(): ++ r.get("file://fail") ++ ++@raises(Exception) ++def test_no_file(): ++ r.get("package://roscpp") ++ ++@raises(rospkg.common.ResourceNotFound) ++def test_invalid_package(): ++ r.get("package://invalid_package_blah/test.xml") +-- +2.9.3 + diff --git a/recipes-ros/resource-retriever/resource-retriever_1.11.7.bb b/recipes-ros/resource-retriever/resource-retriever_1.11.7.bb index e65a3b9..94e49ea 100644 --- a/recipes-ros/resource-retriever/resource-retriever_1.11.7.bb +++ b/recipes-ros/resource-retriever/resource-retriever_1.11.7.bb @@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://package.xml;beginline=16;endline=16;md5=d566ef916e9de DEPENDS = "curl rosconsole roslib" -SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz" +SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz \ + file://0001-Python3-compatibility-10.patch \ + " SRC_URI[md5sum] = "1dffd39475ebe70b14390889d3b4b3c4" SRC_URI[sha256sum] = "5f00e95c5a086973efa25e26da9cee8f4b10b446fbb5eb6694b32b2201539866" @@ -14,4 +16,4 @@ S = "${WORKDIR}/${ROS_SP}" inherit catkin -RDEPENDS_${PN} = "python-urlgrabber" +RDEPENDS_${PN} = "${PYTHON_PN}-rospkg" From 38f722a81bde30215d18e49fb7eb8d1024fc1107 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:49:58 +0300 Subject: [PATCH 09/14] catkin: drop python-catkin-pkg from catkin-runtime's build deps Signed-off-by: Dmitry Rozhkov --- recipes-ros/catkin/catkin.inc | 2 +- recipes-ros/catkin/catkin_0.6.19.bb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-ros/catkin/catkin.inc b/recipes-ros/catkin/catkin.inc index 629b3c7..00575b6 100644 --- a/recipes-ros/catkin/catkin.inc +++ b/recipes-ros/catkin/catkin.inc @@ -3,7 +3,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=7;endline=7;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "cmake python-catkin-pkg python-empy-native python-catkin-pkg-native" +DEPENDS = "cmake python-empy-native python-catkin-pkg-native" SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz" SRC_URI[md5sum] = "d58460cc9112812d8c4e6ecf98bbcc85" diff --git a/recipes-ros/catkin/catkin_0.6.19.bb b/recipes-ros/catkin/catkin_0.6.19.bb index b09e07c..436e0c6 100644 --- a/recipes-ros/catkin/catkin_0.6.19.bb +++ b/recipes-ros/catkin/catkin_0.6.19.bb @@ -2,7 +2,7 @@ require catkin.inc DEPENDS_class-native += "catkin-runtime" -RDEPENDS_${PN}_class-native = "" +RDEPENDS_${PN}_class-native = "python-catkin-pkg" RDEPENDS_${PN} = "cmake make binutils binutils-symlinks gcc gcc-symlinks g++ g++-symlinks \ catkin-runtime" From 3e201940f6a801216b41bb174c8b97aef71f3d11 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 7 Apr 2017 14:54:49 +0300 Subject: [PATCH 10/14] enable python3 compatible builds of ROS (resolves #458) By default meta-ros uses python2. In case you want to get python3-compatible builds add the following line to your local.conf: ROS_USE_PYTHON3 = "yes" Signed-off-by: Dmitry Rozhkov --- classes/catkin.bbclass | 4 ++- recipes-ros/catkin/catkin-runtime_0.6.19.bb | 4 +-- recipes-ros/catkin/catkin.inc | 3 ++- recipes-ros/catkin/catkin_0.6.19.bb | 4 +-- ...-python.cmake-look-for-python3-first.patch | 27 +++++++++++++++++++ .../control-toolbox/control-toolbox_1.13.2.bb | 2 +- .../depthimage-to-laserscan_1.0.7.bb | 2 +- recipes-ros/genmsg/genmsg_0.5.8.bb | 2 +- recipes-ros/genpy/genpy_0.5.10.bb | 2 +- recipes-ros/geometry/tf_1.11.8.bb | 2 +- .../image-pipeline/image-proc_1.12.19.bb | 2 +- .../image-pipeline/image-publisher_1.12.19.bb | 2 +- .../image-pipeline/image-rotate_1.12.19.bb | 2 +- .../compressed-depth-image-transport_1.9.5.bb | 2 +- .../compressed-image-transport_1.9.5.bb | 2 +- .../theora-image-transport_1.9.5.bb | 2 +- .../moveit/moveit-ros-planning_0.7.8.bb | 2 +- recipes-ros/navigation/amcl_1.12.13.bb | 2 +- .../nodelet-core/nodelet-topic-tools_1.9.8.bb | 2 +- .../razor-imu-9dof/razor-imu-9dof_1.1.1.bb | 4 +-- recipes-ros/ros-comm/rosgraph_1.11.21.bb | 2 +- recipes-ros/ros-comm/roslaunch_1.11.21.bb | 10 +++---- recipes-ros/ros-comm/rospy_1.11.21.bb | 2 +- recipes-ros/ros-comm/rostest_1.11.21.bb | 2 +- recipes-ros/ros/roslib_1.11.14.bb | 2 +- recipes-ros/rospack/rospack_2.2.8.bb | 4 +-- recipes-ros/urdfdom/urdfdom-py_0.3.0.bb | 2 +- .../vision-opencv/cv-bridge_1.11.15.bb | 2 +- 28 files changed, 65 insertions(+), 35 deletions(-) create mode 100644 recipes-ros/catkin/files/0001-python.cmake-look-for-python3-first.patch diff --git a/classes/catkin.bbclass b/classes/catkin.bbclass index 9f32c0e..dffb8d9 100644 --- a/classes/catkin.bbclass +++ b/classes/catkin.bbclass @@ -2,7 +2,9 @@ # Copyright (c) 2013 Stefan Herbrechtsmeier, Bielefeld University # -inherit cmake distutils-base ros faulty-solibs +ROS_USE_PYTHON3 ??= "no" + +inherit cmake ${@'distutils3-base' if bb.utils.to_boolean(d.getVar('ROS_USE_PYTHON3', True)) else 'distutils-base'} ros faulty-solibs DEPENDS_prepend = "${@'' if (d.getVar('BPN', True) == 'catkin') or (d.getVar('BPN', True) == 'catkin-runtime') else 'catkin-native '}" diff --git a/recipes-ros/catkin/catkin-runtime_0.6.19.bb b/recipes-ros/catkin/catkin-runtime_0.6.19.bb index a63ec53..9cf60d9 100644 --- a/recipes-ros/catkin/catkin-runtime_0.6.19.bb +++ b/recipes-ros/catkin/catkin-runtime_0.6.19.bb @@ -11,8 +11,8 @@ FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR} ${ros_bindir}/catkin_find" RDEPENDS_${PN}_class-native = "" RDEPENDS_${PN} = "\ - python-catkin-pkg python-argparse python-misc python-multiprocessing \ - python-shell python-subprocess python-xml python-pkgutil" + ${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" # 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/catkin/catkin.inc b/recipes-ros/catkin/catkin.inc index 00575b6..157c931 100644 --- a/recipes-ros/catkin/catkin.inc +++ b/recipes-ros/catkin/catkin.inc @@ -3,7 +3,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=7;endline=7;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "cmake python-empy-native python-catkin-pkg-native" +DEPENDS = "cmake ${PYTHON_PN}-empy-native ${PYTHON_PN}-catkin-pkg-native" SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz" SRC_URI[md5sum] = "d58460cc9112812d8c4e6ecf98bbcc85" @@ -14,6 +14,7 @@ SRC_URI += "\ file://0001-use-python-provided-by-environment-instead-of-the-ge.patch \ file://0001-avoid-using-host-s-paths-when-cross-compiling.patch \ file://0001-relocate-dependency-s-headers-to-current-sysroot.patch \ + ${@'file://0001-python.cmake-look-for-python3-first.patch' if d.getVar('PYTHON_PN', True) == 'python3' else ''} \ " inherit catkin diff --git a/recipes-ros/catkin/catkin_0.6.19.bb b/recipes-ros/catkin/catkin_0.6.19.bb index 436e0c6..c74f998 100644 --- a/recipes-ros/catkin/catkin_0.6.19.bb +++ b/recipes-ros/catkin/catkin_0.6.19.bb @@ -2,7 +2,7 @@ require catkin.inc DEPENDS_class-native += "catkin-runtime" -RDEPENDS_${PN}_class-native = "python-catkin-pkg" +RDEPENDS_${PN}_class-native = "${PYTHON_PN}-catkin-pkg" RDEPENDS_${PN} = "cmake make binutils binutils-symlinks gcc gcc-symlinks g++ g++-symlinks \ catkin-runtime" @@ -14,7 +14,7 @@ RDEPENDS_${PN} = "cmake make binutils binutils-symlinks gcc gcc-symlinks g++ g++ do_install_append() { rm ${D}${ros_bindir}/catkin_find rm -rf ${D}${PYTHON_SITEPACKAGES_DIR} - rmdir ${D}${ros_libdir}/python2.7 + rmdir ${D}${ros_libdir}/${PYTHON_DIR} } BBCLASSEXTEND += "native" diff --git a/recipes-ros/catkin/files/0001-python.cmake-look-for-python3-first.patch b/recipes-ros/catkin/files/0001-python.cmake-look-for-python3-first.patch new file mode 100644 index 0000000..36455eb --- /dev/null +++ b/recipes-ros/catkin/files/0001-python.cmake-look-for-python3-first.patch @@ -0,0 +1,27 @@ +From 224186a1af40cd3b7efb4f0648a3a4ca6ca1e7fa Mon Sep 17 00:00:00 2001 +From: Dmitry Rozhkov +Date: Thu, 6 Apr 2017 15:25:13 +0300 +Subject: [PATCH] python.cmake: look for python3 first + +Upstream-Status: Inappropriate [the patch overrides ROS's default to python2] + +Signed-off-by: Dmitry Rozhkov +--- + cmake/python.cmake | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/cmake/python.cmake b/cmake/python.cmake +index 70f3d26..38f8320 100644 +--- a/cmake/python.cmake ++++ b/cmake/python.cmake +@@ -5,6 +5,7 @@ if(PYTHON_VERSION) + set(PythonInterp_FIND_VERSION "${PYTHON_VERSION}") + endif() + ++set(Python_ADDITIONAL_VERSIONS "3") + find_package(PythonInterp REQUIRED) + message(STATUS "Using PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") + +-- +2.9.3 + diff --git a/recipes-ros/control-toolbox/control-toolbox_1.13.2.bb b/recipes-ros/control-toolbox/control-toolbox_1.13.2.bb index 9dae5a5..3cadefb 100644 --- a/recipes-ros/control-toolbox/control-toolbox_1.13.2.bb +++ b/recipes-ros/control-toolbox/control-toolbox_1.13.2.bb @@ -4,7 +4,7 @@ LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=7;endline=7;md5=d566ef916e9dedc494f5f793a6690ba5" DEPENDS = "rosconsole tf roscpp angles message-generation dynamic-reconfigure libtinyxml \ - realtime-tools message-filters python-rospkg" + realtime-tools message-filters ${PYTHON_PN}-rospkg" SRC_URI = "https://github.com/ros-controls/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz" SRC_URI[md5sum] = "40bc1f04e5936b7fee824f6717702a62" diff --git a/recipes-ros/depthimage-to-laserscan/depthimage-to-laserscan_1.0.7.bb b/recipes-ros/depthimage-to-laserscan/depthimage-to-laserscan_1.0.7.bb index 30676e8..2d8e7df 100644 --- a/recipes-ros/depthimage-to-laserscan/depthimage-to-laserscan_1.0.7.bb +++ b/recipes-ros/depthimage-to-laserscan/depthimage-to-laserscan_1.0.7.bb @@ -3,7 +3,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=7;endline=7;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "roscpp sensor-msgs nodelet image-transport image-geometry dynamic-reconfigure python-rospkg" +DEPENDS = "roscpp sensor-msgs nodelet image-transport image-geometry dynamic-reconfigure ${PYTHON_PN}-rospkg" SRC_URI = "https://github.com/ros-perception/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz \ file://0001-Add-missing-std-namespace-prefixes.patch \ diff --git a/recipes-ros/genmsg/genmsg_0.5.8.bb b/recipes-ros/genmsg/genmsg_0.5.8.bb index 68b9924..071fa0b 100644 --- a/recipes-ros/genmsg/genmsg_0.5.8.bb +++ b/recipes-ros/genmsg/genmsg_0.5.8.bb @@ -9,5 +9,5 @@ SRC_URI[sha256sum] = "d7627a2df169e4e8208347d9215e47c723a015b67ef3ed8cda8b61b6cf inherit catkin -RDEPENDS_${PN} = "python-stringold python-pprint" +RDEPENDS_${PN} = "${PYTHON_PN}-stringold ${PYTHON_PN}-pprint" RDEPENDS_${PN}_class-native = "" diff --git a/recipes-ros/genpy/genpy_0.5.10.bb b/recipes-ros/genpy/genpy_0.5.10.bb index 5850df6..7098e7d 100644 --- a/recipes-ros/genpy/genpy_0.5.10.bb +++ b/recipes-ros/genpy/genpy_0.5.10.bb @@ -11,5 +11,5 @@ SRC_URI[sha256sum] = "e4465daffb352b4b45180a6157925b16ab3042996984ad231531134e4d inherit catkin -RDEPENDS_${PN} = "python-math genmsg python-shell" +RDEPENDS_${PN} = "${PYTHON_PN}-math genmsg ${PYTHON_PN}-shell" RDEPENDS_${PN}_class-native = "" diff --git a/recipes-ros/geometry/tf_1.11.8.bb b/recipes-ros/geometry/tf_1.11.8.bb index a0f91db..180a68a 100644 --- a/recipes-ros/geometry/tf_1.11.8.bb +++ b/recipes-ros/geometry/tf_1.11.8.bb @@ -9,4 +9,4 @@ require geometry.inc SRC_URI += "file://0001-Fix-stdlib.h-No-such-file-or-directory-errors-in-GCC.patch;striplevel=2" -RDEPENDS_${PN} = "python-numpy" +RDEPENDS_${PN} = "${PYTHON_PN}-numpy" diff --git a/recipes-ros/image-pipeline/image-proc_1.12.19.bb b/recipes-ros/image-pipeline/image-proc_1.12.19.bb index 02ba37e..455863b 100644 --- a/recipes-ros/image-pipeline/image-proc_1.12.19.bb +++ b/recipes-ros/image-pipeline/image-proc_1.12.19.bb @@ -3,6 +3,6 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=9;endline=9;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "boost camera-calibration-parsers cv-bridge dynamic-reconfigure image-geometry image-transport nodelet opencv roscpp sensor-msgs python-rospkg" +DEPENDS = "boost camera-calibration-parsers cv-bridge dynamic-reconfigure image-geometry image-transport nodelet opencv roscpp sensor-msgs ${PYTHON_PN}-rospkg" require image-pipeline.inc diff --git a/recipes-ros/image-pipeline/image-publisher_1.12.19.bb b/recipes-ros/image-pipeline/image-publisher_1.12.19.bb index c7f6057..1195ea6 100644 --- a/recipes-ros/image-pipeline/image-publisher_1.12.19.bb +++ b/recipes-ros/image-pipeline/image-publisher_1.12.19.bb @@ -3,6 +3,6 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=12;endline=12;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "camera-info-manager cv-bridge dynamic-reconfigure image-transport nodelet roscpp sensor-msgs python-rospkg" +DEPENDS = "camera-info-manager cv-bridge dynamic-reconfigure image-transport nodelet roscpp sensor-msgs ${PYTHON_PN}-rospkg" require image-pipeline.inc diff --git a/recipes-ros/image-pipeline/image-rotate_1.12.19.bb b/recipes-ros/image-pipeline/image-rotate_1.12.19.bb index 447136d..7a1c7fc 100644 --- a/recipes-ros/image-pipeline/image-rotate_1.12.19.bb +++ b/recipes-ros/image-pipeline/image-rotate_1.12.19.bb @@ -4,6 +4,6 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=26;endline=26;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "cmake-modules cv-bridge dynamic-reconfigure eigen-conversions image-transport nodelet opencv roscpp tf2 tf2-geometry-msgs tf2-ros python-rospkg" +DEPENDS = "cmake-modules cv-bridge dynamic-reconfigure eigen-conversions image-transport nodelet opencv roscpp tf2 tf2-geometry-msgs tf2-ros ${PYTHON_PN}-rospkg" require image-pipeline.inc diff --git a/recipes-ros/image-transport-plugins/compressed-depth-image-transport_1.9.5.bb b/recipes-ros/image-transport-plugins/compressed-depth-image-transport_1.9.5.bb index 34b737a..3288bf5 100644 --- a/recipes-ros/image-transport-plugins/compressed-depth-image-transport_1.9.5.bb +++ b/recipes-ros/image-transport-plugins/compressed-depth-image-transport_1.9.5.bb @@ -4,6 +4,6 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=9;endline=9;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "cv-bridge dynamic-reconfigure image-transport tf python-rospkg" +DEPENDS = "cv-bridge dynamic-reconfigure image-transport tf ${PYTHON_PN}-rospkg" require image-transport-plugins.inc diff --git a/recipes-ros/image-transport-plugins/compressed-image-transport_1.9.5.bb b/recipes-ros/image-transport-plugins/compressed-image-transport_1.9.5.bb index fdaeb1b..c64ce3d 100644 --- a/recipes-ros/image-transport-plugins/compressed-image-transport_1.9.5.bb +++ b/recipes-ros/image-transport-plugins/compressed-image-transport_1.9.5.bb @@ -4,6 +4,6 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=9;endline=9;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "cv-bridge dynamic-reconfigure image-transport tf python-rospkg" +DEPENDS = "cv-bridge dynamic-reconfigure image-transport tf ${PYTHON_PN}-rospkg" require image-transport-plugins.inc diff --git a/recipes-ros/image-transport-plugins/theora-image-transport_1.9.5.bb b/recipes-ros/image-transport-plugins/theora-image-transport_1.9.5.bb index 21f727e..c688bef 100644 --- a/recipes-ros/image-transport-plugins/theora-image-transport_1.9.5.bb +++ b/recipes-ros/image-transport-plugins/theora-image-transport_1.9.5.bb @@ -4,6 +4,6 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=9;endline=9;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "cv-bridge dynamic-reconfigure image-transport tf rosbag python-rospkg" +DEPENDS = "cv-bridge dynamic-reconfigure image-transport tf rosbag ${PYTHON_PN}-rospkg" require image-transport-plugins.inc diff --git a/recipes-ros/moveit/moveit-ros-planning_0.7.8.bb b/recipes-ros/moveit/moveit-ros-planning_0.7.8.bb index 617594b..e51eab5 100644 --- a/recipes-ros/moveit/moveit-ros-planning_0.7.8.bb +++ b/recipes-ros/moveit/moveit-ros-planning_0.7.8.bb @@ -3,7 +3,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=13;endline=13;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "moveit-core moveit-ros-perception dynamic-reconfigure python-rospkg libtinyxml" +DEPENDS = "moveit-core moveit-ros-perception dynamic-reconfigure ${PYTHON_PN}-rospkg libtinyxml" require moveit-${PV}.inc diff --git a/recipes-ros/navigation/amcl_1.12.13.bb b/recipes-ros/navigation/amcl_1.12.13.bb index e5f61e2..3393c62 100644 --- a/recipes-ros/navigation/amcl_1.12.13.bb +++ b/recipes-ros/navigation/amcl_1.12.13.bb @@ -3,6 +3,6 @@ SECTION = "devel" LICENSE = "LGPL-2.1+" LIC_FILES_CHKSUM = "file://package.xml;beginline=21;endline=21;md5=58d727014cda5ed405b7fb52666a1f97" -DEPENDS = "dynamic-reconfigure message-filters nav-msgs rosbag roscpp std-srvs tf python-rospkg" +DEPENDS = "dynamic-reconfigure message-filters nav-msgs rosbag roscpp std-srvs tf ${PYTHON_PN}-rospkg" require navigation.inc diff --git a/recipes-ros/nodelet-core/nodelet-topic-tools_1.9.8.bb b/recipes-ros/nodelet-core/nodelet-topic-tools_1.9.8.bb index 2e01c48..4e2ff72 100644 --- a/recipes-ros/nodelet-core/nodelet-topic-tools_1.9.8.bb +++ b/recipes-ros/nodelet-core/nodelet-topic-tools_1.9.8.bb @@ -3,6 +3,6 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "dynamic-reconfigure python-rospkg" +DEPENDS = "dynamic-reconfigure ${PYTHON_PN}-rospkg" require nodelet-core.inc diff --git a/recipes-ros/razor-imu-9dof/razor-imu-9dof_1.1.1.bb b/recipes-ros/razor-imu-9dof/razor-imu-9dof_1.1.1.bb index 73024d5..e82f469 100644 --- a/recipes-ros/razor-imu-9dof/razor-imu-9dof_1.1.1.bb +++ b/recipes-ros/razor-imu-9dof/razor-imu-9dof_1.1.1.bb @@ -7,7 +7,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=15;endline=15;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "dynamic-reconfigure python-rospkg" +DEPENDS = "dynamic-reconfigure ${PYTHON_PN}-rospkg" SRC_URI = "https://github.com/KristofRobot/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz" SRC_URI[md5sum] = "4712cbe1d9d8bacd9eebfd51825ada36" @@ -17,4 +17,4 @@ S = "${WORKDIR}/${ROS_SP}" inherit catkin -RDEPENDS_${PN} = "rospy tf sensor-msgs python-pyserial" +RDEPENDS_${PN} = "rospy tf sensor-msgs ${PYTHON_PN}-pyserial" diff --git a/recipes-ros/ros-comm/rosgraph_1.11.21.bb b/recipes-ros/ros-comm/rosgraph_1.11.21.bb index 6f742d3..c218182 100644 --- a/recipes-ros/ros-comm/rosgraph_1.11.21.bb +++ b/recipes-ros/ros-comm/rosgraph_1.11.21.bb @@ -4,7 +4,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=10;endline=10;md5=d566ef916e9dedc494f5f793a6690ba5" -RDEPENDS_${PN} = "python-xmlrpc python-threading python-rospkg rospy python-netifaces" +RDEPENDS_${PN} = "${PYTHON_PN}-xmlrpc ${PYTHON_PN}-threading ${PYTHON_PN}-rospkg rospy ${PYTHON_PN}-netifaces" require ros-comm.inc diff --git a/recipes-ros/ros-comm/roslaunch_1.11.21.bb b/recipes-ros/ros-comm/roslaunch_1.11.21.bb index 7e59035..c643453 100644 --- a/recipes-ros/ros-comm/roslaunch_1.11.21.bb +++ b/recipes-ros/ros-comm/roslaunch_1.11.21.bb @@ -16,12 +16,12 @@ SRC_URI += "file://0001-increase-rosmaster-timeout.patch \ ROS_PKG_SUBDIR = "tools" RDEPENDS_${PN} = "\ - python-textutils \ - python-logging \ - python-threading \ - python-rospkg \ + ${PYTHON_PN}-textutils \ + ${PYTHON_PN}-logging \ + ${PYTHON_PN}-threading \ + ${PYTHON_PN}-rospkg \ rosgraph \ - python-pyyaml \ + ${PYTHON_PN}-pyyaml \ roslib \ rosclean \ rosmaster \ diff --git a/recipes-ros/ros-comm/rospy_1.11.21.bb b/recipes-ros/ros-comm/rospy_1.11.21.bb index 862c908..2d19181 100644 --- a/recipes-ros/ros-comm/rospy_1.11.21.bb +++ b/recipes-ros/ros-comm/rospy_1.11.21.bb @@ -4,7 +4,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=23;endline=23;md5=d566ef916e9dedc494f5f793a6690ba5" -RDEPENDS_${PN} = "std-msgs genpy python-logging python-pyyaml rosgraph roslib rosgraph-msgs roscpp" +RDEPENDS_${PN} = "std-msgs genpy ${PYTHON_PN}-logging ${PYTHON_PN}-pyyaml rosgraph roslib rosgraph-msgs roscpp" require ros-comm.inc diff --git a/recipes-ros/ros-comm/rostest_1.11.21.bb b/recipes-ros/ros-comm/rostest_1.11.21.bb index 61c657b..65ac65a 100644 --- a/recipes-ros/ros-comm/rostest_1.11.21.bb +++ b/recipes-ros/ros-comm/rostest_1.11.21.bb @@ -3,7 +3,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "boost python-nose" +DEPENDS = "boost ${PYTHON_PN}-nose" DEPENDS_class-native = "boost-native rosunit-native" require ros-comm.inc diff --git a/recipes-ros/ros/roslib_1.11.14.bb b/recipes-ros/ros/roslib_1.11.14.bb index 5b45b7a..6438d61 100644 --- a/recipes-ros/ros/roslib_1.11.14.bb +++ b/recipes-ros/ros/roslib_1.11.14.bb @@ -9,4 +9,4 @@ require ros.inc ROS_PKG_SUBDIR = "core" -RDEPENDS_${PN} = "python-rospkg catkin-runtime" +RDEPENDS_${PN} = "${PYTHON_PN}-rospkg catkin-runtime" diff --git a/recipes-ros/rospack/rospack_2.2.8.bb b/recipes-ros/rospack/rospack_2.2.8.bb index 0561a0b..6779027 100644 --- a/recipes-ros/rospack/rospack_2.2.8.bb +++ b/recipes-ros/rospack/rospack_2.2.8.bb @@ -3,7 +3,7 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=6;endline=6;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "boost cmake-modules python-rospkg-native libtinyxml" +DEPENDS = "boost cmake-modules ${PYTHON_PN}-rospkg-native libtinyxml" SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz" SRC_URI[md5sum] = "f415d53b620d35ce674959ac7616d202" @@ -11,4 +11,4 @@ SRC_URI[sha256sum] = "a8fecbe03f9757510fe47137642e39a7c31b823d5bf7fa7890acc11691 inherit catkin -RDEPENDS_${PN} = "python-rosdep python-subprocess" +RDEPENDS_${PN} = "${PYTHON_PN}-rosdep ${PYTHON_PN}-subprocess" diff --git a/recipes-ros/urdfdom/urdfdom-py_0.3.0.bb b/recipes-ros/urdfdom/urdfdom-py_0.3.0.bb index 8967f80..21309cd 100644 --- a/recipes-ros/urdfdom/urdfdom-py_0.3.0.bb +++ b/recipes-ros/urdfdom/urdfdom-py_0.3.0.bb @@ -11,4 +11,4 @@ S = "${WORKDIR}/${ROS_SP}/urdf_parser_py" inherit catkin -RDEPENDS_${PN} = "python-lxml" +RDEPENDS_${PN} = "${PYTHON_PN}-lxml" diff --git a/recipes-ros/vision-opencv/cv-bridge_1.11.15.bb b/recipes-ros/vision-opencv/cv-bridge_1.11.15.bb index 0b268b2..a268b9b 100644 --- a/recipes-ros/vision-opencv/cv-bridge_1.11.15.bb +++ b/recipes-ros/vision-opencv/cv-bridge_1.11.15.bb @@ -3,6 +3,6 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=11;endline=11;md5=d566ef916e9dedc494f5f793a6690ba5" -DEPENDS = "boost opencv rosconsole sensor-msgs python-numpy-native" +DEPENDS = "boost opencv rosconsole sensor-msgs ${PYTHON_PN}-numpy-native" require vision-opencv.inc From 909662efe72b59d94e74884b62a113831ee659e3 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Mon, 10 Apr 2017 09:56:37 +0300 Subject: [PATCH 11/14] cv-bridge: disable python2 bindings python2 bindings for Boost got disabled in OE upstream, so disable python2 support in cv-bridge that depends on them. Signed-off-by: Dmitry Rozhkov --- recipes-ros/vision-opencv/cv-bridge_1.11.15.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes-ros/vision-opencv/cv-bridge_1.11.15.bb b/recipes-ros/vision-opencv/cv-bridge_1.11.15.bb index a268b9b..ad70ceb 100644 --- a/recipes-ros/vision-opencv/cv-bridge_1.11.15.bb +++ b/recipes-ros/vision-opencv/cv-bridge_1.11.15.bb @@ -5,4 +5,8 @@ LIC_FILES_CHKSUM = "file://package.xml;beginline=11;endline=11;md5=d566ef916e9de DEPENDS = "boost opencv rosconsole sensor-msgs ${PYTHON_PN}-numpy-native" +# This option disables python2 support because we can't support both python2 +# and python3 since OE upstream has disabled python2 bindings in Boost. +EXTRA_OECMAKE =+ "${@'-DANDROID=ON' if d.getVar('PYTHON_PN', True) != 'python3' else ''}" + require vision-opencv.inc From c171488a6398d63a778a8f20da2dcb83a783d17f Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Mon, 10 Apr 2017 10:47:54 +0300 Subject: [PATCH 12/14] camera-calibration-parsers: disable support for python2 The package can't be built with python2 bindings since libboost_python.so (which the bindings depend on) has been disabled in Boost in OE upstream. Only python3 configuration is supported nowadays. Disable support for python2 in camera_calibration_parsers. Signed-off-by: Dmitry Rozhkov --- .../0001-Drop-support-for-python.patch | 64 +++++++++++++++++++ .../camera-calibration-parsers_1.11.12.bb | 5 ++ 2 files changed, 69 insertions(+) create mode 100644 recipes-ros/image-common/camera-calibration-parsers/0001-Drop-support-for-python.patch diff --git a/recipes-ros/image-common/camera-calibration-parsers/0001-Drop-support-for-python.patch b/recipes-ros/image-common/camera-calibration-parsers/0001-Drop-support-for-python.patch new file mode 100644 index 0000000..8e289a0 --- /dev/null +++ b/recipes-ros/image-common/camera-calibration-parsers/0001-Drop-support-for-python.patch @@ -0,0 +1,64 @@ +From ddf9ddefb51502fb21ba01e31187e4ffebc70cce Mon Sep 17 00:00:00 2001 +From: Dmitry Rozhkov +Date: Mon, 10 Apr 2017 10:35:26 +0300 +Subject: [PATCH] Drop support for python + +Upstream-Status: Inappropriate [ROS still supports python2 officially] + +Signed-off-by: Dmitry Rozhkov +--- + CMakeLists.txt | 23 ++--------------------- + 1 file changed, 2 insertions(+), 21 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c21e54a..3a89d94 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,13 +3,8 @@ project(camera_calibration_parsers) + + find_package(catkin REQUIRED sensor_msgs rosconsole roscpp roscpp_serialization) + +-find_package(PythonLibs REQUIRED) +-if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3) +- find_package(Boost REQUIRED COMPONENTS filesystem python) +-else() +- find_package(Boost REQUIRED COMPONENTS filesystem python3) +-endif() +-include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}) ++ ++include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) + + catkin_python_setup() + +@@ -41,17 +36,7 @@ add_library(${PROJECT_NAME} + src/parse_yml.cpp + ) + +-add_library(${PROJECT_NAME}_wrapper +- src/parse_wrapper.cpp) +- + target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY}) +-target_link_libraries(${PROJECT_NAME}_wrapper ${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_PYTHON_LIBRARY} ${PYTHON_LIBRARIES}) +- +-# Don't prepend wrapper library name with lib and add to Python libs. +-set_target_properties(${PROJECT_NAME}_wrapper PROPERTIES +- PREFIX "" +- LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION} +- ) + + add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) + +@@ -74,10 +59,6 @@ install( + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} + ) + +-install(TARGETS ${PROJECT_NAME}_wrapper +- DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION} +-) +- + if(CATKIN_ENABLE_TESTING) + add_subdirectory(test) + endif() +-- +2.9.3 + diff --git a/recipes-ros/image-common/camera-calibration-parsers_1.11.12.bb b/recipes-ros/image-common/camera-calibration-parsers_1.11.12.bb index b94116c..70c433b 100644 --- a/recipes-ros/image-common/camera-calibration-parsers_1.11.12.bb +++ b/recipes-ros/image-common/camera-calibration-parsers_1.11.12.bb @@ -6,3 +6,8 @@ LIC_FILES_CHKSUM = "file://package.xml;beginline=10;endline=10;md5=d566ef916e9de DEPENDS = "boost rosconsole roscpp roscpp-serialization sensor-msgs yaml-cpp" require image-common.inc + +# OE upstream doesn't support python2 in Boost, but python3 only. +# So, drop python support from camera-calibration-parsers in case +# we're building a python2 flavour of ROS. +SRC_URI += "${@'file://0001-Drop-support-for-python.patch' if d.getVar('PYTHON_PN', True) != 'python3' else ''}" From 2e90a00cbc431c515f203e9cda4351bd0a4c2a79 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Mon, 10 Apr 2017 14:21:31 +0300 Subject: [PATCH 13/14] tf: disable python support for python3-based ROS tf supports only python2 thus disable it if we build python3-based ROS. Signed-off-by: Dmitry Rozhkov --- recipes-ros/geometry/tf_1.11.8.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes-ros/geometry/tf_1.11.8.bb b/recipes-ros/geometry/tf_1.11.8.bb index 180a68a..a965cea 100644 --- a/recipes-ros/geometry/tf_1.11.8.bb +++ b/recipes-ros/geometry/tf_1.11.8.bb @@ -10,3 +10,7 @@ require geometry.inc SRC_URI += "file://0001-Fix-stdlib.h-No-such-file-or-directory-errors-in-GCC.patch;striplevel=2" RDEPENDS_${PN} = "${PYTHON_PN}-numpy" + +# This option disables python support in case of python3 flavour of ROS because +# only python2 is supported by tf. +EXTRA_OECMAKE =+ "${@'-DANDROID=ON' if d.getVar('PYTHON_PN', True) == 'python3' else ''}" From 910ddc29b4da58f26e9f92fa9f12e287ad08faab Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Mon, 10 Apr 2017 14:47:24 +0300 Subject: [PATCH 14/14] README.md: document ROS_USE_PYTHON3 usage Signed-off-by: Dmitry Rozhkov --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 4a3ae81..887b064 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ resolved in the past. * Lukas Bulwahn, BMW Car IT GmbH * Stefan Herbrechtsmeier, Bielefeld University * Kristof Robot + * Dmitry Rozhkov, Intel ## CONTRIBUTORS ## @@ -47,6 +48,7 @@ resolved in the past. * Gauthier Monserand * Timo Mueller * Andreas Baak + * Dmitry Rozhkov, Intel ## HOW TO CONTRIBUTE ## @@ -161,6 +163,11 @@ resolved in the past. /home/me/devel/meta-ros \ " + By default meta-ros uses python2 in all its recipes. If you want ROS packages + to use python3 then add the following line in your `./conf/local.conf` file: + + ROS_USE_PYTHON3 = "yes" + Compile package: bitbake