Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 20 Jan 2020 23:58:52
Message-Id: 1579564692.3e750691310ccd0c42d79361704ba094d5c84c24.asturm@gentoo
1 commit: 3e750691310ccd0c42d79361704ba094d5c84c24
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 19 00:11:33 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 20 23:58:12 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e750691
7
8 ros-catkin.eclass: Fix EAPI-7 support, support cmake.eclass
9
10 Use of EAPI-7 was broken so far because cmake-utils_use is banned.
11
12 Closes: https://bugs.gentoo.org/705798
13 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
14
15 eclass/ros-catkin.eclass | 33 ++++++++++++++++++++++++---------
16 1 file changed, 24 insertions(+), 9 deletions(-)
17
18 diff --git a/eclass/ros-catkin.eclass b/eclass/ros-catkin.eclass
19 index d560f804e65..b096fd47710 100644
20 --- a/eclass/ros-catkin.eclass
21 +++ b/eclass/ros-catkin.eclass
22 @@ -12,11 +12,21 @@
23 # Provides function for building ROS packages on Gentoo.
24 # It supports selectively building messages, multi-python installation, live ebuilds (git only).
25
26 +# @ECLASS-VARIABLE: CMAKE_ECLASS
27 +# @INTERNAL
28 +# @DEFAULT_UNSET
29 +# @DESCRIPTION:
30 +# Set to "cmake-utils" for EAPI 5 and 6, "cmake" for EAPI-7.
31 +
32 case "${EAPI:-0}" in
33 0|1|2|3|4)
34 die "EAPI='${EAPI}' is not supported"
35 ;;
36 + [56])
37 + CMAKE_ECLASS=cmake-utils
38 + ;;
39 *)
40 + CMAKE_ECLASS=cmake
41 ;;
42 esac
43
44 @@ -51,7 +61,7 @@ fi
45 # most certainly be something pulling python anyway.
46 PYTHON_COMPAT=( python3_6 )
47
48 -inherit ${SCM} python-r1 cmake-utils flag-o-matic
49 +inherit ${SCM} python-r1 ${CMAKE_ECLASS} flag-o-matic
50
51 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
52
53 @@ -134,13 +144,13 @@ HOMEPAGE="https://wiki.ros.org/${PN} ${ROS_REPO_URI}"
54
55 # @FUNCTION: ros-catkin_src_prepare
56 # @DESCRIPTION:
57 -# Calls cmake-utils_src_prepare (so that PATCHES array is handled there) and initialises the workspace
58 +# Calls cmake_src_prepare (so that PATCHES array is handled there) and initialises the workspace
59 # by installing a recursive CMakeLists.txt to handle bundles.
60 ros-catkin_src_prepare() {
61 # If no multibuild, just use cmake IN_SOURCE support
62 [ -n "${CATKIN_IN_SOURCE_BUILD}" ] && export CMAKE_IN_SOURCE_BUILD=yes
63
64 - cmake-utils_src_prepare
65 + ${CMAKE_ECLASS}_src_prepare
66
67 if [ ! -f "${S}/CMakeLists.txt" ] ; then
68 catkin_init_workspace || die
69 @@ -187,7 +197,7 @@ ros-catkin_src_configure() {
70 fi
71
72 local mycmakeargs=(
73 - "$(cmake-utils_use test CATKIN_ENABLE_TESTING)"
74 + "-DCATKIN_ENABLE_TESTING=$(usex test)"
75 "-DCATKIN_BUILD_BINARY_PACKAGE=ON"
76 "-DCATKIN_PREFIX_PATH=${SYSROOT:-${EROOT}}/usr"
77 "${mycatkincmakeargs[@]}"
78 @@ -202,7 +212,7 @@ ros-catkin_src_configure() {
79 export CMAKE_USE_DIR="${BUILD_DIR}"
80 fi
81
82 - cmake-utils_src_configure "${@}"
83 + ${CMAKE_ECLASS}_src_configure "${@}"
84 }
85
86 # @FUNCTION: ros-catkin_src_compile
87 @@ -210,7 +220,7 @@ ros-catkin_src_configure() {
88 # Builds a catkin-based package.
89 ros-catkin_src_compile() {
90 ros-catkin_python_setup
91 - cmake-utils_src_compile "${@}"
92 + ${CMAKE_ECLASS}_src_compile "${@}"
93 }
94
95 # @FUNCTION: ros-catkin_src_test
96 @@ -226,8 +236,13 @@ ros-catkin_src_test() {
97 einfo "Regenerating setup_cached.sh for tests"
98 ${PYTHON:-python} catkin_generated/generate_cached_setup.py || die
99 fi
100 - nonfatal cmake-utils_src_make tests
101 - cmake-utils_src_test "${@}"
102 +
103 + if [[ ${CMAKE_ECLASS} = cmake-utils ]]; then
104 + nonfatal cmake-utils_src_make tests
105 + else
106 + nonfatal cmake_build tests
107 + fi
108 + ${CMAKE_ECLASS}_src_test "${@}"
109 }
110
111 # @FUNCTION: ros-catkin_src_install
112 @@ -240,7 +255,7 @@ ros-catkin_src_install() {
113 export CMAKE_USE_DIR="${BUILD_DIR}"
114 fi
115
116 - cmake-utils_src_install "${@}"
117 + ${CMAKE_ECLASS}_src_install "${@}"
118 if [ ! -f "${T}/.catkin_python_symlinks_generated" -a -d "${D}/${PYTHON_SCRIPTDIR}" ]; then
119 dodir /usr/bin
120 for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do