# Provides function for building ROS packages on Gentoo.
# It supports selectively building messages, multi-python installation, live ebuilds (git only).
+# @ECLASS-VARIABLE: CMAKE_ECLASS
+# @INTERNAL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set to "cmake-utils" for EAPI 5 and 6, "cmake" for EAPI-7.
+
case "${EAPI:-0}" in
0|1|2|3|4)
die "EAPI='${EAPI}' is not supported"
;;
+ [56])
+ CMAKE_ECLASS=cmake-utils
+ ;;
*)
+ CMAKE_ECLASS=cmake
;;
esac
# most certainly be something pulling python anyway.
PYTHON_COMPAT=( python3_6 )
-inherit ${SCM} python-r1 cmake-utils flag-o-matic
+inherit ${SCM} python-r1 ${CMAKE_ECLASS} flag-o-matic
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
# @FUNCTION: ros-catkin_src_prepare
# @DESCRIPTION:
-# Calls cmake-utils_src_prepare (so that PATCHES array is handled there) and initialises the workspace
+# Calls cmake_src_prepare (so that PATCHES array is handled there) and initialises the workspace
# by installing a recursive CMakeLists.txt to handle bundles.
ros-catkin_src_prepare() {
# If no multibuild, just use cmake IN_SOURCE support
[ -n "${CATKIN_IN_SOURCE_BUILD}" ] && export CMAKE_IN_SOURCE_BUILD=yes
- cmake-utils_src_prepare
+ ${CMAKE_ECLASS}_src_prepare
if [ ! -f "${S}/CMakeLists.txt" ] ; then
catkin_init_workspace || die
fi
local mycmakeargs=(
- "$(cmake-utils_use test CATKIN_ENABLE_TESTING)"
+ "-DCATKIN_ENABLE_TESTING=$(usex test)"
"-DCATKIN_BUILD_BINARY_PACKAGE=ON"
"-DCATKIN_PREFIX_PATH=${SYSROOT:-${EROOT}}/usr"
"${mycatkincmakeargs[@]}"
export CMAKE_USE_DIR="${BUILD_DIR}"
fi
- cmake-utils_src_configure "${@}"
+ ${CMAKE_ECLASS}_src_configure "${@}"
}
# @FUNCTION: ros-catkin_src_compile
# Builds a catkin-based package.
ros-catkin_src_compile() {
ros-catkin_python_setup
- cmake-utils_src_compile "${@}"
+ ${CMAKE_ECLASS}_src_compile "${@}"
}
# @FUNCTION: ros-catkin_src_test
einfo "Regenerating setup_cached.sh for tests"
${PYTHON:-python} catkin_generated/generate_cached_setup.py || die
fi
- nonfatal cmake-utils_src_make tests
- cmake-utils_src_test "${@}"
+
+ if [[ ${CMAKE_ECLASS} = cmake-utils ]]; then
+ nonfatal cmake-utils_src_make tests
+ else
+ nonfatal cmake_build tests
+ fi
+ ${CMAKE_ECLASS}_src_test "${@}"
}
# @FUNCTION: ros-catkin_src_install
export CMAKE_USE_DIR="${BUILD_DIR}"
fi
- cmake-utils_src_install "${@}"
+ ${CMAKE_ECLASS}_src_install "${@}"
if [ ! -f "${T}/.catkin_python_symlinks_generated" -a -d "${D}/${PYTHON_SCRIPTDIR}" ]; then
dodir /usr/bin
for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do