1 |
Le Wed, 07 Apr 2021 00:16:26 +0200 |
2 |
Andreas Sturmlechner <asturm@g.o> a écrit: |
3 |
|
4 |
> Just some cheap fixes while flag-o-matic.eclass causes cache-regen anyway. |
5 |
> See also: https://github.com/gentoo/gentoo/pull/20207 |
6 |
> |
7 |
> - Add inherit guard |
8 |
> - Fix some eclassdoc |
9 |
> - Minor cleanup |
10 |
> |
11 |
> --- |
12 |
> eclass/gnustep-base.eclass | 65 ++++++++++++++++++++------------------ |
13 |
> 1 file changed, 34 insertions(+), 31 deletions(-) |
14 |
> |
15 |
> diff --git a/eclass/gnustep-base.eclass b/eclass/gnustep-base.eclass |
16 |
> index 6cd9f532a55..c343dbb5c6b 100644 |
17 |
> --- a/eclass/gnustep-base.eclass |
18 |
> +++ b/eclass/gnustep-base.eclass |
19 |
> @@ -1,16 +1,27 @@ |
20 |
> -# Copyright 1999-2018 Gentoo Foundation |
21 |
> +# Copyright 1999-2021 Gentoo Authors |
22 |
> # Distributed under the terms of the GNU General Public License v2 |
23 |
> |
24 |
> # @ECLASS: gnustep-base.eclass |
25 |
> # @MAINTAINER: |
26 |
> # GNUstep Herd <gnustep@g.o> |
27 |
> -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 |
28 |
> +# @SUPPORTED_EAPIS: 5 6 7 |
29 |
> # @BLURB: Internal handling of GNUstep pacakges |
30 |
> # @DESCRIPTION: |
31 |
> # Inner gnustep eclass, should only be inherited directly by gnustep-base |
32 |
> # packages |
33 |
> |
34 |
> -inherit eutils flag-o-matic |
35 |
> +if [[ -z ${_GNUSTEP_BASE_ECLASS} ]]; then |
36 |
> +_GNUSTEP_BASE_ECLASS=1 |
37 |
> + |
38 |
> +inherit flag-o-matic |
39 |
> + |
40 |
> +EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst |
41 |
> + |
42 |
> +case ${EAPI:-0} in |
43 |
> + [0-4]) die "gnustep-base.eclass: EAPI ${EAPI} is too old." ;; |
44 |
> + [5-7]) inherit eutils ;; |
45 |
> + *) die "EAPI ${EAPI} is not supported by gnustep-base.eclass." ;; |
46 |
> +esac |
47 |
> |
48 |
> # IUSE variables across all GNUstep packages |
49 |
> # "debug": enable code for debugging |
50 |
> @@ -40,13 +51,6 @@ gnustep-base_pkg_setup() { |
51 |
> filter-flags -fomit-frame-pointer |
52 |
> } |
53 |
> |
54 |
> -gnustep-base_src_unpack() { |
55 |
> - unpack ${A} |
56 |
> - cd "${S}" |
57 |
> - |
58 |
> - gnustep-base_src_prepare |
59 |
> -} |
60 |
> - |
61 |
> gnustep-base_src_prepare() { |
62 |
> if [[ -f ./GNUmakefile ]] ; then |
63 |
> # Kill stupid includes that are simply overdone or useless on normal |
64 |
> @@ -63,22 +67,18 @@ gnustep-base_src_prepare() { |
65 |
> eend $? |
66 |
> fi |
67 |
> |
68 |
> - ! has ${EAPI:-0} 0 1 2 3 4 5 && default |
69 |
> + ! has ${EAPI:-0} 5 && default |
70 |
> } |
71 |
> |
72 |
> gnustep-base_src_configure() { |
73 |
> egnustep_env |
74 |
> if [[ -x ./configure ]] ; then |
75 |
> - econf || die "configure failed" |
76 |
> + econf |
77 |
> fi |
78 |
> } |
79 |
> |
80 |
> gnustep-base_src_compile() { |
81 |
> egnustep_env |
82 |
> - case ${EAPI:-0} in |
83 |
> - 0|1) gnustep-base_src_configure ;; |
84 |
> - esac |
85 |
> - |
86 |
> egnustep_make |
87 |
> } |
88 |
> |
89 |
> @@ -105,6 +105,8 @@ gnustep-base_pkg_postinst() { |
90 |
> elog " ${SCRIPT_PATH}/config-${PN}.sh" |
91 |
> } |
92 |
> |
93 |
> +# @FUNCTION: egnustep_env |
94 |
> +# @DESCRIPTION: |
95 |
> # Clean/reset an ebuild to the installed GNUstep environment |
96 |
> egnustep_env() { |
97 |
> # Get additional variables |
98 |
> @@ -113,9 +115,9 @@ egnustep_env() { |
99 |
> # Makefiles path |
100 |
> local GS_MAKEFILES |
101 |
> if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then |
102 |
> - GS_MAKEFILES=${EPREFIX}/usr/share/GNUstep/Makefiles |
103 |
> + GS_MAKEFILES="${EPREFIX}"/usr/share/GNUstep/Makefiles |
104 |
> else |
105 |
> - GS_MAKEFILES=${GNUSTEP_PREFIX}/System/Library/Makefiles |
106 |
> + GS_MAKEFILES="${GNUSTEP_PREFIX}"/System/Library/Makefiles |
107 |
> fi |
108 |
> if [[ -f ${GS_MAKEFILES}/GNUstep.sh ]] ; then |
109 |
> # Reset GNUstep variables |
110 |
> @@ -130,7 +132,6 @@ egnustep_env() { |
111 |
> -i "${WORKDIR}"/GNUstep.conf || die "GNUstep.conf sed failed" |
112 |
> fi |
113 |
> |
114 |
> - |
115 |
> if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then |
116 |
> # Set rpath in ldflags when available |
117 |
> case ${CHOST} in |
118 |
> @@ -159,8 +160,7 @@ egnustep_env() { |
119 |
> && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \ |
120 |
> || GS_ENV=( "${GS_ENV[@]}" "debug=no" ) |
121 |
> |
122 |
> - if has_version "gnustep-base/gnustep-make[libobjc2]"; |
123 |
> - then |
124 |
> + if has_version "gnustep-base/gnustep-make[libobjc2]"; then |
125 |
> # Set clang for packages that do not respect gnustep-make |
126 |
> # settings (gnustep-base's configure for example) |
127 |
> export CC=clang CXX=clang CPP="clang -E" LD="clang" |
128 |
> @@ -171,36 +171,42 @@ egnustep_env() { |
129 |
> die "gnustep-make not installed!" |
130 |
> } |
131 |
> |
132 |
> +# @FUNCTION: egnustep_make |
133 |
> +# @DESCRIPTION: |
134 |
> # Make utilizing GNUstep Makefiles |
135 |
> egnustep_make() { |
136 |
> if [[ -f ./Makefile || -f ./makefile || -f ./GNUmakefile ]] ; then |
137 |
> - emake ${*} "${GS_ENV[@]}" all || die "package make failed" |
138 |
> + emake ${*} "${GS_ENV[@]}" all |
139 |
> return 0 |
140 |
> fi |
141 |
> die "no Makefile found" |
142 |
> } |
143 |
> |
144 |
> +# @FUNCTION: egnustep_install |
145 |
> +# @DESCRIPTION: |
146 |
> # Make-install utilizing GNUstep Makefiles |
147 |
> egnustep_install() { |
148 |
> if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then |
149 |
> # avoid problems due to our "weird" prefix, make sure it exists |
150 |
> - mkdir -p "${D}"${GNUSTEP_SYSTEM_TOOLS} |
151 |
> + mkdir -p "${D}"${GNUSTEP_SYSTEM_TOOLS} || die |
152 |
> fi |
153 |
> if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then |
154 |
> - emake ${*} "${GS_ENV[@]}" install || die "package install failed" |
155 |
> + emake ${*} "${GS_ENV[@]}" install |
156 |
> return 0 |
157 |
> fi |
158 |
> die "no Makefile found" |
159 |
> } |
160 |
> |
161 |
> +# @FUNCTION: egnustep_doc |
162 |
> +# @DESCRIPTION: |
163 |
> # Make and install docs using GNUstep Makefiles |
164 |
> egnustep_doc() { |
165 |
> if [[ -d "${S}"/Documentation ]] ; then |
166 |
> # Check documentation presence |
167 |
> pushd "${S}"/Documentation || die |
168 |
> if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then |
169 |
> - emake "${GS_ENV[@]}" all || die "doc make failed" |
170 |
> - emake "${GS_ENV[@]}" install || die "doc install failed" |
171 |
> + emake "${GS_ENV[@]}" all |
172 |
> + emake "${GS_ENV[@]}" install |
173 |
> fi |
174 |
> popd || die |
175 |
> fi |
176 |
> @@ -258,12 +264,9 @@ EOF |
177 |
> if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then |
178 |
> exeinto /usr/bin |
179 |
> else |
180 |
> - exeinto ${GNUSTEP_SYSTEM_TOOLS#${EPREFIX}}/Gentoo |
181 |
> + exeinto "${GNUSTEP_SYSTEM_TOOLS#${EPREFIX}}"/Gentoo |
182 |
> fi |
183 |
> doexe "${T}"/${cfile} |
184 |
> } |
185 |
> |
186 |
> -case ${EAPI:-0} in |
187 |
> - 0|1) EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst ;; |
188 |
> - *) EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst ;; |
189 |
> -esac |
190 |
> +fi |
191 |
> -- |
192 |
> 2.31.1 |
193 |
All gnustep ebuilds in tree and gnustep overlay are EAPI>=5, and changes |
194 |
look good to me. Thanks for the cleanup and fixes! |
195 |
|
196 |
-- |
197 |
Bernard Cafarelli (Voyageur) |
198 |
Gentoo developer |