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

Contents of /www-client/mozilla-firefox/mozilla-firefox-3.5-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Jul 21 14:03:55 2009 UTC (11 years, 4 months ago) by nirbheek
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Bump to 3.5.1
(Portage version: 2.2_rc33/cvs/Linux i686)

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.5-r3.ebuild,v 1.1 2009/07/13 08:51:35 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
9 LANGS="af ar as be bg bn-BD bn-IN ca cs cy da de el en en-GB en-US eo es-AR
10 es-CL es-ES es-MX et eu fa fi fr fy-NL ga-IE gl gu-IN he hi-IN hr hu id is it ja
11 ka kk kn ko ku lt lv mk ml mn mr nb-NO nl nn-NO oc or pa-IN pl pt-BR pt-PT rm ro
12 ru si sk sl sq sr sv-SE ta-LK ta te th tr uk vi zh-CN zh-TW"
13 NOSHORTLANGS="en-GB es-AR es-CL es-MX pt-BR zh-CN zh-TW"
14
15 XUL_PV="1.9.1"
16 MAJ_PV="${PV/_*/}" # Without the _rc and _beta stuff
17 MY_PV="${PV/_beta/b}" # Handle betas for SRC_URI
18 MY_PV="${PV/_/}" # Handle rcs for SRC_URI
19 MY_PV="${MY_PV/1.9.1/3.5}" # Why is this here?
20 PATCH="${PN}-${MAJ_PV}-patches-0.1"
21
22 DESCRIPTION="Firefox Web Browser"
23 HOMEPAGE="http://www.mozilla.com/firefox"
24
25 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
26 SLOT="0"
27 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
28 IUSE="bindist iceweasel java mozdevelop restrict-javascript" # qt-experimental
29
30 REL_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases"
31 SRC_URI="${REL_URI}/${MY_PV}/source/firefox-${MY_PV}-source.tar.bz2
32 iceweasel? ( mirror://gentoo/iceweasel-icons-3.0.tar.bz2 )
33 mirror://gentoo/${PATCH}.tar.bz2"
34
35 for X in ${LANGS} ; do
36 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
37 SRC_URI="${SRC_URI}
38 linguas_${X/-/_}? ( ${REL_URI}/${MY_PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
39 fi
40 IUSE="${IUSE} linguas_${X/-/_}"
41 # english is handled internally
42 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
43 if [ "${X}" != "en-US" ]; then
44 SRC_URI="${SRC_URI}
45 linguas_${X%%-*}? ( ${REL_URI}/${PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
46 fi
47 IUSE="${IUSE} linguas_${X%%-*}"
48 fi
49 done
50
51 # Not working.
52 # qt-experimental? (
53 # x11-libs/qt-gui
54 # x11-libs/qt-core )
55 # =net-libs/xulrunner-${XUL_PV}*[java=,qt-experimental=]
56
57 RDEPEND="
58 >=sys-devel/binutils-2.16.1
59 >=dev-libs/nss-3.12.2
60 >=dev-libs/nspr-4.7.3
61 >=dev-db/sqlite-3.6.7
62 >=app-text/hunspell-1.2
63
64 >=net-libs/xulrunner-${XUL_PV}[java=]
65
66 >=x11-libs/cairo-1.8.8[X]
67 x11-libs/pango[X]"
68
69 DEPEND="${RDEPEND}
70 dev-util/pkgconfig"
71
72 PDEPEND="restrict-javascript? ( x11-plugins/noscript )"
73
74 S="${WORKDIR}/mozilla-${XUL_PV}"
75
76 # Needed by src_compile() and src_install().
77 # Would do in pkg_setup but that loses the export attribute, they
78 # become pure shell variables.
79 export BUILD_OFFICIAL=1
80 export MOZILLA_OFFICIAL=1
81
82 linguas() {
83 local LANG SLANG
84 for LANG in ${LINGUAS}; do
85 if has ${LANG} en en_US; then
86 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
87 continue
88 elif has ${LANG} ${LANGS//-/_}; then
89 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
90 continue
91 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
92 for X in ${LANGS}; do
93 if [[ "${X}" == "${LANG}-"* ]] && \
94 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
95 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
96 continue 2
97 fi
98 done
99 fi
100 ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA"
101 done
102 }
103
104 pkg_setup(){
105 if ! use bindist && ! use iceweasel; then
106 elog "You are enabling official branding. You may not redistribute this build"
107 elog "to any users on your network or the internet. Doing so puts yourself into"
108 elog "a legal problem with Mozilla Foundation"
109 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
110 fi
111
112 elog
113 elog "libgnomebreakpad now works with firefox so you can debug crashes using bug-buddy"
114 elog "If you don't have bug-buddy installed, ignore the gtk-warning at startup"
115 }
116
117 src_unpack() {
118 unpack ${A}
119
120 if use iceweasel; then
121 unpack iceweasel-icons-3.0.tar.bz2
122
123 cp -r iceweaselicons/browser "${WORKDIR}"
124 fi
125
126 linguas
127 for X in ${linguas}; do
128 # FIXME: Add support for unpacking xpis to portage
129 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
130 done
131 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
132 einfo "Selected language packs (first will be default): ${linguas}"
133 fi
134 }
135
136 src_prepare() {
137 # Apply our patches
138 EPATCH_SUFFIX="patch" \
139 EPATCH_FORCE="yes" \
140 epatch "${WORKDIR}"
141
142 if use iceweasel; then
143 sed -i -e "s|Minefield|Iceweasel|" browser/locales/en-US/chrome/branding/brand.* \
144 browser/branding/nightly/configure.sh
145 fi
146
147 eautoreconf
148
149 cd js/src
150 eautoreconf
151
152 # We need to re-patch this because autoreconf overwrites it
153 # epatch "${WORKDIR}"/patch/000_flex-configure-LANG.patch
154 }
155
156 src_configure() {
157 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
158 MEXTENSIONS="default"
159
160 ####################################
161 #
162 # mozconfig, CFLAGS and CXXFLAGS setup
163 #
164 ####################################
165
166 mozconfig_init
167 mozconfig_config
168
169 # It doesn't compile on alpha without this LDFLAGS
170 use alpha && append-ldflags "-Wl,--no-relax"
171
172 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
173 mozconfig_annotate '' --enable-application=browser
174 mozconfig_annotate '' --disable-mailnews
175 mozconfig_annotate 'broken' --disable-crashreporter
176 mozconfig_annotate '' --enable-image-encoder=all
177 mozconfig_annotate '' --enable-canvas
178 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
179 # regardless of java setting.
180 mozconfig_annotate '' --enable-oji --enable-mathml
181 mozconfig_annotate 'places' --enable-storage --enable-places
182 mozconfig_annotate '' --enable-safe-browsing
183
184 # System-wide install specs
185 mozconfig_annotate '' --disable-installer
186 mozconfig_annotate '' --disable-updater
187 mozconfig_annotate '' --disable-strip
188 mozconfig_annotate '' --disable-install-strip
189
190 # Use system libraries
191 mozconfig_annotate '' --enable-system-cairo
192 mozconfig_annotate '' --enable-system-hunspell
193 mozconfig_annotate '' --enable-system-sqlite
194 mozconfig_annotate '' --with-system-nspr
195 mozconfig_annotate '' --with-system-nss
196 mozconfig_annotate '' --enable-system-lcms
197 mozconfig_annotate '' --with-system-bz2
198 mozconfig_annotate '' --with-system-libxul
199 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-devel-${XUL_PV}
200
201 # IUSE mozdevelop
202 mozconfig_use_enable mozdevelop jsd
203 mozconfig_use_enable mozdevelop xpctools
204 #mozconfig_use_extension mozdevelop venkman
205
206 # IUSE qt-experimental
207 # if use qt-experimental; then
208 # ewarn "You are enabling the EXPERIMENTAL qt toolkit"
209 # ewarn "Usage is at your own risk"
210 # ewarn "Known to be broken. DO NOT file bugs."
211 # mozconfig_annotate '' --disable-system-cairo
212 # mozconfig_annotate 'qt-experimental' --enable-default-toolkit=cairo-qt
213 # else
214 mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
215 # fi
216
217 # Other ff-specific settings
218 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
219
220 if ! use bindist && ! use iceweasel; then
221 mozconfig_annotate '' --enable-official-branding
222 fi
223
224 # Finalize and report settings
225 mozconfig_final
226
227 if [[ $(gcc-major-version) -lt 4 ]]; then
228 append-cxxflags -fno-stack-protector
229 fi
230
231 ####################################
232 #
233 # Configure and build
234 #
235 ####################################
236
237 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
238 econf || die
239 }
240
241 src_compile() {
242 # Should the build use multiprocessing? Not enabled by default, as it tends to break
243 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
244 emake ${jobs} || die
245 }
246
247 src_install() {
248 emake DESTDIR="${D}" install || die "emake install failed"
249 rm "${D}"/usr/bin/firefox
250
251 linguas
252 for X in ${linguas}; do
253 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
254 done
255
256 cp "${FILESDIR}"/gentoo-default-prefs.js \
257 "${D}"${MOZILLA_FIVE_HOME}/defaults/preferences/all-gentoo.js
258
259 local LANG=${linguas%% *}
260 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
261 elog "Setting default locale to ${LANG}"
262 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
263 ${MOZILLA_FIVE_HOME}/defaults/preferences/firefox.js \
264 ${MOZILLA_FIVE_HOME}/defaults/preferences/firefox-l10n.js || \
265 die "sed failed to change locale"
266 fi
267
268 # Install icon and .desktop for menu entry
269 if use iceweasel; then
270 newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
271 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
272 ${PN}-${MAJ_PV}.desktop
273 elif ! use bindist; then
274 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
275 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
276 ${PN}-${MAJ_PV}.desktop
277 else
278 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
279 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
280 ${PN}-${MAJ_PV}.desktop
281 sed -e "s/Bon Echo/Minefield/" \
282 -i "${D}"/usr/share/applications/${PN}-${MAJ_PV}.desktop
283 fi
284
285 # Add StartupNotify=true bug 237317
286 if use startup-notification; then
287 echo "StartupNotify=true" >> "${D}"/usr/share/applications/${PN}-${MAJ_PV}.desktop
288 fi
289
290 # Create /usr/bin/firefox
291 cat <<EOF >"${D}"/usr/bin/firefox
292 #!/bin/sh
293 export LD_LIBRARY_PATH="${MOZILLA_FIVE_HOME}\${LD_LIBRARY_PATH+":\${LD_LIBRARY_PATH}"}"
294 exec "${MOZILLA_FIVE_HOME}"/firefox "\$@"
295 EOF
296
297 fperms 0755 /usr/bin/firefox
298
299 # Plugins dir
300 ln -s "${D}"/usr/$(get_libdir)/{nsbrowser,mozilla-firefox}/plugins
301 }
302
303 pkg_postinst() {
304 ewarn "All the packages built against ${PN} won't compile,"
305 ewarn "if after installing firefox 3.5 you get some blockers,"
306 ewarn "please add 'xulrunner' to your USE-flags."
307 elog
308
309 # Update mimedb for the new .desktop file
310 fdo-mime_desktop_database_update
311 }

  ViewVC Help
Powered by ViewVC 1.1.20