Gentoo Archives: gentoo-dev

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

Attachments

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

Replies