Gentoo Archives: gentoo-dev

From: Matt Turner <mattst88@g.o>
To: gentoo-dev@l.g.o
Cc: gnome@g.o, Matt Turner <mattst88@g.o>
Subject: [gentoo-dev] [PATCH] gnome2.eclass: Drop EAPI=4 support
Date: Sat, 05 Dec 2020 23:38:34
Message-Id: 20201205233817.1240179-1-mattst88@gentoo.org
1 Closes: https://bugs.gentoo.org/596674
2 Signed-off-by: Matt Turner <mattst88@g.o>
3 ---
4 eclass/gnome2.eclass | 82 ++++++++++++--------------------------------
5 1 file changed, 22 insertions(+), 60 deletions(-)
6
7 diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
8 index 1a4ff451df3..9c2428532a9 100644
9 --- a/eclass/gnome2.eclass
10 +++ b/eclass/gnome2.eclass
11 @@ -4,7 +4,7 @@
12 # @ECLASS: gnome2.eclass
13 # @MAINTAINER:
14 # gnome@g.o
15 -# @SUPPORTED_EAPIS: 4 5 6
16 +# @SUPPORTED_EAPIS: 5 6
17 # @BLURB: Provides phases for Gnome/Gtk+ based packages.
18 # @DESCRIPTION:
19 # Exports portage base functions used by ebuilds written for packages using the
20 @@ -20,7 +20,7 @@ GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
21 inherit eutils libtool ltprune gnome.org gnome2-utils xdg
22
23 case "${EAPI:-0}" in
24 - 4|5)
25 + 5)
26 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
27 ;;
28 6)
29 @@ -29,13 +29,6 @@ case "${EAPI:-0}" in
30 *) die "EAPI=${EAPI} is not supported" ;;
31 esac
32
33 -# @ECLASS-VARIABLE: DOCS
34 -# @DEFAULT_UNSET
35 -# @DESCRIPTION:
36 -# String containing documents passed to dodoc command for eapi4.
37 -# In eapi5 we rely on einstalldocs (from eutils.eclass) and for newer EAPIs we
38 -# follow PMS spec.
39 -
40 # @ECLASS-VARIABLE: ELTCONF
41 # @DEFAULT_UNSET
42 # @DESCRIPTION:
43 @@ -48,7 +41,7 @@ ELTCONF=${ELTCONF:-""}
44 # Extra configure opts passed to econf.
45 # Deprecated, pass extra arguments to gnome2_src_configure.
46 # Banned in eapi6 and newer.
47 -if has ${EAPI:-0} 4 5; then
48 +if has ${EAPI:-0} 5; then
49 G2CONF=${G2CONF:-""}
50 fi
51
52 @@ -64,7 +57,7 @@ fi
53 #
54 # Banned since eapi6 as upstream is moving away from this obsolete macro in favor
55 # of autoconf-archive macros, that do not expose this issue (bug #270919)
56 -if has ${EAPI:-0} 4 5; then
57 +if has ${EAPI:-0} 5; then
58 if [[ ${GCONF_DEBUG} != "no" ]]; then
59 IUSE="debug"
60 fi
61 @@ -77,23 +70,18 @@ fi
62
63 # @ECLASS-VARIABLE: GNOME2_LA_PUNT
64 # @DESCRIPTION:
65 -# For eapi4 it sets if we should delete ALL or none of the .la files
66 -# For eapi5 and newer it relies on prune_libtool_files (from eutils.eclass)
67 +# It relies on prune_libtool_files (from ltprune.eclass)
68 # for this. Available values for GNOME2_LA_PUNT:
69 # - "no": will not clean any .la files
70 # - "yes": will run prune_libtool_files --modules
71 # - If it is not set, it will run prune_libtool_files
72 -if has ${EAPI:-0} 4; then
73 - GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
74 -else
75 - GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
76 -fi
77 +GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
78
79 # @FUNCTION: gnome2_src_unpack
80 # @DESCRIPTION:
81 # Stub function for old EAPI.
82 gnome2_src_unpack() {
83 - if has ${EAPI:-0} 4 5; then
84 + if has ${EAPI:-0} 5; then
85 unpack ${A}
86 cd "${S}"
87 else
88 @@ -115,7 +103,7 @@ gnome2_src_prepare() {
89 # We stop to run it from eapi6 as scrollkeeper helpers from
90 # rarian are not running anything and, then, access violations
91 # shouldn't occur.
92 - has ${EAPI:-0} 4 5 && gnome2_omf_fix
93 + has ${EAPI:-0} 5 && gnome2_omf_fix
94
95 # Disable all deprecation warnings
96 gnome2_disable_deprecation_warning
97 @@ -135,7 +123,7 @@ gnome2_src_prepare() {
98 gnome2_src_configure() {
99 # Deprecated for a long time now and banned since eapi6, see Gnome team policies
100 if [[ -n ${G2CONF} ]] ; then
101 - if has ${EAPI:-0} 4 5; then
102 + if has ${EAPI:-0} 5; then
103 eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
104 else
105 die "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
106 @@ -144,7 +132,7 @@ gnome2_src_configure() {
107
108 local g2conf=()
109
110 - if has ${EAPI:-0} 4 5; then
111 + if has ${EAPI:-0} 5; then
112 if [[ ${GCONF_DEBUG} != 'no' ]] ; then
113 if use debug ; then
114 g2conf+=( --enable-debug=yes )
115 @@ -164,11 +152,7 @@ gnome2_src_configure() {
116 # rebuild docs.
117 # Preserve old behavior for older EAPI.
118 if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
119 - if has ${EAPI:-0} 4 && in_iuse doc ; then
120 - g2conf+=( $(use_enable doc gtk-doc) )
121 - else
122 - g2conf+=( --disable-gtk-doc )
123 - fi
124 + g2conf+=( --disable-gtk-doc )
125 fi
126
127 # Pass --disable-maintainer-mode when needed
128 @@ -182,13 +166,6 @@ gnome2_src_configure() {
129 g2conf+=( --disable-scrollkeeper )
130 fi
131
132 - # Pass --disable-silent-rules when possible (not needed since eapi5), bug #429308
133 - if has ${EAPI:-0} 4; then
134 - if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
135 - g2conf+=( --disable-silent-rules )
136 - fi
137 - fi
138 -
139 # Pass --disable-schemas-install when possible
140 if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
141 g2conf+=( --disable-schemas-install )
142 @@ -210,20 +187,20 @@ gnome2_src_configure() {
143 fi
144
145 # Pass --docdir with proper directory, bug #482646 (not needed since eapi6)
146 - if has ${EAPI:-0} 4 5; then
147 + if has ${EAPI:-0} 5; then
148 if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
149 g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
150 fi
151 fi
152
153 # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
154 - if has ${EAPI:-0} 4 5; then
155 + if has ${EAPI:-0} 5; then
156 addwrite "$(unset HOME; echo ~)/.gnome2"
157 else
158 addpredict "$(unset HOME; echo ~)/.gnome2"
159 fi
160
161 - if has ${EAPI:-0} 4 5; then
162 + if has ${EAPI:-0} 5; then
163 econf ${g2conf[@]} ${G2CONF} "$@"
164 else
165 econf ${g2conf[@]} "$@"
166 @@ -234,7 +211,7 @@ gnome2_src_configure() {
167 # @DESCRIPTION:
168 # Only default src_compile for now
169 gnome2_src_compile() {
170 - if has ${EAPI:-0} 4 5; then
171 + if has ${EAPI:-0} 5; then
172 emake
173 else
174 default
175 @@ -255,7 +232,7 @@ gnome2_src_install() {
176 #
177 # if this is not present, scrollkeeper-update may segfault and
178 # create bogus directories in /var/lib/
179 - if has ${EAPI:-0} 4 5; then
180 + if has ${EAPI:-0} 5; then
181 dodir "${sk_tmp_dir}" || die "dodir failed"
182 emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
183 else
184 @@ -267,12 +244,7 @@ gnome2_src_install() {
185 # Handle documentation as 'default' for eapi5, bug #373131
186 # Since eapi6 this is handled by default on its own plus MAINTAINERS and HACKING
187 # files that are really common in gnome packages (bug #573390)
188 - if has ${EAPI:-0} 4; then
189 - # Manual document installation
190 - if [[ -n "${DOCS}" ]]; then
191 - dodoc ${DOCS} || die "dodoc failed"
192 - fi
193 - elif has ${EAPI:-0} 5; then
194 + if has ${EAPI:-0} 5; then
195 einstalldocs
196 else
197 local d
198 @@ -293,21 +265,11 @@ gnome2_src_install() {
199 rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
200
201 # Delete all .la files
202 - if has ${EAPI:-0} 4; then
203 - if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then
204 - ebegin "Removing .la files"
205 - if ! in_iuse static-libs || ! use static-libs ; then
206 - find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
207 - fi
208 - eend
209 - fi
210 - else
211 - case "${GNOME2_LA_PUNT}" in
212 - yes) prune_libtool_files --modules;;
213 - no) ;;
214 - *) prune_libtool_files;;
215 - esac
216 - fi
217 + case "${GNOME2_LA_PUNT}" in
218 + yes) prune_libtool_files --modules;;
219 + no) ;;
220 + *) prune_libtool_files;;
221 + esac
222 }
223
224 # @FUNCTION: gnome2_pkg_preinst
225 --
226 2.26.2