| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 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.64 2006/03/17 14:43:32 allanonjl Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.73 2006/08/03 17:04:47 foser Exp $ |
| 4 | |
4 | |
| 5 | # GNOME 2 ECLASS |
5 | # GNOME 2 ECLASS |
| 6 | inherit libtool gnome.org debug fdo-mime eutils |
6 | inherit libtool gnome.org debug fdo-mime eutils |
| 7 | |
7 | |
| 8 | # Extra configure opts passed to econf |
8 | # Extra configure opts passed to econf |
| … | |
… | |
| 24 | SCROLLKEEPER_UPDATE_BIN=${SCROLLKEEPER_UPDATE_BIN:="${ROOT}/usr/bin/scrollkeeper-update"} |
24 | SCROLLKEEPER_UPDATE_BIN=${SCROLLKEEPER_UPDATE_BIN:="${ROOT}/usr/bin/scrollkeeper-update"} |
| 25 | |
25 | |
| 26 | # Path to gconftool-2 |
26 | # Path to gconftool-2 |
| 27 | GCONFTOOL_BIN=${GCONFTOOL_BIN:="${ROOT}/usr/bin/gconftool-2"} |
27 | GCONFTOOL_BIN=${GCONFTOOL_BIN:="${ROOT}/usr/bin/gconftool-2"} |
| 28 | |
28 | |
|
|
29 | if [[ ${GCONF_DEBUG} != "no" ]]; then |
| 29 | IUSE="debug" |
30 | IUSE="debug" |
|
|
31 | fi |
| 30 | |
32 | |
| 31 | DEPEND=">=sys-apps/sed-4 |
33 | DEPEND=">=sys-apps/sed-4" |
| 32 | sys-apps/findutils" |
|
|
| 33 | |
34 | |
| 34 | gnome2_src_unpack() { |
35 | gnome2_src_unpack() { |
| 35 | unpack ${A} |
36 | unpack ${A} |
| 36 | cd ${S} |
37 | cd ${S} |
| 37 | |
38 | |
| … | |
… | |
| 39 | gnome2_omf_fix |
40 | gnome2_omf_fix |
| 40 | } |
41 | } |
| 41 | |
42 | |
| 42 | gnome2_src_configure() { |
43 | gnome2_src_configure() { |
| 43 | # Update the GNOME configuration options |
44 | # Update the GNOME configuration options |
|
|
45 | if [[ ${GCONF_DEBUG} != 'no' ]] ; then |
|
|
46 | if use debug ; then |
| 44 | use debug && G2CONF="${G2CONF} --enable-debug=yes" |
47 | G2CONF="${G2CONF} --enable-debug=yes" |
|
|
48 | fi |
|
|
49 | fi |
| 45 | G2CONF="${G2CONF} $(use_enable doc gtk-doc)" |
50 | G2CONF="${G2CONF} $(use_enable doc gtk-doc)" |
| 46 | |
51 | |
| 47 | # Run libtoolize |
52 | # Run libtoolize |
| 48 | elibtoolize ${ELTCONF} |
53 | elibtoolize ${ELTCONF} |
|
|
54 | |
|
|
55 | # Do not remove the addwrite. bug #128289 |
|
|
56 | addwrite "${ROOT}/root/.gnome2" |
| 49 | |
57 | |
| 50 | # GST_REGISTRY is to work around gst-inspect trying to read/write /root |
58 | # GST_REGISTRY is to work around gst-inspect trying to read/write /root |
| 51 | GST_REGISTRY="${S}/registry.xml" econf "$@" ${G2CONF} || die "configure failed" |
59 | GST_REGISTRY="${S}/registry.xml" econf "$@" ${G2CONF} || die "configure failed" |
| 52 | } |
60 | } |
| 53 | |
61 | |
| … | |
… | |
| 64 | # we must delay gconf schema installation due to sandbox |
72 | # we must delay gconf schema installation due to sandbox |
| 65 | export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1" |
73 | export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1" |
| 66 | |
74 | |
| 67 | debug-print "You are testing with DESTDIR by default - AllanonJL" |
75 | debug-print "You are testing with DESTDIR by default - AllanonJL" |
| 68 | if [[ -z "${USE_EINSTALL}" || "${USE_EINSTALL}" = "0" ]]; then |
76 | if [[ -z "${USE_EINSTALL}" || "${USE_EINSTALL}" = "0" ]]; then |
| 69 | make DESTDIR=${D} "$@" install || die "install failed" |
77 | make DESTDIR=${D} "scrollkeeper_localstate_dir=${D}${SCROLLKEEPER_DIR} " "$@" install || die "install failed" |
| 70 | else |
78 | else |
| 71 | einstall "scrollkeeper_localstate_dir=${D}${SCROLLKEEPER_DIR} " "$@" || die "einstall failed" |
79 | einstall "scrollkeeper_localstate_dir=${D}${SCROLLKEEPER_DIR} " "$@" || die "einstall failed" |
| 72 | fi |
80 | fi |
| 73 | |
81 | |
| 74 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
82 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
| … | |
… | |
| 92 | rm -fr "${D}/usr/share/applications/mimeinfo.cache" |
100 | rm -fr "${D}/usr/share/applications/mimeinfo.cache" |
| 93 | } |
101 | } |
| 94 | |
102 | |
| 95 | |
103 | |
| 96 | gnome2_gconf_install() { |
104 | gnome2_gconf_install() { |
|
|
105 | |
| 97 | if [[ -x ${GCONFTOOL_BIN} ]]; then |
106 | if [[ -x ${GCONFTOOL_BIN} ]]; then |
| 98 | # We are ready to install the GCONF Scheme now |
107 | # We are ready to install the GCONF Scheme now |
| 99 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
108 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
| 100 | export GCONF_CONFIG_SOURCE=$(${GCONFTOOL_BIN} --get-default-source) |
109 | export GCONF_CONFIG_SOURCE=$(${GCONFTOOL_BIN} --get-default-source) |
| 101 | |
110 | |
| … | |
… | |
| 107 | if [[ -e "${F}" ]]; then |
116 | if [[ -e "${F}" ]]; then |
| 108 | # echo "DEBUG::gconf install ${F}" |
117 | # echo "DEBUG::gconf install ${F}" |
| 109 | ${GCONFTOOL_BIN} --makefile-install-rule ${F} 1>/dev/null |
118 | ${GCONFTOOL_BIN} --makefile-install-rule ${F} 1>/dev/null |
| 110 | fi |
119 | fi |
| 111 | done |
120 | done |
|
|
121 | |
|
|
122 | # have gconf reload the new schemas |
|
|
123 | ebegin "Reloading GConf schemas" |
|
|
124 | killall -HUP gconfd-2 |
|
|
125 | eend $? |
| 112 | fi |
126 | fi |
|
|
127 | |
| 113 | } |
128 | } |
| 114 | |
129 | |
| 115 | gnome2_gconf_uninstall() { |
130 | gnome2_gconf_uninstall() { |
| 116 | if [[ -x ${GCONFTOOL_BIN} ]]; then |
131 | if [[ -x ${GCONFTOOL_BIN} ]]; then |
| 117 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
132 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
| … | |
… | |
| 175 | done |
190 | done |
| 176 | |
191 | |
| 177 | eend ${retval} |
192 | eend ${retval} |
| 178 | |
193 | |
| 179 | for (( i = 0 ; i < ${#fails[@]} ; i++ )) ; do |
194 | for (( i = 0 ; i < ${#fails[@]} ; i++ )) ; do |
|
|
195 | ### HACK!! This is needed until bash 3.1 is unmasked. |
|
|
196 | ## The current stable version of bash lists the sizeof fails to be 1 |
|
|
197 | ## when there are no elements in the list because it is declared local. |
|
|
198 | ## In order to prevent the declaration from being in global scope, we |
|
|
199 | ## this hack to prevent an empty error message being printed for stable |
|
|
200 | ## users. -- compnerd && allanonjl |
|
|
201 | if [[ "${fails[i]}" != "" && "${fails[i]}" != "()" ]] ; then |
| 180 | eerror "Failed to update cache with icon ${fails[i]}" |
202 | eerror "Failed to update cache with icon ${fails[i]}" |
|
|
203 | fi |
| 181 | done |
204 | done |
| 182 | } |
205 | } |
| 183 | |
206 | |
| 184 | gnome2_omf_fix() { |
207 | gnome2_omf_fix() { |
| 185 | # workaround/patch against omf.make or omf-install/Makefile.in |
208 | # workaround/patch against omf.make or omf-install/Makefile.in |
| … | |
… | |
| 204 | |
227 | |
| 205 | # testing fixing of all makefiles found |
228 | # testing fixing of all makefiles found |
| 206 | for filename in $(find ./ -name "Makefile.in" -o -name "Makefile.am") ; do |
229 | for filename in $(find ./ -name "Makefile.in" -o -name "Makefile.am") ; do |
| 207 | omf_makefiles="${omf_makefiles} ${filename}" |
230 | omf_makefiles="${omf_makefiles} ${filename}" |
| 208 | done |
231 | done |
| 209 | |
232 | |
| 210 | ebegin "Fixing OMF Makefiles" |
233 | ebegin "Fixing OMF Makefiles" |
| 211 | |
234 | |
| 212 | local retval=0 |
235 | local retval=0 |
| 213 | local fails=( ) |
236 | local fails=( ) |
| 214 | |
237 | |
| … | |
… | |
| 229 | done |
252 | done |
| 230 | |
253 | |
| 231 | eend $retval |
254 | eend $retval |
| 232 | |
255 | |
| 233 | for (( i = 0 ; i < ${#fails[@]} ; i++ )) ; do |
256 | for (( i = 0 ; i < ${#fails[@]} ; i++ )) ; do |
|
|
257 | ### HACK!! This is needed until bash 3.1 is unmasked. |
|
|
258 | ## The current stable version of bash lists the sizeof fails to be 1 |
|
|
259 | ## when there are no elements in the list because it is declared local. |
|
|
260 | ## In order to prevent the declaration from being in global scope, we |
|
|
261 | ## this hack to prevent an empty error message being printed for stable |
|
|
262 | ## users. -- compnerd && allanonjl |
|
|
263 | if [[ "${fails[i]}" != "" && "${fails[i]}" != "()" ]] ; then |
| 234 | eerror "Failed to update OMF Makefile ${fails[i]}" |
264 | eerror "Failed to update OMF Makefile ${fails[i]}" |
|
|
265 | fi |
| 235 | done |
266 | done |
| 236 | } |
267 | } |
| 237 | |
268 | |
| 238 | gnome2_scrollkeeper_update() { |
269 | gnome2_scrollkeeper_update() { |
| 239 | if [[ -x ${SCROLLKEEPER_UPDATE_BIN} && "${SCROLLKEEPER_UPDATE}" = "1" ]] |
270 | if [[ -x ${SCROLLKEEPER_UPDATE_BIN} && "${SCROLLKEEPER_UPDATE}" = "1" ]] |