From 022f150b8d86abac12c77f73ac86e88b3d813f36 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Thu, 4 Jun 2020 15:07:10 +0200 Subject: dev-util/catkin: fix python script install. Closes: https://bugs.gentoo.org/726414 Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Alexis Ballier --- dev-util/catkin/catkin-0.8.3-r1.ebuild | 125 +++++++++++++++++++++++++++++++ dev-util/catkin/catkin-0.8.3.ebuild | 124 ------------------------------ dev-util/catkin/catkin-9999.ebuild | 1 + dev-util/catkin/files/distutils-v2.patch | 13 ++++ 4 files changed, 139 insertions(+), 124 deletions(-) create mode 100644 dev-util/catkin/catkin-0.8.3-r1.ebuild delete mode 100644 dev-util/catkin/catkin-0.8.3.ebuild create mode 100644 dev-util/catkin/files/distutils-v2.patch (limited to 'dev-util/catkin') diff --git a/dev-util/catkin/catkin-0.8.3-r1.ebuild b/dev-util/catkin/catkin-0.8.3-r1.ebuild new file mode 100644 index 000000000000..adf1b136a8c7 --- /dev/null +++ b/dev-util/catkin/catkin-0.8.3-r1.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +SCM="" +if [ "${PV#9999}" != "${PV}" ] ; then + SCM="git-r3" + EGIT_REPO_URI="https://github.com/ros/catkin" +fi + +PYTHON_COMPAT=( python{3_6,3_7,3_8} ) + +inherit ${SCM} cmake-utils python-r1 python-utils-r1 + +DESCRIPTION="Cmake macros and associated python code used to build some parts of ROS" +HOMEPAGE="http://wiki.ros.org/catkin" +if [ "${PV#9999}" != "${PV}" ] ; then + SRC_URI="" + KEYWORDS="" +else + SRC_URI="https://github.com/ros/catkin/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm" +fi + +LICENSE="BSD" +SLOT="0" +IUSE="test" +RESTRICT="!test? ( test )" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND=" + ${PYTHON_DEPS} + dev-python/catkin_pkg[${PYTHON_USEDEP}] + dev-python/empy[${PYTHON_USEDEP}] + dev-util/cmake +" +DEPEND="${RDEPEND} + test? ( dev-python/nose[${PYTHON_USEDEP}] dev-python/mock[${PYTHON_USEDEP}] )" +BDEPEND=" + dev-util/cmake +" + +PATCHES=( + "${FILESDIR}/tests.patch" + "${FILESDIR}/distutils-v2.patch" + "${FILESDIR}/catkin_prefix_path.patch" + "${FILESDIR}/gnuinstalldirs.patch" + "${FILESDIR}/catkin_prefix_path_util_py_v2.patch" + "${FILESDIR}/package_xml.patch" + "${FILESDIR}/etc.patch" + "${FILESDIR}/egginfo.patch" +) + +src_prepare() { + # fix libdir + sed -i \ + -e 's:LIBEXEC_DESTINATION lib:LIBEXEC_DESTINATION libexec:' \ + -e 's:}/lib:}/${CMAKE_INSTALL_LIBDIR}:' \ + -e 's:DESTINATION lib):DESTINATION ${CMAKE_INSTALL_LIBDIR}):' \ + -e 's:DESTINATION lib/:DESTINATION ${CMAKE_INSTALL_LIBDIR}/:' \ + -e 's:PYTHON_INSTALL_DIR lib:PYTHON_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}:' \ + cmake/*.cmake || die + cmake-utils_src_prepare +} + +catkin_src_configure_internal() { + local sitedir="$(python_get_sitedir)" + mycmakeargs+=( + -DPYTHON_EXECUTABLE="${PYTHON}" + -DPYTHON_INSTALL_DIR="${sitedir#${EPREFIX}/usr/}" + ) + python_export PYTHON_SCRIPTDIR + cmake-utils_src_configure +} + +src_configure() { + export PYTHONPATH="${S}/python" + local mycmakeargs=( + "-DCATKIN_ENABLE_TESTING=$(usex test)" + "-DCATKIN_BUILD_BINARY_PACKAGE=ON" + ) + python_foreach_impl catkin_src_configure_internal +} + +src_compile() { + python_foreach_impl cmake-utils_src_compile +} + +src_test() { + unset PYTHON_SCRIPTDIR + python_foreach_impl cmake-utils_src_test +} + +catkin_src_install_internal() { + python_export PYTHON_SCRIPTDIR + cmake-utils_src_install + if [ ! -f "${T}/.catkin_python_symlinks_generated" ]; then + dodir /usr/bin + for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do + dosym ../lib/python-exec/python-exec2 "/usr/bin/${i##*/}" + done + touch "${T}/.catkin_python_symlinks_generated" + fi +} + +src_install() { + python_foreach_impl catkin_src_install_internal + + doenvd "${FILESDIR}/40catkin" + + # needed to be considered as a workspace + touch "${ED}/usr/.catkin" + + python_foreach_impl python_optimize +} + +pkg_postinst() { + ewarn "Starting from version 0.7.1-r2, dev-util/catkin changed the" + ewarn "installation path for package.xml files on Gentoo." + ewarn "In order for ROS to work properly, you will need to reinstall ROS" + ewarn "packages that have it installed in the old location:" + ewarn " emerge -1O /usr/share/*/package.xml" + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=595004 for more details." +} diff --git a/dev-util/catkin/catkin-0.8.3.ebuild b/dev-util/catkin/catkin-0.8.3.ebuild deleted file mode 100644 index c37940ea8dfe..000000000000 --- a/dev-util/catkin/catkin-0.8.3.ebuild +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -SCM="" -if [ "${PV#9999}" != "${PV}" ] ; then - SCM="git-r3" - EGIT_REPO_URI="https://github.com/ros/catkin" -fi - -PYTHON_COMPAT=( python{3_6,3_7,3_8} ) - -inherit ${SCM} cmake-utils python-r1 python-utils-r1 - -DESCRIPTION="Cmake macros and associated python code used to build some parts of ROS" -HOMEPAGE="http://wiki.ros.org/catkin" -if [ "${PV#9999}" != "${PV}" ] ; then - SRC_URI="" - KEYWORDS="" -else - SRC_URI="https://github.com/ros/catkin/archive/${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~arm" -fi - -LICENSE="BSD" -SLOT="0" -IUSE="test" -RESTRICT="!test? ( test )" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -RDEPEND=" - ${PYTHON_DEPS} - dev-python/catkin_pkg[${PYTHON_USEDEP}] - dev-python/empy[${PYTHON_USEDEP}] - dev-util/cmake -" -DEPEND="${RDEPEND} - test? ( dev-python/nose[${PYTHON_USEDEP}] dev-python/mock[${PYTHON_USEDEP}] )" -BDEPEND=" - dev-util/cmake -" - -PATCHES=( - "${FILESDIR}/tests.patch" - "${FILESDIR}/catkin_prefix_path.patch" - "${FILESDIR}/gnuinstalldirs.patch" - "${FILESDIR}/catkin_prefix_path_util_py_v2.patch" - "${FILESDIR}/package_xml.patch" - "${FILESDIR}/etc.patch" - "${FILESDIR}/egginfo.patch" -) - -src_prepare() { - # fix libdir - sed -i \ - -e 's:LIBEXEC_DESTINATION lib:LIBEXEC_DESTINATION libexec:' \ - -e 's:}/lib:}/${CMAKE_INSTALL_LIBDIR}:' \ - -e 's:DESTINATION lib):DESTINATION ${CMAKE_INSTALL_LIBDIR}):' \ - -e 's:DESTINATION lib/:DESTINATION ${CMAKE_INSTALL_LIBDIR}/:' \ - -e 's:PYTHON_INSTALL_DIR lib:PYTHON_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}:' \ - cmake/*.cmake || die - cmake-utils_src_prepare -} - -catkin_src_configure_internal() { - local sitedir="$(python_get_sitedir)" - mycmakeargs+=( - -DPYTHON_EXECUTABLE="${PYTHON}" - -DPYTHON_INSTALL_DIR="${sitedir#${EPREFIX}/usr/}" - ) - python_export PYTHON_SCRIPTDIR - cmake-utils_src_configure -} - -src_configure() { - export PYTHONPATH="${S}/python" - local mycmakeargs=( - "-DCATKIN_ENABLE_TESTING=$(usex test)" - "-DCATKIN_BUILD_BINARY_PACKAGE=ON" - ) - python_foreach_impl catkin_src_configure_internal -} - -src_compile() { - python_foreach_impl cmake-utils_src_compile -} - -src_test() { - unset PYTHON_SCRIPTDIR - python_foreach_impl cmake-utils_src_test -} - -catkin_src_install_internal() { - python_export PYTHON_SCRIPTDIR - cmake-utils_src_install - if [ ! -f "${T}/.catkin_python_symlinks_generated" ]; then - dodir /usr/bin - for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do - dosym ../lib/python-exec/python-exec2 "/usr/bin/${i##*/}" - done - touch "${T}/.catkin_python_symlinks_generated" - fi -} - -src_install() { - python_foreach_impl catkin_src_install_internal - - doenvd "${FILESDIR}/40catkin" - - # needed to be considered as a workspace - touch "${ED}/usr/.catkin" - - python_foreach_impl python_optimize -} - -pkg_postinst() { - ewarn "Starting from version 0.7.1-r2, dev-util/catkin changed the" - ewarn "installation path for package.xml files on Gentoo." - ewarn "In order for ROS to work properly, you will need to reinstall ROS" - ewarn "packages that have it installed in the old location:" - ewarn " emerge -1O /usr/share/*/package.xml" - ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=595004 for more details." -} diff --git a/dev-util/catkin/catkin-9999.ebuild b/dev-util/catkin/catkin-9999.ebuild index c37940ea8dfe..adf1b136a8c7 100644 --- a/dev-util/catkin/catkin-9999.ebuild +++ b/dev-util/catkin/catkin-9999.ebuild @@ -43,6 +43,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}/tests.patch" + "${FILESDIR}/distutils-v2.patch" "${FILESDIR}/catkin_prefix_path.patch" "${FILESDIR}/gnuinstalldirs.patch" "${FILESDIR}/catkin_prefix_path_util_py_v2.patch" diff --git a/dev-util/catkin/files/distutils-v2.patch b/dev-util/catkin/files/distutils-v2.patch new file mode 100644 index 000000000000..cb3aab220b05 --- /dev/null +++ b/dev-util/catkin/files/distutils-v2.patch @@ -0,0 +1,13 @@ +Allow to install scripts in PYTHON_SCRIPTDIR. +Needed for Gentoo multi-python support. + +Index: catkin-0.8.3/cmake/templates/python_distutils_install.sh.in +=================================================================== +--- catkin-0.8.3.orig/cmake/templates/python_distutils_install.sh.in ++++ catkin-0.8.3/cmake/templates/python_distutils_install.sh.in +@@ -30,4 +30,4 @@ echo_and_run /usr/bin/env \ + build --build-base "@CMAKE_CURRENT_BINARY_DIR@" \ + install \ + --root="${DESTDIR-/}" \ +- @SETUPTOOLS_ARG_EXTRA@ --prefix="@CMAKE_INSTALL_PREFIX@" --install-scripts="@CMAKE_INSTALL_PREFIX@/@CATKIN_GLOBAL_BIN_DESTINATION@" ++ @SETUPTOOLS_ARG_EXTRA@ --prefix="@CMAKE_INSTALL_PREFIX@" --install-scripts="${PYTHON_SCRIPTDIR:-@CMAKE_INSTALL_PREFIX@/@CATKIN_GLOBAL_BIN_DESTINATION@}" -- cgit v1.2.3-65-gdbad