--- /dev/null
+Upstream status: Pending.
+https://github.com/orocos/orocos_kinematics_dynamics/pull/44
+
+Index: orocos_kinematics_dynamics-1.3.0/python_orocos_kdl/CMakeLists.txt
+===================================================================
+--- orocos_kinematics_dynamics-1.3.0.orig/python_orocos_kdl/CMakeLists.txt
++++ orocos_kinematics_dynamics-1.3.0/python_orocos_kdl/CMakeLists.txt
+@@ -8,7 +8,7 @@ link_directories(${orocos_kdl_LIBRARY_DI
+
+ find_package(PythonInterp REQUIRED)
+ find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} REQUIRED)
+-execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=True, prefix='')" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
++execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
+ find_package(SIP REQUIRED)
+ include(SIPMacros)
+Index: orocos_kinematics_dynamics-1.3.0/python_orocos_kdl/PyKDL/std_string.sip
+===================================================================
+--- orocos_kinematics_dynamics-1.3.0.orig/python_orocos_kdl/PyKDL/std_string.sip
++++ orocos_kinematics_dynamics-1.3.0/python_orocos_kdl/PyKDL/std_string.sip
+@@ -27,7 +27,7 @@
+ newstring = PyUnicode_DecodeUTF8(sipCpp->c_str(), sipCpp->length(), NULL);
+ if(newstring == NULL) {
+ PyErr_Clear();
+- newstring = PyString_FromString(sipCpp->c_str());
++ newstring = PyUnicode_FromString(sipCpp->c_str());
+ }
+ return newstring;
+ %End
+@@ -38,21 +38,27 @@
+ // If argument is a Unicode string, just decode it to UTF-8
+ // If argument is a Python string, assume it's UTF-8
+ if (sipIsErr == NULL)
++#if PY_MAJOR_VERSION < 3
+ return (PyString_Check(sipPy) || PyUnicode_Check(sipPy));
++#else
++ return PyUnicode_Check(sipPy);
++#endif
+ if (sipPy == Py_None) {
+ *sipCppPtr = new std::string;
+ return 1;
+ }
+ if (PyUnicode_Check(sipPy)) {
+ PyObject* s = PyUnicode_AsEncodedString(sipPy, "UTF-8", "");
+- *sipCppPtr = new std::string(PyString_AS_STRING(s));
++ *sipCppPtr = new std::string(PyUnicode_AS_DATA(s));
+ Py_DECREF(s);
+ return 1;
+ }
++#if PY_MAJOR_VERSION < 3
+ if (PyString_Check(sipPy)) {
+ *sipCppPtr = new std::string(PyString_AS_STRING(sipPy));
+ return 1;
+ }
++#endif
+
+ return 0;
+ %End
--- /dev/null
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+SCM=""
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="http://github.com/orocos/orocos_kinematics_dynamics"
+fi
+
+inherit ${SCM} python-r1 cmake-utils
+
+if [ "${PV#9999}" != "${PV}" ] ; then
+ KEYWORDS=""
+ SRC_URI=""
+else
+ KEYWORDS="~amd64 ~arm"
+ SRC_URI="http://github.com/orocos/orocos_kinematics_dynamics/archive/v${PV}.tar.gz -> orocos_kinematics_dynamics-${PV}.tar.gz"
+fi
+
+DESCRIPTION="Python bindings for KDL"
+HOMEPAGE="http://www.orocos.org/kdl"
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE=""
+
+RDEPEND="
+ sci-libs/orocos_kdl
+ dev-python/sip[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+PATCHES=( "${FILESDIR}/py3.patch" )
+
+if [ "${PV#9999}" != "${PV}" ] ; then
+ S=${WORKDIR}/${P}/python_orocos_kdl
+else
+ S=${WORKDIR}/orocos_kinematics_dynamics-${PV}/python_orocos_kdl
+fi
+
+src_configure() {
+ python_foreach_impl cmake-utils_src_configure
+}
+
+src_compile() {
+ python_foreach_impl cmake-utils_src_compile
+}
+
+src_test() {
+ python_foreach_impl cmake-utils_src_test
+}
+
+src_install() {
+ python_foreach_impl cmake-utils_src_install
+}
--- /dev/null
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+SCM=""
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="http://github.com/orocos/orocos_kinematics_dynamics"
+fi
+
+inherit ${SCM} python-r1 cmake-utils
+
+if [ "${PV#9999}" != "${PV}" ] ; then
+ KEYWORDS=""
+ SRC_URI=""
+else
+ KEYWORDS="~amd64 ~arm"
+ SRC_URI="http://github.com/orocos/orocos_kinematics_dynamics/archive/v${PV}.tar.gz -> orocos_kinematics_dynamics-${PV}.tar.gz"
+fi
+
+DESCRIPTION="Python bindings for KDL"
+HOMEPAGE="http://www.orocos.org/kdl"
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE=""
+
+RDEPEND="
+ sci-libs/orocos_kdl
+ dev-python/sip[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+
+if [ "${PV#9999}" != "${PV}" ] ; then
+ S=${WORKDIR}/${P}/python_orocos_kdl
+else
+ S=${WORKDIR}/orocos_kinematics_dynamics-${PV}/python_orocos_kdl
+fi
+
+src_configure() {
+ python_foreach_impl cmake-utils_src_configure
+}
+
+src_compile() {
+ python_foreach_impl cmake-utils_src_compile
+}
+
+src_test() {
+ python_foreach_impl cmake-utils_src_test
+}
+
+src_install() {
+ python_foreach_impl cmake-utils_src_install
+}