diff options
author | David Seifert <soap@gentoo.org> | 2017-05-21 10:09:50 +0200 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2017-05-21 11:25:13 +0200 |
commit | e913eed6230d8ddda77278577cbc0ff98d0526b7 (patch) | |
tree | a440ec2ea3dc6fd1b158bc49adedee94820b053e /eclass | |
parent | cmake-utils.eclass: Remove WANT_CMAKE and warn users (diff) | |
download | gentoo-e913eed6230d8ddda77278577cbc0ff98d0526b7.tar.gz gentoo-e913eed6230d8ddda77278577cbc0ff98d0526b7.tar.bz2 gentoo-e913eed6230d8ddda77278577cbc0ff98d0526b7.zip |
cmake-utils.eclass: Remove support for EAPIs 0 - 4
Closes: https://github.com/gentoo/gentoo/pull/4528
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/cmake-utils.eclass | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 6ae324093be5..b326ef717dca 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -101,7 +101,7 @@ _CMAKE_UTILS_ECLASS=1 # Should be set by user in a per-package basis in /etc/portage/package.env. case ${EAPI} in - 2|4|5) : ${CMAKE_WARN_UNUSED_CLI:=no} ;; + 5) : ${CMAKE_WARN_UNUSED_CLI:=no} ;; 6) : ${CMAKE_WARN_UNUSED_CLI:=yes} ;; *) die "EAPI=${EAPI:-0} is not supported" ;; esac @@ -137,7 +137,7 @@ _cmake_use_me_now() { local arg=$2 [[ ! -z $3 ]] && arg=$3 - [[ ${EAPI} == [2345] ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead" + [[ ${EAPI} == 5 ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead" local uper capitalised x [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" @@ -159,7 +159,7 @@ _cmake_use_me_now_inverted() { local arg=$2 [[ ! -z $3 ]] && arg=$3 - if [[ ${EAPI} != [2345] && "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then + if [[ ${EAPI} != 5 && "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead" fi @@ -259,7 +259,7 @@ cmake_comment_add_subdirectory() { # Comment out an add_subdirectory call in CMakeLists.txt in the current directory # Banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead. comment_add_subdirectory() { - [[ ${EAPI} == [2345] ]] || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead" + [[ ${EAPI} == 5 ]] || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead" cmake_comment_add_subdirectory "$@" } @@ -291,7 +291,7 @@ cmake-utils_use_enable() { _cmake_use_me_now ENABLE_ "$@" ; } # if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=ON if it is disabled. # This can be used to make find_package optional. cmake-utils_use_find_package() { - if [[ ${EAPI} != [2345] && "$#" != 2 ]] ; then + if [[ ${EAPI} != 5 && "$#" != 2 ]] ; then die "Usage: cmake-utils_use_find_package <USE flag> <package name>" fi @@ -432,7 +432,7 @@ enable_cmake-utils_src_prepare() { pushd "${S}" > /dev/null || die - if [[ ${EAPI} != [2345] ]]; then + if [[ ${EAPI} != 5 ]]; then default_src_prepare _cmake_cleanup_cmake else @@ -464,7 +464,7 @@ enable_cmake-utils_src_prepare() { enable_cmake-utils_src_configure() { debug-print-function ${FUNCNAME} "$@" - [[ ${EAPI} == [2345] ]] && _cmake_cleanup_cmake + [[ ${EAPI} == 5 ]] && _cmake_cleanup_cmake _cmake_check_build_dir @@ -552,8 +552,6 @@ enable_cmake-utils_src_configure() { fi fi - [[ ${EAPI} == 2 ]] && ! use prefix && local EPREFIX= - if [[ ${EPREFIX} ]]; then cat >> "${build_rules}" <<- _EOF_ || die # in Prefix we need rpath and must ensure cmake gets our default linker path @@ -588,7 +586,7 @@ enable_cmake-utils_src_configure() { [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}" # Wipe the default optimization flags out of CMake - if [[ ${CMAKE_BUILD_TYPE} != Gentoo ]] && ! has "${EAPI}" 2 3 4 5; then + if [[ ${CMAKE_BUILD_TYPE} != Gentoo && ${EAPI} != 5 ]]; then cat >> ${common_config} <<- _EOF_ || die SET (CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") SET (CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") @@ -607,7 +605,7 @@ enable_cmake-utils_src_configure() { local mycmakeargstype=$(declare -p mycmakeargs 2>&-) if [[ "${mycmakeargstype}" != "declare -a mycmakeargs="* ]]; then if [[ -n "${mycmakeargstype}" ]] ; then - if [[ ${EAPI} == [2345] ]]; then + if [[ ${EAPI} == 5 ]]; then eqawarn "Declaring mycmakeargs as a variable is deprecated. Please use an array instead." else die "Declaring mycmakeargs as a variable is banned in EAPI=${EAPI}. Please use an array instead." @@ -634,7 +632,7 @@ enable_cmake-utils_src_configure() { -DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}" "${mycmakeargs_local[@]}" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" - $([[ ${EAPI} == [2345] ]] && echo -DCMAKE_INSTALL_DO_STRIP=OFF) + $([[ ${EAPI} == 5 ]] && echo -DCMAKE_INSTALL_DO_STRIP=OFF) -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}" -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" "${MYCMAKEARGS}" |