always)
;;
*)
- has "${EAPI:-0}" 2 3 4 5 || die "WANT_CMAKE is banned in EAPI 6 and later"
+ [[ ${EAPI} == [2345] ]] || die "WANT_CMAKE is banned in EAPI 6 and later"
IUSE+=" ${WANT_CMAKE}"
CMAKEDEPEND+="${WANT_CMAKE}? ( "
;;
local arg=$2
[[ ! -z $3 ]] && arg=$3
- has "${EAPI:-0}" 2 3 4 5 || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead"
+ [[ ${EAPI} == [2345] ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead"
local uper capitalised x
[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
local arg=$2
[[ ! -z $3 ]] && arg=$3
- if ! has "${EAPI:-0}" 2 3 4 5 && [[ "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then
+ if [[ ${EAPI} != [2345] ]] && [[ "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then
die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" insteadss"
fi
# 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() {
- has "${EAPI:-0}" 2 3 4 5 || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead"
+ [[ ${EAPI} == [2345] ]] || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead"
cmake_comment_add_subdirectory "$@"
}
# 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 ! has "${EAPI:-0}" 2 3 4 5 && [[ "$#" != 2 ]] ; then
+ if [[ ${EAPI} != [2345] ]] && [[ "$#" != 2 ]] ; then
die "Usage: cmake-utils_use_find_package <USE flag> <package name>"
fi
pushd "${S}" > /dev/null || die
- if ! has "${EAPI:-0}" 2 3 4 5 ; then
+ if [[ ${EAPI} != [2345] ]]; then
default_src_prepare
_cmake_cleanup_cmake
else
enable_cmake-utils_src_configure() {
debug-print-function ${FUNCNAME} "$@"
- has "${EAPI:-0}" 2 3 4 5 && _cmake_cleanup_cmake
+ [[ ${EAPI} == [2345] ]] && _cmake_cleanup_cmake
_cmake_check_build_dir
fi
fi
- has "${EAPI:-0}" 0 1 2 && ! use prefix && local EPREFIX=
+ [[ ${EAPI} == 2 ]] && ! use prefix && local EPREFIX=
if [[ ${EPREFIX} ]]; then
cat >> "${build_rules}" <<- _EOF_ || die
local mycmakeargstype=$(declare -p mycmakeargs 2>&-)
if [[ "${mycmakeargstype}" != "declare -a mycmakeargs="* ]]; then
if [[ -n "${mycmakeargstype}" ]] ; then
- if has "${EAPI:-0}" 2 3 4 5 ; then
+ if [[ ${EAPI} != [2345] ]]; 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."