• [PATCH v2 1/4] cmake.eclass: Support EAPI-8

    From Andreas Sturmlechner@21:1/5 to All on Wed Sep 1 19:58:22 2021
    Move supported EAPI check on top, EXPORT_FUNCTIONS below guard.

    Switch to using current working directory instead of ${S}
    when initializing ${CMAKE_USE_DIR} and ${BUILD_DIR}.

    Sort inherits.

    Raise baseline cmake version to 3.20.5.

    Bug: https://bugs.gentoo.org/704524
    Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
    ---
    eclass/cmake.eclass | 95 +++++++++++++++++++++++++++++----------------
    1 file changed, 62 insertions(+), 33 deletions(-)

    diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
    index 4bd09459ea6..137dbc66017 100644
    --- a/eclass/cmake.eclass
    +++ b/eclass/cmake.eclass
    @@ -9,7 +9,7 @@
    # Maciej Mrozowski <reavertm@gentoo.org>
    # (undisclosed contributors)
    # Original author: Zephyrus (zephyrus@mirach.it)
    -# @SUPPORTED_EAPIS: 7
    +# @SUPPORTED_EAPIS: 7 8
    # @BLURB: common ebuild functions for cmake-based packages
    # @DESCRIPTION:
    # The cmake eclass makes creating ebuilds for cmake-based packages much easier.
    @@ -17,16 +17,25 @@
    # out-of-source builds (default), in-source builds and an implementation of the
    # well-known use_enable function for CMake.

    +case ${EAPI} in
    + 7|8) ;;
    + *) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
    +esac
    +
    if [[ -z ${_CMAKE_ECLASS} ]]; then
    _CMAKE_ECLASS=1

    +inherit flag-o-matic multiprocessing ninja-utils toolchain-funcs xdg-utils
    +
    # @
  • From Andreas Sturmlechner@21:1/5 to All on Wed Sep 1 19:59:15 2021
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
    ---
    eclass/cmake.eclass | 28 ++++++++++++++++++++--------
    1 file changed, 20 insertions(+), 8 deletions(-)

    diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
    index 137dbc66017..7a8059ba071 100644
    --- a/eclass/cmake.eclass
    +++ b/eclass/cmake.eclass
    @@ -66,11 +66,23 @@ inherit flag-o-matic multiprocessing ninja-utils toolchain-funcs xdg-utils
    : ${CMAKE_MAKEFILE_GENERATOR:=ninja}

    # @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES_LIST
    +# @PRE_INHERIT
    +# @DEFAULT_UNSET
    # @DESCRIPTION:
    -# Array of CMake modules that will be removed in ${CMAKE_USE_DIR}
    -# (in EAPI-7: ${S}) during src_prepare, in order to force packages to use the -# system version. Set to empty to disable removing modules entirely.
    -: ${CMAKE_REMOVE_MODULES_LIST:=FindBLAS FindLAPACK}
    +# Array of .cmake modules to be removed in ${CMAKE_USE_DIR} (in EAPI-7: ${S}) +# during src_prepare, in order to force packages to use the system version.
    +# By default, contains "FindBLAS" and "FindLAPACK".
    +# Set to empty to disable removing