From df81a0104c301303b0a7c2f4ea1d74dcb9e6a699 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Thu, 23 Jun 2022 11:06:23 +0200 Subject: dev-ros/ament_cmake_core: use unversionned python when building for gentoo this honours EPYTHON Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alexis Ballier --- .../ament_cmake_core-1.3.0-r1.ebuild | 47 ++++++++++++++++++++++ .../ament_cmake_core/ament_cmake_core-9999.ebuild | 3 +- dev-ros/ament_cmake_core/files/findpython.patch | 15 +++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 dev-ros/ament_cmake_core/ament_cmake_core-1.3.0-r1.ebuild create mode 100644 dev-ros/ament_cmake_core/files/findpython.patch (limited to 'dev-ros') diff --git a/dev-ros/ament_cmake_core/ament_cmake_core-1.3.0-r1.ebuild b/dev-ros/ament_cmake_core/ament_cmake_core-1.3.0-r1.ebuild new file mode 100644 index 000000000000..3e96c689fcb9 --- /dev/null +++ b/dev-ros/ament_cmake_core/ament_cmake_core-1.3.0-r1.ebuild @@ -0,0 +1,47 @@ +# Copyright 2019-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..10} ) + +inherit cmake python-any-r1 + +ROS_PN="ament_cmake" +if [ "${PV#9999}" != "${PV}" ] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/ament/ament_cmake" + SRC_URI="" + S=${WORKDIR}/${P}/${PN} +else + SRC_URI="https://github.com/ament/ament_cmake/archive/${PV}.tar.gz -> ${ROS_PN}-${PV}.tar.gz" + S="${WORKDIR}/${ROS_PN}-${PV}/${PN}" +fi + +DESCRIPTION="The core of the ament buildsystem in CMake" +HOMEPAGE="https://github.com/ament/ament_cmake" + +LICENSE="Apache-2.0" +SLOT="0" +if [ "${PV#9999}" != "${PV}" ] ; then + PROPERTIES="live" +else + KEYWORDS="~amd64" +fi +IUSE="" +PATCHES=( "${FILESDIR}/findpython.patch" ) + +RDEPEND=" + dev-python/ament_package + dev-python/catkin_pkg +" +DEPEND="${RDEPEND}" +BDEPEND=" + $(python_gen_any_dep 'dev-python/ament_package[${PYTHON_USEDEP}] dev-python/catkin_pkg[${PYTHON_USEDEP}]') + ${PYTHON_DEPS} +" + +python_check_deps() { + has_version "dev-python/ament_package[${PYTHON_USEDEP}]" && \ + has_version "dev-python/catkin_pkg[${PYTHON_USEDEP}]" +} diff --git a/dev-ros/ament_cmake_core/ament_cmake_core-9999.ebuild b/dev-ros/ament_cmake_core/ament_cmake_core-9999.ebuild index 0bc79bd3fd0c..3e96c689fcb9 100644 --- a/dev-ros/ament_cmake_core/ament_cmake_core-9999.ebuild +++ b/dev-ros/ament_cmake_core/ament_cmake_core-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 2019-2021 Gentoo Authors +# Copyright 2019-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -29,6 +29,7 @@ else KEYWORDS="~amd64" fi IUSE="" +PATCHES=( "${FILESDIR}/findpython.patch" ) RDEPEND=" dev-python/ament_package diff --git a/dev-ros/ament_cmake_core/files/findpython.patch b/dev-ros/ament_cmake_core/files/findpython.patch new file mode 100644 index 000000000000..790b0631b82c --- /dev/null +++ b/dev-ros/ament_cmake_core/files/findpython.patch @@ -0,0 +1,15 @@ +Index: ament_cmake_core/cmake/core/python.cmake +=================================================================== +--- ament_cmake_core.orig/cmake/core/python.cmake ++++ ament_cmake_core/cmake/core/python.cmake +@@ -17,6 +17,10 @@ + # Example: + # find_package(Python3 3.8 REQUIRED) + # find_package(ament_cmake REQUIRED) ++ ++if (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo) ++ set(Python3_FIND_UNVERSIONED_NAMES FIRST) ++endif() + if(NOT TARGET Python3::Interpreter) + find_package(Python3 REQUIRED COMPONENTS Interpreter) + endif() -- cgit v1.2.3-65-gdbad