From 7a248874093015abaf34f4845a583797f80f8002 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 7 Oct 2016 13:50:48 +0200 Subject: dev-util/catkin: Add CATKIN_PREFIX_PATH support to _setup_util.py.in. Patch by Eric Timmons. Bug #586104. Package-Manager: portage-2.3.1 --- dev-util/catkin/catkin-0.7.1-r1.ebuild | 100 +++++++++++++++++++++ dev-util/catkin/catkin-0.7.1.ebuild | 99 -------------------- dev-util/catkin/catkin-9999.ebuild | 3 +- .../catkin/files/catkin_prefix_path_util_py.patch | 16 ++++ 4 files changed, 118 insertions(+), 100 deletions(-) create mode 100644 dev-util/catkin/catkin-0.7.1-r1.ebuild delete mode 100644 dev-util/catkin/catkin-0.7.1.ebuild create mode 100644 dev-util/catkin/files/catkin_prefix_path_util_py.patch (limited to 'dev-util/catkin') diff --git a/dev-util/catkin/catkin-0.7.1-r1.ebuild b/dev-util/catkin/catkin-0.7.1-r1.ebuild new file mode 100644 index 000000000000..cf494b1753ee --- /dev/null +++ b/dev-util/catkin/catkin-0.7.1-r1.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +SCM="" +if [ "${PV#9999}" != "${PV}" ] ; then + SCM="git-r3" + EGIT_REPO_URI="https://github.com/ros/catkin" +fi + +PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) + +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" + +RDEPEND=" + dev-python/catkin_pkg[${PYTHON_USEDEP}] + dev-python/empy[${PYTHON_USEDEP}] +" +DEPEND="${RDEPEND} + test? ( dev-python/nose[${PYTHON_USEDEP}] dev-python/mock[${PYTHON_USEDEP}] )" + +PATCHES=( + "${FILESDIR}/tests.patch" + "${FILESDIR}/distutils.patch" + "${FILESDIR}/catkin_prefix_path.patch" + "${FILESDIR}/gnuinstalldirs.patch" + "${FILESDIR}/catkin_prefix_path_util_py.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() { + mycmakeargs+=( -DPYTHON_EXECUTABLE="${PYTHON}" ) + python_export PYTHON_SCRIPTDIR + cmake-utils_src_configure +} + +src_configure() { + local mycmakeargs=( + "$(cmake-utils_use test CATKIN_ENABLE_TESTING)" + "-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##*/}" || die + 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" +} diff --git a/dev-util/catkin/catkin-0.7.1.ebuild b/dev-util/catkin/catkin-0.7.1.ebuild deleted file mode 100644 index ddfc8ba1e712..000000000000 --- a/dev-util/catkin/catkin-0.7.1.ebuild +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=5 - -SCM="" -if [ "${PV#9999}" != "${PV}" ] ; then - SCM="git-r3" - EGIT_REPO_URI="https://github.com/ros/catkin" -fi - -PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) - -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" - -RDEPEND=" - dev-python/catkin_pkg[${PYTHON_USEDEP}] - dev-python/empy[${PYTHON_USEDEP}] -" -DEPEND="${RDEPEND} - test? ( dev-python/nose[${PYTHON_USEDEP}] dev-python/mock[${PYTHON_USEDEP}] )" - -PATCHES=( - "${FILESDIR}/tests.patch" - "${FILESDIR}/distutils.patch" - "${FILESDIR}/catkin_prefix_path.patch" - "${FILESDIR}/gnuinstalldirs.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() { - mycmakeargs+=( -DPYTHON_EXECUTABLE="${PYTHON}" ) - python_export PYTHON_SCRIPTDIR - cmake-utils_src_configure -} - -src_configure() { - local mycmakeargs=( - "$(cmake-utils_use test CATKIN_ENABLE_TESTING)" - "-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##*/}" || die - 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" -} diff --git a/dev-util/catkin/catkin-9999.ebuild b/dev-util/catkin/catkin-9999.ebuild index ddfc8ba1e712..cf494b1753ee 100644 --- a/dev-util/catkin/catkin-9999.ebuild +++ b/dev-util/catkin/catkin-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -40,6 +40,7 @@ PATCHES=( "${FILESDIR}/distutils.patch" "${FILESDIR}/catkin_prefix_path.patch" "${FILESDIR}/gnuinstalldirs.patch" + "${FILESDIR}/catkin_prefix_path_util_py.patch" ) src_prepare() { diff --git a/dev-util/catkin/files/catkin_prefix_path_util_py.patch b/dev-util/catkin/files/catkin_prefix_path_util_py.patch new file mode 100644 index 000000000000..d97817662e76 --- /dev/null +++ b/dev-util/catkin/files/catkin_prefix_path_util_py.patch @@ -0,0 +1,16 @@ +Author: Eric Timmons +https://bugs.gentoo.org/show_bug.cgi?id=586104 + +Index: catkin-0.6.16/cmake/templates/_setup_util.py.in +=================================================================== +--- catkin-0.6.16.orig/cmake/templates/_setup_util.py.in ++++ catkin-0.6.16/cmake/templates/_setup_util.py.in +@@ -262,7 +262,7 @@ + sys.exit(1) + + # environment at generation time +- CMAKE_PREFIX_PATH = '@CMAKE_PREFIX_PATH_AS_IS@'.split(';') ++ CMAKE_PREFIX_PATH = '@CATKIN_PREFIX_PATH@;@CMAKE_PREFIX_PATH_AS_IS@'.split(';') + # prepend current workspace if not already part of CPP + base_path = os.path.dirname(__file__) + if base_path not in CMAKE_PREFIX_PATH: -- cgit v1.2.3-65-gdbad