1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 if [ "${PV#9999}" != "${PV}" ] ; then
9 EGIT_REPO_URI="https://github.com/ros/catkin"
12 PYTHON_COMPAT=( python{3_6,3_7,3_8} )
14 inherit ${SCM} cmake-utils python-r1 python-utils-r1
16 DESCRIPTION="Cmake macros and associated python code used to build some parts of ROS"
17 HOMEPAGE="http://wiki.ros.org/catkin"
18 if [ "${PV#9999}" != "${PV}" ] ; then
22 SRC_URI="https://github.com/ros/catkin/archive/${PV}.tar.gz -> ${P}.tar.gz"
23 KEYWORDS="~amd64 ~arm"
29 RESTRICT="!test? ( test )"
30 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
34 dev-python/catkin_pkg[${PYTHON_USEDEP}]
35 dev-python/empy[${PYTHON_USEDEP}]
39 test? ( dev-python/nose[${PYTHON_USEDEP}] dev-python/mock[${PYTHON_USEDEP}] )"
45 "${FILESDIR}/tests.patch"
46 "${FILESDIR}/catkin_prefix_path.patch"
47 "${FILESDIR}/gnuinstalldirs.patch"
48 "${FILESDIR}/catkin_prefix_path_util_py_v2.patch"
49 "${FILESDIR}/package_xml.patch"
50 "${FILESDIR}/etc.patch"
51 "${FILESDIR}/egginfo.patch"
57 -e 's:LIBEXEC_DESTINATION lib:LIBEXEC_DESTINATION libexec:' \
58 -e 's:}/lib:}/${CMAKE_INSTALL_LIBDIR}:' \
59 -e 's:DESTINATION lib):DESTINATION ${CMAKE_INSTALL_LIBDIR}):' \
60 -e 's:DESTINATION lib/:DESTINATION ${CMAKE_INSTALL_LIBDIR}/:' \
61 -e 's:PYTHON_INSTALL_DIR lib:PYTHON_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}:' \
63 cmake-utils_src_prepare
66 catkin_src_configure_internal() {
67 local sitedir="$(python_get_sitedir)"
69 -DPYTHON_EXECUTABLE="${PYTHON}"
70 -DPYTHON_INSTALL_DIR="${sitedir#${EPREFIX}/usr/}"
72 python_export PYTHON_SCRIPTDIR
73 cmake-utils_src_configure
77 export PYTHONPATH="${S}/python"
79 "-DCATKIN_ENABLE_TESTING=$(usex test)"
80 "-DCATKIN_BUILD_BINARY_PACKAGE=ON"
82 python_foreach_impl catkin_src_configure_internal
86 python_foreach_impl cmake-utils_src_compile
90 unset PYTHON_SCRIPTDIR
91 python_foreach_impl cmake-utils_src_test
94 catkin_src_install_internal() {
95 python_export PYTHON_SCRIPTDIR
96 cmake-utils_src_install
97 if [ ! -f "${T}/.catkin_python_symlinks_generated" ]; then
99 for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do
100 dosym ../lib/python-exec/python-exec2 "/usr/bin/${i##*/}"
102 touch "${T}/.catkin_python_symlinks_generated"
107 python_foreach_impl catkin_src_install_internal
109 doenvd "${FILESDIR}/40catkin"
111 # needed to be considered as a workspace
112 touch "${ED}/usr/.catkin"
114 python_foreach_impl python_optimize
118 ewarn "Starting from version 0.7.1-r2, dev-util/catkin changed the"
119 ewarn "installation path for package.xml files on Gentoo."
120 ewarn "In order for ROS to work properly, you will need to reinstall ROS"
121 ewarn "packages that have it installed in the old location:"
122 ewarn " emerge -1O /usr/share/*/package.xml"
123 ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=595004 for more details."