12
12
# Provides function for building ROS packages on Gentoo.
13
13
# It supports selectively building messages, multi-python installation, live ebuilds (git only).
14
14
15
+ # @ECLASS-VARIABLE: CMAKE_ECLASS
16
+ # @INTERNAL
17
+ # @DEFAULT_UNSET
18
+ # @DESCRIPTION:
19
+ # Set to "cmake-utils" for EAPI 5 and 6, "cmake" for EAPI-7.
20
+
15
21
case " ${EAPI:- 0} " in
16
22
0|1|2|3|4)
17
23
die " EAPI='${EAPI} ' is not supported"
18
24
;;
25
+ [56])
26
+ CMAKE_ECLASS=cmake-utils
27
+ ;;
19
28
* )
29
+ CMAKE_ECLASS=cmake
20
30
;;
21
31
esac
22
32
51
61
# most certainly be something pulling python anyway.
52
62
PYTHON_COMPAT=( python3_6 )
53
63
54
- inherit ${SCM} python-r1 cmake-utils flag-o-matic
64
+ inherit ${SCM} python-r1 ${CMAKE_ECLASS} flag-o-matic
55
65
56
66
REQUIRED_USE=" ${PYTHON_REQUIRED_USE} "
57
67
@@ -134,13 +144,13 @@ HOMEPAGE="https://wiki.ros.org/${PN} ${ROS_REPO_URI}"
134
144
135
145
# @FUNCTION: ros-catkin_src_prepare
136
146
# @DESCRIPTION:
137
- # Calls cmake-utils_src_prepare (so that PATCHES array is handled there) and initialises the workspace
147
+ # Calls cmake_src_prepare (so that PATCHES array is handled there) and initialises the workspace
138
148
# by installing a recursive CMakeLists.txt to handle bundles.
139
149
ros-catkin_src_prepare () {
140
150
# If no multibuild, just use cmake IN_SOURCE support
141
151
[ -n " ${CATKIN_IN_SOURCE_BUILD} " ] && export CMAKE_IN_SOURCE_BUILD=yes
142
152
143
- cmake-utils_src_prepare
153
+ ${CMAKE_ECLASS} _src_prepare
144
154
145
155
if [ ! -f " ${S} /CMakeLists.txt" ] ; then
146
156
catkin_init_workspace || die
@@ -187,7 +197,7 @@ ros-catkin_src_configure() {
187
197
fi
188
198
189
199
local mycmakeargs=(
190
- " $( cmake-utils_use test CATKIN_ENABLE_TESTING ) "
200
+ " -DCATKIN_ENABLE_TESTING= $( usex test) "
191
201
" -DCATKIN_BUILD_BINARY_PACKAGE=ON"
192
202
" -DCATKIN_PREFIX_PATH=${SYSROOT:- ${EROOT} } /usr"
193
203
" ${mycatkincmakeargs[@]} "
@@ -202,15 +212,15 @@ ros-catkin_src_configure() {
202
212
export CMAKE_USE_DIR=" ${BUILD_DIR} "
203
213
fi
204
214
205
- cmake-utils_src_configure " ${@ } "
215
+ ${CMAKE_ECLASS} _src_configure " ${@ } "
206
216
}
207
217
208
218
# @FUNCTION: ros-catkin_src_compile
209
219
# @DESCRIPTION:
210
220
# Builds a catkin-based package.
211
221
ros-catkin_src_compile () {
212
222
ros-catkin_python_setup
213
- cmake-utils_src_compile " ${@ } "
223
+ ${CMAKE_ECLASS} _src_compile " ${@ } "
214
224
}
215
225
216
226
# @FUNCTION: ros-catkin_src_test
@@ -226,8 +236,13 @@ ros-catkin_src_test() {
226
236
einfo " Regenerating setup_cached.sh for tests"
227
237
${PYTHON:- python} catkin_generated/generate_cached_setup.py || die
228
238
fi
229
- nonfatal cmake-utils_src_make tests
230
- cmake-utils_src_test " ${@ } "
239
+
240
+ if [[ ${CMAKE_ECLASS} = cmake-utils ]]; then
241
+ nonfatal cmake-utils_src_make tests
242
+ else
243
+ nonfatal cmake_build tests
244
+ fi
245
+ ${CMAKE_ECLASS} _src_test " ${@ } "
231
246
}
232
247
233
248
# @FUNCTION: ros-catkin_src_install
@@ -240,7 +255,7 @@ ros-catkin_src_install() {
240
255
export CMAKE_USE_DIR=" ${BUILD_DIR} "
241
256
fi
242
257
243
- cmake-utils_src_install " ${@ } "
258
+ ${CMAKE_ECLASS} _src_install " ${@ } "
244
259
if [ ! -f " ${T} /.catkin_python_symlinks_generated" -a -d " ${D} /${PYTHON_SCRIPTDIR} " ]; then
245
260
dodir /usr/bin
246
261
for i in " ${D} /${PYTHON_SCRIPTDIR} " /* ; do
0 commit comments