| 1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.92 2011/04/21 20:58:58 eva Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.97 2011/07/08 11:35:01 ssuominen Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: gnome2.eclass |
5 | # @ECLASS: gnome2.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # gnome@gentoo.org |
7 | # gnome@gentoo.org |
| 8 | # @BLURB: |
8 | # @BLURB: |
| … | |
… | |
| 14 | |
14 | |
| 15 | case "${EAPI:-0}" in |
15 | case "${EAPI:-0}" in |
| 16 | 0|1) |
16 | 0|1) |
| 17 | EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm |
17 | EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm |
| 18 | ;; |
18 | ;; |
| 19 | 2|3) |
19 | 2|3|4) |
| 20 | EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm |
20 | EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm |
| 21 | ;; |
21 | ;; |
| 22 | *) die "EAPI=${EAPI} is not supported" ;; |
22 | *) die "EAPI=${EAPI} is not supported" ;; |
| 23 | esac |
23 | esac |
| 24 | |
24 | |
| … | |
… | |
| 26 | # @DEFAULT-UNSET |
26 | # @DEFAULT-UNSET |
| 27 | # @DESCRIPTION: |
27 | # @DESCRIPTION: |
| 28 | # Extra configure opts passed to econf |
28 | # Extra configure opts passed to econf |
| 29 | G2CONF=${G2CONF:-""} |
29 | G2CONF=${G2CONF:-""} |
| 30 | |
30 | |
|
|
31 | # @ECLASS-VARIABLE: GNOME2_LA_PUNT |
|
|
32 | # @DESCRIPTION: |
|
|
33 | # Should we delete all the .la files? |
|
|
34 | # NOT to be used without due consideration. |
|
|
35 | GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"} |
|
|
36 | |
| 31 | # @ECLASS-VARIABLE: ELTCONF |
37 | # @ECLASS-VARIABLE: ELTCONF |
| 32 | # @DEFAULT-UNSET |
38 | # @DEFAULT-UNSET |
| 33 | # @DESCRIPTION: |
39 | # @DESCRIPTION: |
| 34 | # Extra options passed to elibtoolize |
40 | # Extra options passed to elibtoolize |
| 35 | ELTCONF=${ELTCONF:-""} |
41 | ELTCONF=${ELTCONF:-""} |
| … | |
… | |
| 39 | # @DEPRECATED |
45 | # @DEPRECATED |
| 40 | # @DESCRIPTION: |
46 | # @DESCRIPTION: |
| 41 | # Should we use EINSTALL instead of DESTDIR |
47 | # Should we use EINSTALL instead of DESTDIR |
| 42 | USE_EINSTALL=${USE_EINSTALL:-""} |
48 | USE_EINSTALL=${USE_EINSTALL:-""} |
| 43 | |
49 | |
| 44 | # @ECLASS-VARIABLE: USE_EINSTALL |
50 | # @ECLASS-VARIABLE: SCROLLKEEPER_UPDATE |
| 45 | # @DEPRECATED |
51 | # @DEPRECATED |
| 46 | # @DESCRIPTION: |
52 | # @DESCRIPTION: |
| 47 | # Whether to run scrollkeeper for this package or not. |
53 | # Whether to run scrollkeeper for this package or not. |
| 48 | SCROLLKEEPER_UPDATE=${SCROLLKEEPER_UPDATE:-"1"} |
54 | SCROLLKEEPER_UPDATE=${SCROLLKEEPER_UPDATE:-"1"} |
| 49 | |
55 | |
| … | |
… | |
| 83 | gnome2_src_prepare() { |
89 | gnome2_src_prepare() { |
| 84 | # Prevent scrollkeeper access violations |
90 | # Prevent scrollkeeper access violations |
| 85 | gnome2_omf_fix |
91 | gnome2_omf_fix |
| 86 | |
92 | |
| 87 | # Run libtoolize |
93 | # Run libtoolize |
|
|
94 | if has ${EAPI:-0} 0 1 2 3; then |
| 88 | elibtoolize ${ELTCONF} |
95 | elibtoolize ${ELTCONF} |
|
|
96 | else |
|
|
97 | # Everything is fatal EAPI 4 onwards |
|
|
98 | nonfatal elibtoolize ${ELTCONF} |
|
|
99 | fi |
|
|
100 | |
| 89 | } |
101 | } |
| 90 | |
102 | |
| 91 | # @FUNCTION: gnome2_src_configure |
103 | # @FUNCTION: gnome2_src_configure |
| 92 | # @DESCRIPTION: |
104 | # @DESCRIPTION: |
| 93 | # Gnome specific configure handling |
105 | # Gnome specific configure handling |
| … | |
… | |
| 98 | G2CONF="${G2CONF} --enable-debug=yes" |
110 | G2CONF="${G2CONF} --enable-debug=yes" |
| 99 | fi |
111 | fi |
| 100 | fi |
112 | fi |
| 101 | |
113 | |
| 102 | # Prevent a QA warning |
114 | # Prevent a QA warning |
| 103 | if hasq doc ${IUSE} ; then |
115 | if has doc ${IUSE} ; then |
| 104 | G2CONF="${G2CONF} $(use_enable doc gtk-doc)" |
116 | G2CONF="${G2CONF} $(use_enable doc gtk-doc)" |
| 105 | fi |
117 | fi |
| 106 | |
118 | |
| 107 | # Avoid sandbox violations caused by misbehaving packages (bug #128289) |
119 | # Avoid sandbox violations caused by misbehaving packages (bug #128289) |
| 108 | addwrite "/root/.gnome2" |
120 | addwrite "/root/.gnome2" |
| … | |
… | |
| 120 | } |
132 | } |
| 121 | |
133 | |
| 122 | # @FUNCTION: gnome2_src_install |
134 | # @FUNCTION: gnome2_src_install |
| 123 | # @DESCRIPTION: |
135 | # @DESCRIPTION: |
| 124 | # Gnome specific install. Handles typical GConf and scrollkeeper setup |
136 | # Gnome specific install. Handles typical GConf and scrollkeeper setup |
| 125 | # in packages. |
137 | # in packages and removal of .la files if requested |
| 126 | gnome2_src_install() { |
138 | gnome2_src_install() { |
| 127 | has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" |
139 | has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" |
| 128 | # if this is not present, scrollkeeper-update may segfault and |
140 | # if this is not present, scrollkeeper-update may segfault and |
| 129 | # create bogus directories in /var/lib/ |
141 | # create bogus directories in /var/lib/ |
| 130 | local sk_tmp_dir="/var/lib/scrollkeeper" |
142 | local sk_tmp_dir="/var/lib/scrollkeeper" |
| … | |
… | |
| 157 | fi |
169 | fi |
| 158 | rm -rf "${ED}${sk_tmp_dir}" |
170 | rm -rf "${ED}${sk_tmp_dir}" |
| 159 | |
171 | |
| 160 | # Make sure this one doesn't get in the portage db |
172 | # Make sure this one doesn't get in the portage db |
| 161 | rm -fr "${ED}/usr/share/applications/mimeinfo.cache" |
173 | rm -fr "${ED}/usr/share/applications/mimeinfo.cache" |
|
|
174 | |
|
|
175 | # Delete all .la files |
|
|
176 | if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then |
|
|
177 | ebegin "Removing .la files" |
|
|
178 | find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed" |
|
|
179 | eend |
|
|
180 | fi |
| 162 | } |
181 | } |
| 163 | |
182 | |
| 164 | # @FUNCTION: gnome2_pkg_preinst |
183 | # @FUNCTION: gnome2_pkg_preinst |
| 165 | # @DESCRIPTION: |
184 | # @DESCRIPTION: |
| 166 | # Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst |
185 | # Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst |