summaryrefslogtreecommitdiff
path: root/eclass/cmake-utils.eclass
diff options
context:
space:
mode:
authorMichael Palimaka <kensington@gentoo.org>2015-11-18 20:26:52 +1100
committerMichael Palimaka <kensington@gentoo.org>2015-11-18 20:26:59 +1100
commit28ab4b2c0a74db3800bb8d2796644bed7b5b89fd (patch)
tree93eac2a7d33104f58fa8e31c377fb9e46535db7b /eclass/cmake-utils.eclass
parent932db652b0e2a855f70d0fa2f1ed1e1efd3e0127 (diff)
downloadkde-28ab4b2c0a74db3800bb8d2796644bed7b5b89fd.tar.gz
kde-28ab4b2c0a74db3800bb8d2796644bed7b5b89fd.tar.bz2
kde-28ab4b2c0a74db3800bb8d2796644bed7b5b89fd.zip
cmake-utils.eclass: move $S modifications to src_prepare in EAPI 6 and later
This is the correct phase for source modifications, and additionally avoids a multilib race condition. Gentoo-bug: 513170
Diffstat (limited to 'eclass/cmake-utils.eclass')
-rw-r--r--eclass/cmake-utils.eclass44
1 files changed, 27 insertions, 17 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index c3184bd2ec6..b7265896e63 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -397,11 +397,37 @@ _modify-cmakelists() {
_EOF_
}
+# temporary function for moving cmake cleanups from from src_configure -> src_prepare.
+# bug #378850
+_cleanup_cmake() {
+ : ${CMAKE_USE_DIR:=${S}}
+
+ [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] && {
+ local name
+ for name in ${CMAKE_REMOVE_MODULES_LIST} ; do
+ find "${S}" -name ${name}.cmake -exec rm -v {} +
+ done
+ }
+
+ # check if CMakeLists.txt exist and if no then die
+ if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
+ eerror "Unable to locate CMakeLists.txt under:"
+ eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\""
+ eerror "Consider not inheriting the cmake eclass."
+ die "FATAL: Unable to find CMakeLists.txt"
+ fi
+
+ # Remove dangerous things.
+ _modify-cmakelists
+}
+
enable_cmake-utils_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
pushd "${S}" > /dev/null || die
+ has "${EAPI:-0}" 6 && _cleanup_cmake
+
debug-print "$FUNCNAME: PATCHES=$PATCHES"
[[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
@@ -429,26 +455,10 @@ enable_cmake-utils_src_prepare() {
enable_cmake-utils_src_configure() {
debug-print-function ${FUNCNAME} "$@"
- [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] && {
- local name
- for name in ${CMAKE_REMOVE_MODULES_LIST} ; do
- find "${S}" -name ${name}.cmake -exec rm -v {} +
- done
- }
+ has "${EAPI:-0}" 2 3 4 5 && _cleanup_cmake
_check_build_dir
- # check if CMakeLists.txt exist and if no then die
- if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
- eerror "Unable to locate CMakeLists.txt under:"
- eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\""
- eerror "Consider not inheriting the cmake eclass."
- die "FATAL: Unable to find CMakeLists.txt"
- fi
-
- # Remove dangerous things.
- _modify-cmakelists
-
# Fix xdg collision with sandbox
export XDG_CONFIG_HOME="${T}"