1 |
commit: 84a2c5b69f7447c8f5cb3001c6549420764d10ea |
2 |
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 30 19:58:28 2021 +0000 |
4 |
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 30 20:02:41 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=84a2c5b6 |
7 |
|
8 |
eclass: Drop various unnecessary or redundant main tree copies |
9 |
|
10 |
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org> |
11 |
|
12 |
eclass/gnome2-python.eclass | 53 ----- |
13 |
eclass/gnome2-utils.eclass | 522 -------------------------------------------- |
14 |
eclass/multibuild.eclass | 282 ------------------------ |
15 |
3 files changed, 857 deletions(-) |
16 |
|
17 |
diff --git a/eclass/gnome2-python.eclass b/eclass/gnome2-python.eclass |
18 |
deleted file mode 100644 |
19 |
index a16e931e..00000000 |
20 |
--- a/eclass/gnome2-python.eclass |
21 |
+++ /dev/null |
22 |
@@ -1,53 +0,0 @@ |
23 |
-# Copyright 1999-2015 Gentoo Foundation |
24 |
-# Distributed under the terms of the GNU General Public License v2 |
25 |
- |
26 |
-# @ECLASS: gnome2-python.eclass |
27 |
-# @MAINTAINER: |
28 |
-# Gentoo GNOME Project <gnome@g.o> |
29 |
-# Gentoo Python Project <python@g.o> |
30 |
-# @BLURB: Eclass for GNOME Python packages supporting installation for multiple Python ABIs |
31 |
-# @DESCRIPTION: |
32 |
-# The gnome2-python eclass defines phase functions for GNOME Python packages supporting |
33 |
-# installation for multiple Python ABIs. |
34 |
- |
35 |
-inherit gnome2 python |
36 |
- |
37 |
-# Stolen from git.eclass |
38 |
-EXPORTED_FUNCTIONS="pkg_setup src_compile src_test src_install" |
39 |
-case "${EAPI:-0}" in |
40 |
- 2|3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
41 |
- 0|1) ;; |
42 |
- *) die "Unknown EAPI, bug eclass maintainers." ;; |
43 |
-esac |
44 |
- |
45 |
-EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
46 |
- |
47 |
-gnome2-python_pkg_setup() { |
48 |
- python_pkg_setup |
49 |
-} |
50 |
- |
51 |
-gnome2-python_src_prepare() { |
52 |
- gnome2_src_prepare |
53 |
- python_clean_py-compile_files |
54 |
- python_copy_sources |
55 |
-} |
56 |
- |
57 |
-gnome2-python_src_configure() { |
58 |
- configure() { |
59 |
- gnome2_src_configure PYTHON=$(PYTHON -a) "$@" |
60 |
- } |
61 |
- python_execute_function -s configure |
62 |
-} |
63 |
- |
64 |
-gnome2-python_src_compile() { |
65 |
- python_execute_function -s gnome2_src_compile "$@" |
66 |
-} |
67 |
- |
68 |
-gnome2-python_src_test() { |
69 |
- python_execute_function -s -d |
70 |
-} |
71 |
- |
72 |
-gnome2-python_src_install() { |
73 |
- python_execute_function -s gnome2_src_install |
74 |
- python_clean_installation_image |
75 |
-} |
76 |
|
77 |
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass |
78 |
deleted file mode 100644 |
79 |
index 9b4296c1..00000000 |
80 |
--- a/eclass/gnome2-utils.eclass |
81 |
+++ /dev/null |
82 |
@@ -1,522 +0,0 @@ |
83 |
-# Copyright 1999-2015 Gentoo Foundation |
84 |
-# Distributed under the terms of the GNU General Public License v2 |
85 |
- |
86 |
-# @ECLASS: gnome2-utils.eclass |
87 |
-# @MAINTAINER: |
88 |
-# gnome@g.o |
89 |
-# @BLURB: Auxiliary functions commonly used by Gnome packages. |
90 |
-# @DESCRIPTION: |
91 |
-# This eclass provides a set of auxiliary functions needed by most Gnome |
92 |
-# packages. It may be used by non-Gnome packages as needed for handling various |
93 |
-# Gnome stack related functions such as: |
94 |
-# * Gtk+ icon cache management |
95 |
-# * GSettings schemas management |
96 |
-# * GConf schemas management |
97 |
-# * scrollkeeper (old Gnome help system) management |
98 |
- |
99 |
-[[ ${EAPI:-0} == [012345] ]] && inherit multilib |
100 |
-inherit eutils xdg-utils |
101 |
- |
102 |
-case "${EAPI:-0}" in |
103 |
- 0|1|2|3|4|5|6) ;; |
104 |
- *) die "EAPI=${EAPI} is not supported" ;; |
105 |
-esac |
106 |
- |
107 |
-# @ECLASS-VARIABLE: GCONFTOOL_BIN |
108 |
-# @INTERNAL |
109 |
-# @DESCRIPTION: |
110 |
-# Path to gconftool-2 |
111 |
-: ${GCONFTOOL_BIN:="/usr/bin/gconftool-2"} |
112 |
- |
113 |
-# @ECLASS-VARIABLE: SCROLLKEEPER_DIR |
114 |
-# @INTERNAL |
115 |
-# @DESCRIPTION: |
116 |
-# Directory where scrollkeeper-update should do its work |
117 |
-: ${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"} |
118 |
- |
119 |
-# @ECLASS-VARIABLE: SCROLLKEEPER_UPDATE_BIN |
120 |
-# @INTERNAL |
121 |
-# @DESCRIPTION: |
122 |
-# Path to scrollkeeper-update |
123 |
-: ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"} |
124 |
- |
125 |
-# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE |
126 |
-# @INTERNAL |
127 |
-# @DESCRIPTION: |
128 |
-# Path to gtk-update-icon-cache |
129 |
-: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"} |
130 |
- |
131 |
-# @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS |
132 |
-# @INTERNAL |
133 |
-# @DESCRIPTION: |
134 |
-# Path to glib-compile-schemas |
135 |
-: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"} |
136 |
- |
137 |
-# @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS |
138 |
-# @INTERNAL |
139 |
-# @DEFAULT_UNSET |
140 |
-# @DESCRIPTION: |
141 |
-# List of GConf schemas provided by the package |
142 |
- |
143 |
-# @ECLASS-VARIABLE: GNOME2_ECLASS_ICONS |
144 |
-# @INTERNAL |
145 |
-# @DEFAULT_UNSET |
146 |
-# @DESCRIPTION: |
147 |
-# List of icons provided by the package |
148 |
- |
149 |
-# @ECLASS-VARIABLE: GNOME2_ECLASS_SCROLLS |
150 |
-# @INTERNAL |
151 |
-# @DEFAULT_UNSET |
152 |
-# @DESCRIPTION: |
153 |
-# List of scrolls (documentation files) provided by the package |
154 |
- |
155 |
-# @ECLASS-VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS |
156 |
-# @INTERNAL |
157 |
-# @DEFAULT_UNSET |
158 |
-# @DESCRIPTION: |
159 |
-# List of GSettings schemas provided by the package |
160 |
- |
161 |
-# @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS |
162 |
-# @INTERNAL |
163 |
-# @DEFAULT_UNSET |
164 |
-# @DESCRIPTION: |
165 |
-# List of gdk-pixbuf loaders provided by the package |
166 |
- |
167 |
-DEPEND=">=sys-apps/sed-4" |
168 |
- |
169 |
- |
170 |
-# @FUNCTION: gnome2_environment_reset |
171 |
-# @DESCRIPTION: |
172 |
-# Reset various variables inherited from root's evironment to a reasonable |
173 |
-# default for ebuilds to help avoid access violations and test failures. |
174 |
-gnome2_environment_reset() { |
175 |
- xdg_environment_reset |
176 |
- |
177 |
- # Respected by >=glib-2.30.1-r1 |
178 |
- export G_HOME="${T}" |
179 |
- |
180 |
- # GST_REGISTRY is to work around gst utilities trying to read/write /root |
181 |
- export GST_REGISTRY="${T}/registry.xml" |
182 |
- |
183 |
- # Ensure we don't rely on dconf/gconf while building, bug #511946 |
184 |
- export GSETTINGS_BACKEND="memory" |
185 |
- |
186 |
- if has ${EAPI:-0} 6; then |
187 |
- # Try to cover the packages honoring this variable, bug #508124 |
188 |
- export GST_INSPECT="$(type -P true)" |
189 |
- |
190 |
- # Stop relying on random DISPLAY variable values, bug #534312 |
191 |
- unset DISPLAY |
192 |
- fi |
193 |
-} |
194 |
- |
195 |
-# @FUNCTION: gnome2_gconf_savelist |
196 |
-# @DESCRIPTION: |
197 |
-# Find the GConf schemas that are about to be installed and save their location |
198 |
-# in the GNOME2_ECLASS_SCHEMAS environment variable. |
199 |
-# This function should be called from pkg_preinst. |
200 |
-gnome2_gconf_savelist() { |
201 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" |
202 |
- pushd "${ED}" > /dev/null || die |
203 |
- export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null) |
204 |
- popd > /dev/null || die |
205 |
-} |
206 |
- |
207 |
-# @FUNCTION: gnome2_gconf_install |
208 |
-# @DESCRIPTION: |
209 |
-# Applies any schema files installed by the current ebuild to Gconf's database |
210 |
-# using gconftool-2. |
211 |
-# This function should be called from pkg_postinst. |
212 |
-gnome2_gconf_install() { |
213 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" |
214 |
- local updater="${EROOT}${GCONFTOOL_BIN}" |
215 |
- |
216 |
- if [[ ! -x "${updater}" ]]; then |
217 |
- debug-print "${updater} is not executable" |
218 |
- return |
219 |
- fi |
220 |
- |
221 |
- if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then |
222 |
- debug-print "No GNOME 2 GConf schemas found" |
223 |
- return |
224 |
- fi |
225 |
- |
226 |
- # We are ready to install the GCONF Scheme now |
227 |
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
228 |
- export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")" |
229 |
- |
230 |
- einfo "Installing GNOME 2 GConf schemas" |
231 |
- |
232 |
- local F |
233 |
- for F in ${GNOME2_ECLASS_SCHEMAS}; do |
234 |
- if [[ -e "${EROOT}${F}" ]]; then |
235 |
- debug-print "Installing schema: ${F}" |
236 |
- "${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null |
237 |
- fi |
238 |
- done |
239 |
- |
240 |
- # have gconf reload the new schemas |
241 |
- pids=$(pgrep -x gconfd-2) |
242 |
- if [[ $? == 0 ]] ; then |
243 |
- ebegin "Reloading GConf schemas" |
244 |
- kill -HUP ${pids} |
245 |
- eend $? |
246 |
- fi |
247 |
-} |
248 |
- |
249 |
-# @FUNCTION: gnome2_gconf_uninstall |
250 |
-# @DESCRIPTION: |
251 |
-# Removes schema files previously installed by the current ebuild from Gconf's |
252 |
-# database. |
253 |
-gnome2_gconf_uninstall() { |
254 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" |
255 |
- local updater="${EROOT}${GCONFTOOL_BIN}" |
256 |
- |
257 |
- if [[ ! -x "${updater}" ]]; then |
258 |
- debug-print "${updater} is not executable" |
259 |
- return |
260 |
- fi |
261 |
- |
262 |
- if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then |
263 |
- debug-print "No GNOME 2 GConf schemas found" |
264 |
- return |
265 |
- fi |
266 |
- |
267 |
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
268 |
- export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")" |
269 |
- |
270 |
- einfo "Uninstalling GNOME 2 GConf schemas" |
271 |
- |
272 |
- local F |
273 |
- for F in ${GNOME2_ECLASS_SCHEMAS}; do |
274 |
- if [[ -e "${EROOT}${F}" ]]; then |
275 |
- debug-print "Uninstalling gconf schema: ${F}" |
276 |
- "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null |
277 |
- fi |
278 |
- done |
279 |
- |
280 |
- # have gconf reload the new schemas |
281 |
- pids=$(pgrep -x gconfd-2) |
282 |
- if [[ $? == 0 ]] ; then |
283 |
- ebegin "Reloading GConf schemas" |
284 |
- kill -HUP ${pids} |
285 |
- eend $? |
286 |
- fi |
287 |
-} |
288 |
- |
289 |
-# @FUNCTION: gnome2_icon_savelist |
290 |
-# @DESCRIPTION: |
291 |
-# Find the icons that are about to be installed and save their location |
292 |
-# in the GNOME2_ECLASS_ICONS environment variable. |
293 |
-# This function should be called from pkg_preinst. |
294 |
-gnome2_icon_savelist() { |
295 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" |
296 |
- pushd "${ED}" > /dev/null || die |
297 |
- export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null) |
298 |
- popd > /dev/null || die |
299 |
-} |
300 |
- |
301 |
-# @FUNCTION: gnome2_icon_cache_update |
302 |
-# @DESCRIPTION: |
303 |
-# Updates Gtk+ icon cache files under /usr/share/icons if the current ebuild |
304 |
-# have installed anything under that location. |
305 |
-# This function should be called from pkg_postinst and pkg_postrm. |
306 |
-gnome2_icon_cache_update() { |
307 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" |
308 |
- local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}" |
309 |
- |
310 |
- if [[ ! -x "${updater}" ]] ; then |
311 |
- debug-print "${updater} is not executable" |
312 |
- return |
313 |
- fi |
314 |
- |
315 |
- ebegin "Updating icons cache" |
316 |
- |
317 |
- local retval=0 |
318 |
- local fails=( ) |
319 |
- |
320 |
- for dir in "${EROOT%/}"/usr/share/icons/* |
321 |
- do |
322 |
- if [[ -f "${dir}/index.theme" ]] ; then |
323 |
- local rv=0 |
324 |
- |
325 |
- "${updater}" -qf "${dir}" |
326 |
- rv=$? |
327 |
- |
328 |
- if [[ ! $rv -eq 0 ]] ; then |
329 |
- debug-print "Updating cache failed on ${dir}" |
330 |
- |
331 |
- # Add to the list of failures |
332 |
- fails+=( "${dir}" ) |
333 |
- |
334 |
- retval=2 |
335 |
- fi |
336 |
- elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then |
337 |
- # Clear stale cache files after theme uninstallation |
338 |
- rm "${dir}/icon-theme.cache" |
339 |
- fi |
340 |
- |
341 |
- if [[ -z $(ls "${dir}") ]]; then |
342 |
- # Clear empty theme directories after theme uninstallation |
343 |
- rmdir "${dir}" |
344 |
- fi |
345 |
- done |
346 |
- |
347 |
- eend ${retval} |
348 |
- |
349 |
- for f in "${fails[@]}" ; do |
350 |
- eerror "Failed to update cache with icon $f" |
351 |
- done |
352 |
-} |
353 |
- |
354 |
-# @FUNCTION: gnome2_omf_fix |
355 |
-# @DESCRIPTION: |
356 |
-# Workaround applied to Makefile rules in order to remove redundant |
357 |
-# calls to scrollkeeper-update and sandbox violations. |
358 |
-# This function should be called from src_prepare. |
359 |
-gnome2_omf_fix() { |
360 |
- local omf_makefiles filename |
361 |
- |
362 |
- omf_makefiles="$@" |
363 |
- |
364 |
- if [[ -f ${S}/omf.make ]] ; then |
365 |
- omf_makefiles="${omf_makefiles} ${S}/omf.make" |
366 |
- fi |
367 |
- |
368 |
- if [[ -f ${S}/gnome-doc-utils.make ]] ; then |
369 |
- omf_makefiles="${omf_makefiles} ${S}/gnome-doc-utils.make" |
370 |
- fi |
371 |
- |
372 |
- # testing fixing of all makefiles found |
373 |
- # The sort is important to ensure .am is listed before the respective .in for |
374 |
- # maintainer mode regeneration not kicking in due to .am being newer than .in |
375 |
- for filename in $(find "${S}" -name "Makefile.in" -o -name "Makefile.am" |sort) ; do |
376 |
- omf_makefiles="${omf_makefiles} ${filename}" |
377 |
- done |
378 |
- |
379 |
- ebegin "Fixing OMF Makefiles" |
380 |
- |
381 |
- local retval=0 |
382 |
- local fails=( ) |
383 |
- |
384 |
- for omf in ${omf_makefiles} ; do |
385 |
- sed -i -e 's:scrollkeeper-update:true:' "${omf}" |
386 |
- retval=$? |
387 |
- |
388 |
- if [[ $retval -ne 0 ]] ; then |
389 |
- debug-print "updating of ${omf} failed" |
390 |
- |
391 |
- # Add to the list of failures |
392 |
- fails[$(( ${#fails[@]} + 1 ))]=$omf |
393 |
- |
394 |
- retval=2 |
395 |
- fi |
396 |
- done |
397 |
- |
398 |
- eend $retval |
399 |
- |
400 |
- for f in "${fails[@]}" ; do |
401 |
- eerror "Failed to update OMF Makefile $f" |
402 |
- done |
403 |
-} |
404 |
- |
405 |
-# @FUNCTION: gnome2_scrollkeeper_savelist |
406 |
-# @DESCRIPTION: |
407 |
-# Find the scrolls that are about to be installed and save their location |
408 |
-# in the GNOME2_ECLASS_SCROLLS environment variable. |
409 |
-# This function should be called from pkg_preinst. |
410 |
-gnome2_scrollkeeper_savelist() { |
411 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" |
412 |
- pushd "${ED}" > /dev/null || die |
413 |
- export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name "*.omf" 2> /dev/null) |
414 |
- popd > /dev/null || die |
415 |
-} |
416 |
- |
417 |
-# @FUNCTION: gnome2_scrollkeeper_update |
418 |
-# @DESCRIPTION: |
419 |
-# Updates the global scrollkeeper database. |
420 |
-# This function should be called from pkg_postinst and pkg_postrm. |
421 |
-gnome2_scrollkeeper_update() { |
422 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" |
423 |
- local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}" |
424 |
- |
425 |
- if [[ ! -x "${updater}" ]] ; then |
426 |
- debug-print "${updater} is not executable" |
427 |
- return |
428 |
- fi |
429 |
- |
430 |
- if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then |
431 |
- debug-print "No scroll cache to update" |
432 |
- return |
433 |
- fi |
434 |
- |
435 |
- ebegin "Updating scrollkeeper database ..." |
436 |
- "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}" |
437 |
- eend $? |
438 |
-} |
439 |
- |
440 |
-# @FUNCTION: gnome2_schemas_savelist |
441 |
-# @DESCRIPTION: |
442 |
-# Find if there is any GSettings schema to install and save the list in |
443 |
-# GNOME2_ECLASS_GLIB_SCHEMAS variable. |
444 |
-# This function should be called from pkg_preinst. |
445 |
-gnome2_schemas_savelist() { |
446 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" |
447 |
- pushd "${ED}" > /dev/null || die |
448 |
- export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null) |
449 |
- popd > /dev/null || die |
450 |
-} |
451 |
- |
452 |
-# @FUNCTION: gnome2_schemas_update |
453 |
-# @USAGE: gnome2_schemas_update |
454 |
-# @DESCRIPTION: |
455 |
-# Updates GSettings schemas if GNOME2_ECLASS_GLIB_SCHEMAS has some. |
456 |
-# This function should be called from pkg_postinst and pkg_postrm. |
457 |
-gnome2_schemas_update() { |
458 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" |
459 |
- local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}" |
460 |
- |
461 |
- if [[ ! -x ${updater} ]]; then |
462 |
- debug-print "${updater} is not executable" |
463 |
- return |
464 |
- fi |
465 |
- |
466 |
- ebegin "Updating GSettings schemas" |
467 |
- ${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null |
468 |
- eend $? |
469 |
-} |
470 |
- |
471 |
-# @FUNCTION: gnome2_gdk_pixbuf_savelist |
472 |
-# @DESCRIPTION: |
473 |
-# Find if there is any gdk-pixbuf loader to install and save the list in |
474 |
-# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable. |
475 |
-# This function should be called from pkg_preinst. |
476 |
-gnome2_gdk_pixbuf_savelist() { |
477 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" |
478 |
- pushd "${ED}" > /dev/null || die |
479 |
- export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find usr/lib*/gdk-pixbuf-2.0 -type f 2>/dev/null) |
480 |
- popd > /dev/null || die |
481 |
-} |
482 |
- |
483 |
-# @FUNCTION: gnome2_gdk_pixbuf_update |
484 |
-# @USAGE: gnome2_gdk_pixbuf_update |
485 |
-# @DESCRIPTION: |
486 |
-# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some. |
487 |
-# This function should be called from pkg_postinst and pkg_postrm. |
488 |
-gnome2_gdk_pixbuf_update() { |
489 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" |
490 |
- local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders" |
491 |
- |
492 |
- if [[ ! -x ${updater} ]]; then |
493 |
- updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders" |
494 |
- fi |
495 |
- |
496 |
- if [[ ! -x ${updater} ]]; then |
497 |
- debug-print "${updater} is not executable" |
498 |
- return |
499 |
- fi |
500 |
- |
501 |
- if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then |
502 |
- debug-print "gdk-pixbuf loader cache does not need an update" |
503 |
- return |
504 |
- fi |
505 |
- |
506 |
- ebegin "Updating gdk-pixbuf loader cache" |
507 |
- local tmp_file=$(emktemp) |
508 |
- ${updater} 1> "${tmp_file}" && |
509 |
- chmod 0644 "${tmp_file}" && |
510 |
- cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" && |
511 |
- rm "${tmp_file}" # don't replace this with mv, required for SELinux support |
512 |
- eend $? |
513 |
-} |
514 |
- |
515 |
-# @FUNCTION: gnome2_query_immodules_gtk2 |
516 |
-# @USAGE: gnome2_query_immodules_gtk2 |
517 |
-# @DESCRIPTION: |
518 |
-# Updates gtk2 immodules/gdk-pixbuf loaders listing. |
519 |
-gnome2_query_immodules_gtk2() { |
520 |
- local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-2.0 |
521 |
- [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0 |
522 |
- |
523 |
- ebegin "Updating gtk2 input method module cache" |
524 |
- GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \ |
525 |
- "${updater}" --update-cache |
526 |
- eend $? |
527 |
-} |
528 |
- |
529 |
-# @FUNCTION: gnome2_query_immodules_gtk3 |
530 |
-# @USAGE: gnome2_query_immodules_gtk3 |
531 |
-# @DESCRIPTION: |
532 |
-# Updates gtk3 immodules/gdk-pixbuf loaders listing. |
533 |
-gnome2_query_immodules_gtk3() { |
534 |
- local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-3.0 |
535 |
- [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0 |
536 |
- |
537 |
- ebegin "Updating gtk3 input method module cache" |
538 |
- GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \ |
539 |
- "${updater}" --update-cache |
540 |
- eend $? |
541 |
-} |
542 |
- |
543 |
-# @FUNCTION: gnome2_giomodule_cache_update |
544 |
-# @USAGE: gnome2_giomodule_cache_update |
545 |
-# @DESCRIPTION: |
546 |
-# Updates glib's gio modules cache. |
547 |
-# This function should be called from pkg_postinst and pkg_postrm. |
548 |
-gnome2_giomodule_cache_update() { |
549 |
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" |
550 |
- local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules" |
551 |
- |
552 |
- if [[ ! -x ${updater} ]]; then |
553 |
- updater="${EROOT}/usr/bin/gio-querymodules" |
554 |
- fi |
555 |
- |
556 |
- if [[ ! -x ${updater} ]]; then |
557 |
- debug-print "${updater} is not executable" |
558 |
- return |
559 |
- fi |
560 |
- |
561 |
- ebegin "Updating GIO modules cache" |
562 |
- ${updater} "${EROOT%/}"/usr/$(get_libdir)/gio/modules |
563 |
- eend $? |
564 |
-} |
565 |
- |
566 |
-# @FUNCTION: gnome2_disable_deprecation_warning |
567 |
-# @DESCRIPTION: |
568 |
-# Disable deprecation warnings commonly found in glib based packages. |
569 |
-# Should be called from src_prepare. |
570 |
-gnome2_disable_deprecation_warning() { |
571 |
- local retval=0 |
572 |
- local fails=( ) |
573 |
- local makefile |
574 |
- |
575 |
- ebegin "Disabling deprecation warnings" |
576 |
- # The sort is important to ensure .am is listed before the respective .in for |
577 |
- # maintainer mode regeneration not kicking in due to .am being newer than .in |
578 |
- while read makefile ; do |
579 |
- if ! grep -qE "(DISABLE_DEPRECATED|GSEAL_ENABLE)" "${makefile}"; then |
580 |
- continue |
581 |
- fi |
582 |
- |
583 |
- LC_ALL=C sed -r -i \ |
584 |
- -e 's:-D[A-Z_]+_DISABLE_DEPRECATED:$(/bin/true):g' \ |
585 |
- -e 's:-DGSEAL_ENABLE(=[A-Za-z0-9_]*)?:$(/bin/true):g' \ |
586 |
- -i "${makefile}" |
587 |
- |
588 |
- if [[ $? -ne 0 ]]; then |
589 |
- # Add to the list of failures |
590 |
- fails+=( "${makefile}" ) |
591 |
- retval=2 |
592 |
- fi |
593 |
- done < <(find "${S}" -name "Makefile.in" \ |
594 |
- -o -name "Makefile.am" -o -name "Makefile.decl" \ |
595 |
- | sort; [[ -f "${S}"/configure ]] && echo configure) |
596 |
-# TODO: sedding configure.ac can trigger maintainer mode; bug #439602 |
597 |
-# -o -name "configure.ac" -o -name "configure.in" \ |
598 |
-# | sort; echo configure) |
599 |
- eend ${retval} |
600 |
- |
601 |
- for makefile in "${fails[@]}" ; do |
602 |
- ewarn "Failed to disable deprecation warnings in ${makefile}" |
603 |
- done |
604 |
-} |
605 |
|
606 |
diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass |
607 |
deleted file mode 100644 |
608 |
index c29f4d89..00000000 |
609 |
--- a/eclass/multibuild.eclass |
610 |
+++ /dev/null |
611 |
@@ -1,282 +0,0 @@ |
612 |
-# Copyright 1999-2015 Gentoo Foundation |
613 |
-# Distributed under the terms of the GNU General Public License v2 |
614 |
- |
615 |
-# @ECLASS: multibuild.eclass |
616 |
-# @MAINTAINER: |
617 |
-# Michał Górny <mgorny@g.o> |
618 |
-# @AUTHOR: |
619 |
-# Author: Michał Górny <mgorny@g.o> |
620 |
-# @BLURB: A generic eclass for building multiple variants of packages. |
621 |
-# @DESCRIPTION: |
622 |
-# The multibuild eclass aims to provide a generic framework for building |
623 |
-# multiple 'variants' of a package (e.g. multilib, Python |
624 |
-# implementations). |
625 |
- |
626 |
-case "${EAPI:-0}" in |
627 |
- 0|1|2|3) |
628 |
- die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" |
629 |
- ;; |
630 |
- 4|5|6) |
631 |
- ;; |
632 |
- *) |
633 |
- die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" |
634 |
- ;; |
635 |
-esac |
636 |
- |
637 |
-if [[ ! ${_MULTIBUILD} ]]; then |
638 |
- |
639 |
-# @ECLASS-VARIABLE: MULTIBUILD_VARIANTS |
640 |
-# @DESCRIPTION: |
641 |
-# An array specifying all enabled variants which multibuild_foreach* |
642 |
-# can execute the process for. |
643 |
-# |
644 |
-# In ebuild, it can be set in global scope. Eclasses should set it |
645 |
-# locally in function scope to support nesting properly. |
646 |
-# |
647 |
-# Example: |
648 |
-# @CODE |
649 |
-# python_foreach_impl() { |
650 |
-# local MULTIBUILD_VARIANTS=( python{2_5,2_6,2_7} ... ) |
651 |
-# multibuild_foreach_variant python_compile |
652 |
-# } |
653 |
-# @CODE |
654 |
- |
655 |
-# @ECLASS-VARIABLE: MULTIBUILD_VARIANT |
656 |
-# @DESCRIPTION: |
657 |
-# The current variant which the function was executed for. |
658 |
-# |
659 |
-# If nested multibuilds are used, this value can be an array. In that |
660 |
-# case, the first element will name the deepest multibuild, and the next |
661 |
-# elements will go outwards. |
662 |
-# |
663 |
-# Example value: |
664 |
-# @CODE |
665 |
-# python2_6 |
666 |
-# @CODE |
667 |
- |
668 |
-# @ECLASS-VARIABLE: MULTIBUILD_ID |
669 |
-# @DESCRIPTION: |
670 |
-# The unique identifier for a multibuild run. In a simple run, it is |
671 |
-# equal to MULTIBUILD_VARIANT. In a nested multibuild environment, it |
672 |
-# contains the complete selection tree. |
673 |
-# |
674 |
-# It can be used to create variant-unique directories and files. |
675 |
-# |
676 |
-# If nested multibuilds are used, this value can be an array. In that |
677 |
-# case, the first element will name the deepest multibuild, and the next |
678 |
-# elements will go outwards. |
679 |
-# |
680 |
-# Example value: |
681 |
-# @CODE |
682 |
-# amd64-double |
683 |
-# @CODE |
684 |
- |
685 |
-# @ECLASS-VARIABLE: BUILD_DIR |
686 |
-# @DESCRIPTION: |
687 |
-# The current build directory. In global scope, it is supposed |
688 |
-# to contain an 'initial' build directory. If unset, ${S} is used. |
689 |
-# |
690 |
-# multibuild_foreach_variant() sets BUILD_DIR locally |
691 |
-# to variant-specific build directories based on the initial value |
692 |
-# of BUILD_DIR. |
693 |
-# |
694 |
-# If nested multibuilds are used, this value can be an array. In that |
695 |
-# case, the first element will name the deepest multibuild, and the next |
696 |
-# elements will go outwards. |
697 |
-# |
698 |
-# Example value: |
699 |
-# @CODE |
700 |
-# ${WORKDIR}/foo-1.3-python2_6 |
701 |
-# @CODE |
702 |
- |
703 |
-# @FUNCTION: multibuild_foreach_variant |
704 |
-# @USAGE: [<argv>...] |
705 |
-# @DESCRIPTION: |
706 |
-# Run the passed command repeatedly for each of the enabled package |
707 |
-# variants. |
708 |
-# |
709 |
-# Each of the runs will have variant-specific BUILD_DIR set, and output |
710 |
-# teed to a separate log in ${T}. |
711 |
-# |
712 |
-# The function returns 0 if all commands return 0, or the first non-zero |
713 |
-# exit status otherwise. However, it performs all the invocations |
714 |
-# nevertheless. It is preferred to call 'die' inside of the passed |
715 |
-# function. |
716 |
-multibuild_foreach_variant() { |
717 |
- debug-print-function ${FUNCNAME} "${@}" |
718 |
- |
719 |
- [[ ${MULTIBUILD_VARIANTS} ]] \ |
720 |
- || die "MULTIBUILD_VARIANTS need to be set" |
721 |
- |
722 |
- local bdir=${BUILD_DIR:-${S}} |
723 |
- |
724 |
- # Avoid writing outside WORKDIR if S=${WORKDIR}. |
725 |
- [[ ${bdir%%/} == ${WORKDIR%%/} ]] && bdir=${WORKDIR}/build |
726 |
- |
727 |
- local prev_id=${MULTIBUILD_ID:+${MULTIBUILD_ID}-} |
728 |
- local ret=0 lret=0 v |
729 |
- |
730 |
- debug-print "${FUNCNAME}: initial build_dir = ${bdir}" |
731 |
- |
732 |
- for v in "${MULTIBUILD_VARIANTS[@]}"; do |
733 |
- local MULTIBUILD_VARIANT=( "${v}" "${MULTIBUILD_VARIANT[@]}" ) |
734 |
- local MULTIBUILD_ID=( "${prev_id}${v}" "${MULTIBUILD_ID[@]}" ) |
735 |
- local BUILD_DIR=( "${bdir%%/}-${v}" "${BUILD_DIR[@]}" ) |
736 |
- |
737 |
- _multibuild_run() { |
738 |
- # find the first non-private command |
739 |
- local i=1 |
740 |
- while [[ ${!i} == _* ]]; do |
741 |
- (( i += 1 )) |
742 |
- done |
743 |
- |
744 |
- [[ ${i} -le ${#} ]] && einfo "${v}: running ${@:${i}}" |
745 |
- "${@}" |
746 |
- } |
747 |
- |
748 |
- _multibuild_run "${@}" \ |
749 |
- > >(exec tee -a "${T}/build-${MULTIBUILD_ID}.log") 2>&1 |
750 |
- lret=${?} |
751 |
- done |
752 |
- [[ ${ret} -eq 0 && ${lret} -ne 0 ]] && ret=${lret} |
753 |
- |
754 |
- return ${ret} |
755 |
-} |
756 |
- |
757 |
-# @FUNCTION: multibuild_parallel_foreach_variant |
758 |
-# @USAGE: [<argv>...] |
759 |
-# @DESCRIPTION: |
760 |
-# Run the passed command repeatedly for each of the enabled package |
761 |
-# variants. This used to run the commands in parallel but now it's |
762 |
-# just a deprecated alias to multibuild_foreach_variant. |
763 |
-# |
764 |
-# The function returns 0 if all commands return 0, or the first non-zero |
765 |
-# exit status otherwise. However, it performs all the invocations |
766 |
-# nevertheless. It is preferred to call 'die' inside of the passed |
767 |
-# function. |
768 |
-multibuild_parallel_foreach_variant() { |
769 |
- debug-print-function ${FUNCNAME} "${@}" |
770 |
- |
771 |
- [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}" |
772 |
- |
773 |
- multibuild_foreach_variant "${@}" |
774 |
-} |
775 |
- |
776 |
-# @FUNCTION: multibuild_for_best_variant |
777 |
-# @USAGE: [<argv>...] |
778 |
-# @DESCRIPTION: |
779 |
-# Run the passed command once, for the best of the enabled package |
780 |
-# variants. |
781 |
-# |
782 |
-# The run will have a proper, variant-specificBUILD_DIR set, and output |
783 |
-# teed to a separate log in ${T}. |
784 |
-# |
785 |
-# The function returns command exit status. |
786 |
-multibuild_for_best_variant() { |
787 |
- debug-print-function ${FUNCNAME} "${@}" |
788 |
- |
789 |
- [[ ${MULTIBUILD_VARIANTS} ]] \ |
790 |
- || die "MULTIBUILD_VARIANTS need to be set" |
791 |
- |
792 |
- # bash-4.1 can't handle negative subscripts |
793 |
- local MULTIBUILD_VARIANTS=( |
794 |
- "${MULTIBUILD_VARIANTS[$(( ${#MULTIBUILD_VARIANTS[@]} - 1 ))]}" |
795 |
- ) |
796 |
- multibuild_foreach_variant "${@}" |
797 |
-} |
798 |
- |
799 |
-# @FUNCTION: multibuild_copy_sources |
800 |
-# @DESCRIPTION: |
801 |
-# Create per-variant copies of source tree. The source tree is assumed |
802 |
-# to be in ${BUILD_DIR}, or ${S} if the former is unset. The copies will |
803 |
-# be placed in directories matching BUILD_DIRs used by |
804 |
-# multibuild_foreach(). |
805 |
-multibuild_copy_sources() { |
806 |
- debug-print-function ${FUNCNAME} "${@}" |
807 |
- |
808 |
- local _MULTIBUILD_INITIAL_BUILD_DIR=${BUILD_DIR:-${S}} |
809 |
- |
810 |
- einfo "Will copy sources from ${_MULTIBUILD_INITIAL_BUILD_DIR}" |
811 |
- |
812 |
- local cp_args=() |
813 |
- if cp --reflink=auto --version &>/dev/null; then |
814 |
- # enable reflinking if possible to make this faster |
815 |
- cp_args+=( --reflink=auto ) |
816 |
- fi |
817 |
- |
818 |
- _multibuild_create_source_copy() { |
819 |
- einfo "${MULTIBUILD_VARIANT}: copying to ${BUILD_DIR}" |
820 |
- cp -p -R "${cp_args[@]}" \ |
821 |
- "${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die |
822 |
- } |
823 |
- |
824 |
- multibuild_foreach_variant _multibuild_create_source_copy |
825 |
-} |
826 |
- |
827 |
-# @FUNCTION: run_in_build_dir |
828 |
-# @USAGE: <argv>... |
829 |
-# @DESCRIPTION: |
830 |
-# Run the given command in the directory pointed by BUILD_DIR. |
831 |
-run_in_build_dir() { |
832 |
- debug-print-function ${FUNCNAME} "${@}" |
833 |
- local ret |
834 |
- |
835 |
- [[ ${#} -ne 0 ]] || die "${FUNCNAME}: no command specified." |
836 |
- [[ ${BUILD_DIR} ]] || die "${FUNCNAME}: BUILD_DIR not set." |
837 |
- |
838 |
- mkdir -p "${BUILD_DIR}" || die |
839 |
- pushd "${BUILD_DIR}" >/dev/null || die |
840 |
- "${@}" |
841 |
- ret=${?} |
842 |
- popd >/dev/null || die |
843 |
- |
844 |
- return ${ret} |
845 |
-} |
846 |
- |
847 |
-# @FUNCTION: multibuild_merge_root |
848 |
-# @USAGE: <src-root> <dest-root> |
849 |
-# @DESCRIPTION: |
850 |
-# Merge the directory tree (fake root) from <src-root> to <dest-root> |
851 |
-# (the real root). Both directories have to be real, absolute paths |
852 |
-# (i.e. including ${D}). Source root will be removed. |
853 |
-multibuild_merge_root() { |
854 |
- local src=${1} |
855 |
- local dest=${2} |
856 |
- |
857 |
- local ret |
858 |
- |
859 |
- if use userland_BSD; then |
860 |
- # Most of BSD variants fail to copy broken symlinks, #447370 |
861 |
- # also, they do not support --version |
862 |
- |
863 |
- tar -C "${src}" -f - -c . \ |
864 |
- | tar -x -f - -C "${dest}" |
865 |
- [[ ${PIPESTATUS[*]} == '0 0' ]] |
866 |
- ret=${?} |
867 |
- else |
868 |
- local cp_args=() |
869 |
- |
870 |
- if cp -a --version &>/dev/null; then |
871 |
- cp_args+=( -a ) |
872 |
- else |
873 |
- cp_args+=( -P -R -p ) |
874 |
- fi |
875 |
- |
876 |
- if cp --reflink=auto --version &>/dev/null; then |
877 |
- # enable reflinking if possible to make this faster |
878 |
- cp_args+=( --reflink=auto ) |
879 |
- fi |
880 |
- |
881 |
- cp "${cp_args[@]}" "${src}"/. "${dest}"/ |
882 |
- ret=${?} |
883 |
- fi |
884 |
- |
885 |
- if [[ ${ret} -ne 0 ]]; then |
886 |
- die "${MULTIBUILD_VARIANT:-(unknown)}: merging image failed." |
887 |
- fi |
888 |
- |
889 |
- rm -rf "${src}" |
890 |
-} |
891 |
- |
892 |
-_MULTIBUILD=1 |
893 |
-fi |