1 |
diff --git a/eclass/cmake-multilib.eclass b/eclass/cmake-multilib.eclass |
2 |
--- a/eclass/cmake-multilib.eclass |
3 |
+++ b/eclass/cmake-multilib.eclass |
4 |
@@ -1,4 +1,4 @@ |
5 |
-# Copyright 1999-2019 Gentoo Authors |
6 |
+# Copyright 1999-2021 Gentoo Authors |
7 |
# Distributed under the terms of the GNU General Public License v2 |
8 |
|
9 |
# @ECLASS: cmake-multilib.eclass |
10 |
@@ -6,27 +6,41 @@ |
11 |
# gx86-multilib team <multilib@g.o> |
12 |
# @AUTHOR: |
13 |
# Author: Michał Górny <mgorny@g.o> |
14 |
-# @SUPPORTED_EAPIS: 6 7 |
15 |
-# @BLURB: cmake-utils wrapper for multilib builds |
16 |
+# @SUPPORTED_EAPIS: 7 |
17 |
+# @BLURB: cmake wrapper for multilib builds |
18 |
# @DESCRIPTION: |
19 |
-# The cmake-multilib.eclass provides a glue between cmake-utils.eclass(5) |
20 |
+# The cmake-multilib.eclass provides a glue between cmake.eclass(5) |
21 |
# and multilib-minimal.eclass(5), aiming to provide a convenient way |
22 |
# to build packages using cmake for multiple ABIs. |
23 |
# |
24 |
# Inheriting this eclass sets IUSE and exports default multilib_src_*() |
25 |
-# sub-phases that call cmake-utils phase functions for each ABI enabled. |
26 |
+# sub-phases that call cmake phase functions for each ABI enabled. |
27 |
# The multilib_src_*() functions can be defined in ebuild just like |
28 |
-# in multilib-minimal, yet they ought to call appropriate cmake-utils |
29 |
+# in multilib-minimal, yet they ought to call appropriate cmake |
30 |
# phase rather than 'default'. |
31 |
|
32 |
# @ECLASS-VARIABLE: CMAKE_ECLASS |
33 |
# @DESCRIPTION: |
34 |
-# Default is "cmake-utils" for compatibility. Specify "cmake" for ebuilds |
35 |
-# that ported from cmake-utils.eclass to cmake.eclass already. |
36 |
+# Default is "cmake-utils" for compatibility in EAPI-7. Specify "cmake" for |
37 |
+# ebuilds that ported to cmake.eclass already. Future EAPI is "cmake" only. |
38 |
: ${CMAKE_ECLASS:=cmake-utils} |
39 |
|
40 |
+# @ECLASS-VARIABLE: _CMAKE_ECLASS_IMPL |
41 |
+# @INTERNAL |
42 |
+# @DESCRIPTION: |
43 |
+# Default is "cmake" for future EAPI. Cleanup once EAPI-7 support is gone. |
44 |
+_CMAKE_ECLASS_IMPL=cmake |
45 |
+ |
46 |
case ${EAPI:-0} in |
47 |
- [67]) ;; |
48 |
+ 7) case ${CMAKE_ECLASS} in |
49 |
+ cmake-utils|cmake) ;; |
50 |
+ *) |
51 |
+ eerror "Unknown value for \$ |
52 |
{CMAKE_ECLASS}" |
53 |
+ die "Value ${CMAKE_ECLASS} is not |
54 |
supported" |
55 |
+ ;; |
56 |
+ esac |
57 |
+ _CMAKE_ECLASS_IMPL=${CMAKE_ECLASS} |
58 |
+ ;; |
59 |
*) die "EAPI=${EAPI} is not supported" ;; |
60 |
esac |
61 |
|
62 |
@@ -34,15 +48,7 @@ if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then |
63 |
die "${ECLASS}: multilib support requires out-of-source builds." |
64 |
fi |
65 |
|
66 |
-case ${CMAKE_ECLASS} in |
67 |
- cmake-utils|cmake) ;; |
68 |
- *) |
69 |
- eerror "Unknown value for \${CMAKE_ECLASS}" |
70 |
- die "Value ${CMAKE_ECLASS} is not supported" |
71 |
- ;; |
72 |
-esac |
73 |
- |
74 |
-inherit ${CMAKE_ECLASS} multilib-minimal |
75 |
+inherit ${_CMAKE_ECLASS_IMPL} multilib-minimal |
76 |
|
77 |
EXPORT_FUNCTIONS src_configure src_compile src_test src_install |
78 |
|
79 |
@@ -53,7 +59,7 @@ cmake-multilib_src_configure() { |
80 |
} |
81 |
|
82 |
multilib_src_configure() { |
83 |
- ${CMAKE_ECLASS}_src_configure "${_cmake_args[@]}" |
84 |
+ ${_CMAKE_ECLASS_IMPL}_src_configure "${_cmake_args[@]}" |
85 |
} |
86 |
|
87 |
cmake-multilib_src_compile() { |
88 |
@@ -63,7 +69,7 @@ cmake-multilib_src_compile() { |
89 |
} |
90 |
|
91 |
multilib_src_compile() { |
92 |
- ${CMAKE_ECLASS}_src_compile "${_cmake_args[@]}" |
93 |
+ ${_CMAKE_ECLASS_IMPL}_src_compile "${_cmake_args[@]}" |
94 |
} |
95 |
|
96 |
cmake-multilib_src_test() { |
97 |
@@ -73,7 +79,7 @@ cmake-multilib_src_test() { |
98 |
} |
99 |
|
100 |
multilib_src_test() { |
101 |
- ${CMAKE_ECLASS}_src_test "${_cmake_args[@]}" |
102 |
+ ${_CMAKE_ECLASS_IMPL}_src_test "${_cmake_args[@]}" |
103 |
} |
104 |
|
105 |
cmake-multilib_src_install() { |
106 |
@@ -83,5 +89,5 @@ cmake-multilib_src_install() { |
107 |
} |
108 |
|
109 |
multilib_src_install() { |
110 |
- ${CMAKE_ECLASS}_src_install "${_cmake_args[@]}" |
111 |
+ ${_CMAKE_ECLASS_IMPL}_src_install "${_cmake_args[@]}" |
112 |
} |