Gentoo Archives: gentoo-dev

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: [gentoo-dev] [PATCH] cmake-multilib.eclass: Support EAPI-8, add guard
Date: Wed, 01 Sep 2021 08:08:21
Message-Id: 4472766.vXUDI8C0e8@tuxbook
1 Move EXPORT_FUNCTIONS below guard.
2
3 Signed-off-by: Andreas Sturmlechner <asturm@g.o>
4 ---
5 eclass/cmake-multilib.eclass | 27 +++++++++++++++++----------
6 1 file changed, 17 insertions(+), 10 deletions(-)
7
8 diff --git a/eclass/cmake-multilib.eclass b/eclass/cmake-multilib.eclass
9 index 6b38d260655..c848e3882f5 100644
10 --- a/eclass/cmake-multilib.eclass
11 +++ b/eclass/cmake-multilib.eclass
12 @@ -6,7 +6,7 @@
13 # Michał Górny <mgorny@g.o>
14 # @AUTHOR:
15 # Author: Michał Górny <mgorny@g.o>
16 -# @SUPPORTED_EAPIS: 7
17 +# @SUPPORTED_EAPIS: 7 8
18 # @BLURB: cmake wrapper for multilib builds
19 # @DESCRIPTION:
20 # The cmake-multilib.eclass provides a glue between cmake.eclass(5)
21 @@ -19,21 +19,23 @@
22 # in multilib-minimal, yet they ought to call appropriate cmake
23 # phase rather than 'default'.
24
25 +[[ ${EAPI} == 7 ]] && : ${CMAKE_ECLASS:=cmake-utils}
26 # @ECLASS-VARIABLE: CMAKE_ECLASS
27 # @PRE_INHERIT
28 # @DESCRIPTION:
29 -# Default is "cmake-utils" for compatibility in EAPI-7. Specify "cmake" for
30 -# ebuilds that ported to cmake.eclass already. Future EAPI is "cmake" only.
31 -: ${CMAKE_ECLASS:=cmake-utils}
32 +# Only "cmake" is supported in EAPI-8 and later.
33 +# In EAPI-7, default is "cmake-utils" for compatibility. Specify "cmake" for
34 +# ebuilds that ported to cmake.eclass already.
35 +: ${CMAKE_ECLASS:=cmake}
36
37 # @ECLASS-VARIABLE: _CMAKE_ECLASS_IMPL
38 # @INTERNAL
39 # @DESCRIPTION:
40 -# Default is "cmake" for future EAPI. Cleanup once EAPI-7 support is gone.
41 +# TODO: Cleanup once EAPI-7 support is gone.
42 _CMAKE_ECLASS_IMPL=cmake
43
44 -case ${EAPI:-0} in
45 - 7)
46 +case ${EAPI} in
47 + 7|8)
48 case ${CMAKE_ECLASS} in
49 cmake-utils|cmake) ;;
50 *)
51 @@ -43,16 +45,17 @@ case ${EAPI:-0} in
52 esac
53 _CMAKE_ECLASS_IMPL=${CMAKE_ECLASS}
54 ;;
55 - *) die "EAPI=${EAPI} is not supported" ;;
56 + *) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
57 esac
58
59 if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
60 die "${ECLASS}: multilib support requires out-of-source builds."
61 fi
62
63 -inherit ${_CMAKE_ECLASS_IMPL} multilib-minimal
64 +if [[ -z ${_CMAKE_MULTILIB_ECLASS} ]]; then
65 +_CMAKE_MULTILIB_ECLASS=1
66
67 -EXPORT_FUNCTIONS src_configure src_compile src_test src_install
68 +inherit ${_CMAKE_ECLASS_IMPL} multilib-minimal
69
70 cmake-multilib_src_configure() {
71 local _cmake_args=( "${@}" )
72 @@ -93,3 +96,7 @@ cmake-multilib_src_install() {
73 multilib_src_install() {
74 ${_CMAKE_ECLASS_IMPL}_src_install "${_cmake_args[@]}"
75 }
76 +
77 +fi
78 +
79 +EXPORT_FUNCTIONS src_configure src_compile src_test src_install
80 --
81 2.33.0

Attachments

File name MIME type
signature.asc application/pgp-signature