/[gentoo-x86]/www-client/mozilla-firefox/mozilla-firefox-3.0.11.ebuild
Gentoo

Contents of /www-client/mozilla-firefox/mozilla-firefox-3.0.11.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Sat Jan 2 23:36:09 2010 UTC (10 years, 10 months ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
remove stale ebuilds
(Portage version: 2.1.7.16/cvs/Linux x86_64)

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-3.0.11.ebuild,v 1.10 2009/12/13 11:52:30 nirbheek Exp $
4 EAPI="2"
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib fdo-mime autotools mozextension
8 PATCH="${PN}-3.0.10-patches-0.1"
9
10 LANGS="af ar be bg bn-IN ca cs cy da de el en-GB en-US eo es-AR es-ES et eu fi fr fy-NL ga-IE gl gu-IN he hi-IN hu id is it ja ka kn ko ku lt lv mk mn mr nb-NO nl nn-NO oc pa-IN pl pt-BR pt-PT ro ru si sk sl sq sr sv-SE te th tr uk zh-CN zh-TW"
11 NOSHORTLANGS="en-GB es-AR pt-BR zh-CN"
12
13 MY_PV=${PV/3/}
14
15 DESCRIPTION="Firefox Web Browser"
16 HOMEPAGE="http://www.mozilla.com/firefox"
17
18 KEYWORDS="sparc"
19 SLOT="0"
20 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
21 IUSE="java mozdevelop bindist restrict-javascript iceweasel +xulrunner"
22
23 SRC_URI="mirror://gentoo/${P}.tar.bz2
24 http://dev.gentoo.org/~armin76/dist/${P}.tar.bz2
25 mirror://gentoo/${PATCH}.tar.bz2
26 http://dev.gentoo.org/~armin76/dist/${PATCH}.tar.bz2
27 iceweasel? ( mirror://gentoo/iceweasel-icons-3.0.tar.bz2 )
28 !xulrunner? ( mirror://gentoo/xulrunner-1.9${MY_PV}.tar.bz2 )"
29
30 REL_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases"
31 for X in ${LANGS} ; do
32 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
33 SRC_URI="${SRC_URI}
34 linguas_${X/-/_}? ( ${REL_URI}/${PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
35 fi
36 IUSE="${IUSE} linguas_${X/-/_}"
37 # english is handled internally
38 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
39 if [ "${X}" != "en-US" ]; then
40 SRC_URI="${SRC_URI}
41 linguas_${X%%-*}? ( ${REL_URI}/${PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
42 fi
43 IUSE="${IUSE} linguas_${X%%-*}"
44 fi
45 done
46
47 RDEPEND="java? ( virtual/jre )
48 >=sys-devel/binutils-2.16.1
49 >=dev-libs/nss-3.12.2
50 >=dev-libs/nspr-4.7.4
51 >=app-text/hunspell-1.1.9
52 >=media-libs/lcms-1.17
53 x11-libs/cairo[X]
54 x11-libs/pango[X]
55 xulrunner? ( =net-libs/xulrunner-1.9.0* )"
56
57 DEPEND="${RDEPEND}
58 dev-util/pkgconfig
59 java? ( >=dev-java/java-config-0.2.0 )"
60
61 PDEPEND="restrict-javascript? ( www-plugins/noscript )"
62
63 S="${WORKDIR}/mozilla"
64
65 # Needed by src_compile() and src_install().
66 # Would do in pkg_setup but that loses the export attribute, they
67 # become pure shell variables.
68 export MOZ_CO_PROJECT=browser
69 export BUILD_OFFICIAL=1
70 export MOZILLA_OFFICIAL=1
71
72 linguas() {
73 local LANG SLANG
74 for LANG in ${LINGUAS}; do
75 if has ${LANG} en en_US; then
76 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
77 continue
78 elif has ${LANG} ${LANGS//-/_}; then
79 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
80 continue
81 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
82 for X in ${LANGS}; do
83 if [[ "${X}" == "${LANG}-"* ]] && \
84 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
85 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
86 continue 2
87 fi
88 done
89 fi
90 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
91 done
92 }
93
94 pkg_setup(){
95 if ! use bindist && ! use iceweasel; then
96 elog "You are enabling official branding. You may not redistribute this build"
97 elog "to any users on your network or the internet. Doing so puts yourself into"
98 elog "a legal problem with Mozilla Foundation"
99 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
100
101 fi
102 }
103
104 src_unpack() {
105 ! use xulrunner && unpack xulrunner-1.9${MY_PV}.tar.bz2
106 unpack ${P}.tar.bz2 ${PATCH}.tar.bz2
107
108 if use iceweasel; then
109 unpack iceweasel-icons-3.0.tar.bz2
110
111 cp -r iceweaselicons/browser/app/* mozilla/browser/branding/unofficial
112 cp iceweaselicons/browser/base/branding/icon48.png mozilla/browser/branding/unofficial/default48.png
113 cp -r iceweaselicons/browser/base/branding/* mozilla/browser/branding/unofficial/content
114 fi
115
116 linguas
117 for X in ${linguas}; do
118 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
119 done
120 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
121 einfo "Selected language packs (first will be default): ${linguas}"
122 fi
123 }
124
125 src_prepare() {
126 # Remove the patches we don't need
127 use xulrunner && rm "${WORKDIR}"/patch/*noxul* || rm "${WORKDIR}"/patch/*xulonly*
128
129 # Apply our patches
130 cd "${S}" || die "cd failed"
131 EPATCH_SUFFIX="patch" \
132 EPATCH_FORCE="yes" \
133 epatch "${WORKDIR}"/patch
134
135 if use iceweasel; then
136 sed -i -e "s|Gran Paradiso|Iceweasel|" browser/branding/unofficial/locales/en-US/brand.*
137 sed -i -e "s|GranParadiso|Iceweasel|" browser/branding/unofficial/configure.sh
138 fi
139
140 eautoreconf
141
142 # We need to re-patch this because autoreconf overwrites it
143 epatch "${WORKDIR}"/patch/000_flex-configure-LANG.patch
144 }
145
146 src_configure() {
147 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
148 MEXTENSIONS="default,typeaheadfind"
149
150 ####################################
151 #
152 # mozconfig, CFLAGS and CXXFLAGS setup
153 #
154 ####################################
155
156 mozconfig_init
157 mozconfig_config
158
159 # It doesn't compile on alpha without this LDFLAGS
160 use alpha && append-ldflags "-Wl,--no-relax"
161
162 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
163 mozconfig_annotate '' --disable-mailnews
164 mozconfig_annotate 'broken' --disable-mochitest
165 mozconfig_annotate 'broken' --disable-crashreporter
166 mozconfig_annotate '' --enable-system-hunspell
167 #mozconfig_annotate '' --enable-system-sqlite
168 mozconfig_annotate '' --enable-image-encoder=all
169 mozconfig_annotate '' --enable-canvas
170 mozconfig_annotate '' --with-system-nspr
171 mozconfig_annotate '' --with-system-nss
172 mozconfig_annotate '' --enable-system-lcms
173 mozconfig_annotate '' --enable-oji --enable-mathml
174 mozconfig_annotate 'places' --enable-storage --enable-places
175
176 # Other ff-specific settings
177 #mozconfig_use_enable mozdevelop jsd
178 #mozconfig_use_enable mozdevelop xpctools
179 mozconfig_use_extension mozdevelop venkman
180 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
181 if use xulrunner; then
182 # Add xulrunner variable
183 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-1.9
184 fi
185
186 if ! use bindist && ! use iceweasel ; then
187 mozconfig_annotate '' --enable-official-branding
188 elif use bindist || use iceweasel ; then
189 mozconfig_annotate 'bindist' --with-branding=browser/branding/unofficial
190 fi
191
192 # Finalize and report settings
193 mozconfig_final
194
195 ####################################
196 #
197 # Configure and build
198 #
199 ####################################
200
201 if [[ $(gcc-major-version) -lt 4 ]]; then
202 append-cxxflags -fno-stack-protector
203 fi
204
205 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
206 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
207 econf || die
208
209 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
210 # to econf, but the quotes cause configure to fail.
211 sed -i -e \
212 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
213 "${S}"/config/autoconf.mk \
214 "${S}"/toolkit/content/buildconfig.html
215 }
216
217 src_compile() {
218 # Should the build use multiprocessing? Not enabled by default, as it tends to break
219 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
220 emake ${jobs} || die
221 }
222
223 src_install() {
224 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
225
226 emake DESTDIR="${D}" install || die "emake install failed"
227 rm "${D}"/usr/bin/firefox
228
229 linguas
230 for X in ${linguas}; do
231 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
232 done
233
234 use xulrunner && prefs=preferences || prefs=pref
235 cp "${FILESDIR}"/gentoo-default-prefs.js "${D}"${MOZILLA_FIVE_HOME}/defaults/${prefs}/all-gentoo.js
236
237 local LANG=${linguas%% *}
238 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
239 elog "Setting default locale to ${LANG}"
240 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
241 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox.js \
242 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox-l10n.js || \
243 die "sed failed to change locale"
244 fi
245
246 # Install icon and .desktop for menu entry
247 if use iceweasel; then
248 newicon "${S}"/browser/branding/unofficial/default48.png iceweasel-icon.png
249 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
250 mozilla-firefox-3.0.desktop
251 elif ! use bindist; then
252 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
253 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
254 mozilla-firefox-3.0.desktop
255 else
256 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
257 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
258 mozilla-firefox-3.0.desktop
259 sed -i -e "s/Bon Echo/Gran Paradiso/" "${D}"/usr/share/applications/mozilla-firefox-3.0.desktop
260 fi
261
262 if use xulrunner; then
263 # Create /usr/bin/firefox
264 cat <<EOF >"${D}"/usr/bin/firefox
265 #!/bin/sh
266 export LD_LIBRARY_PATH="${MOZILLA_FIVE_HOME}"
267 exec "${MOZILLA_FIVE_HOME}"/firefox "\$@"
268 EOF
269 fperms 0755 /usr/bin/firefox
270 else
271 # Create /usr/bin/firefox
272 make_wrapper firefox "${MOZILLA_FIVE_HOME}/firefox"
273
274 # Add vendor
275 echo "pref(\"general.useragent.vendor\",\"Gentoo\");" \
276 >> "${D}"${MOZILLA_FIVE_HOME}/defaults/pref/vendor.js
277 fi
278
279 }
280
281 pkg_postinst() {
282 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
283
284 ewarn "All the packages built against ${PN} won't compile,"
285 ewarn "if after installing firefox 3.0 you get some blockers,"
286 ewarn "please add 'xulrunner' to your USE-flags."
287
288 if use xulrunner; then
289 ln -s /usr/$(get_libdir)/xulrunner-1.9/defaults/autoconfig \
290 ${MOZILLA_FIVE_HOME}/defaults/autoconfig
291 fi
292
293 # Update mimedb for the new .desktop file
294 fdo-mime_desktop_database_update
295 }

  ViewVC Help
Powered by ViewVC 1.1.20