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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sun Aug 2 18:55:46 2009 UTC (11 years, 4 months ago) by darkside
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
bug fixes from mozilla overlay, proxy commit for mozilla team
(Portage version: 2.1.6.13/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.5.1.ebuild,v 1.3 2009/07/22 05:40:32 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 DESKTOP_PV="3.5"
18 MY_PV="${PV/_beta/b}" # Handle betas for SRC_URI
19 MY_PV="${PV/_/}" # Handle rcs for SRC_URI
20 PATCH="${PN}-3.5-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? ( >=www-plugins/noscript-1.8.7 )"
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
113 src_unpack() {
114 unpack ${A}
115
116 if use iceweasel; then
117 unpack iceweasel-icons-3.0.tar.bz2
118
119 cp -r iceweaselicons/browser "${WORKDIR}"
120 fi
121
122 linguas
123 for X in ${linguas}; do
124 # FIXME: Add support for unpacking xpis to portage
125 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
126 done
127 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
128 einfo "Selected language packs (first will be default): ${linguas}"
129 fi
130 }
131
132 src_prepare() {
133 # Apply our patches
134 EPATCH_SUFFIX="patch" \
135 EPATCH_FORCE="yes" \
136 epatch "${WORKDIR}"
137
138 if use iceweasel; then
139 sed -i -e "s|Minefield|Iceweasel|" browser/locales/en-US/chrome/branding/brand.* \
140 browser/branding/nightly/configure.sh
141 fi
142
143 eautoreconf
144
145 cd js/src
146 eautoreconf
147
148 # We need to re-patch this because autoreconf overwrites it
149 # epatch "${WORKDIR}"/patch/000_flex-configure-LANG.patch
150 }
151
152 src_configure() {
153 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
154 MEXTENSIONS="default"
155
156 ####################################
157 #
158 # mozconfig, CFLAGS and CXXFLAGS setup
159 #
160 ####################################
161
162 mozconfig_init
163 mozconfig_config
164
165 # It doesn't compile on alpha without this LDFLAGS
166 use alpha && append-ldflags "-Wl,--no-relax"
167
168 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
169 mozconfig_annotate '' --enable-application=browser
170 mozconfig_annotate '' --disable-mailnews
171 mozconfig_annotate 'broken' --disable-crashreporter
172 mozconfig_annotate '' --enable-image-encoder=all
173 mozconfig_annotate '' --enable-canvas
174 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
175 # regardless of java setting.
176 mozconfig_annotate '' --enable-oji --enable-mathml
177 mozconfig_annotate 'places' --enable-storage --enable-places
178 mozconfig_annotate '' --enable-safe-browsing
179
180 # System-wide install specs
181 mozconfig_annotate '' --disable-installer
182 mozconfig_annotate '' --disable-updater
183 mozconfig_annotate '' --disable-strip
184 mozconfig_annotate '' --disable-install-strip
185
186 # Use system libraries
187 mozconfig_annotate '' --enable-system-cairo
188 mozconfig_annotate '' --enable-system-hunspell
189 mozconfig_annotate '' --enable-system-sqlite
190 mozconfig_annotate '' --with-system-nspr
191 mozconfig_annotate '' --with-system-nss
192 mozconfig_annotate '' --enable-system-lcms
193 mozconfig_annotate '' --with-system-bz2
194 mozconfig_annotate '' --with-system-libxul
195 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-devel-${XUL_PV}
196
197 # IUSE mozdevelop
198 mozconfig_use_enable mozdevelop jsd
199 mozconfig_use_enable mozdevelop xpctools
200 #mozconfig_use_extension mozdevelop venkman
201
202 # IUSE qt-experimental
203 # if use qt-experimental; then
204 # ewarn "You are enabling the EXPERIMENTAL qt toolkit"
205 # ewarn "Usage is at your own risk"
206 # ewarn "Known to be broken. DO NOT file bugs."
207 # mozconfig_annotate '' --disable-system-cairo
208 # mozconfig_annotate 'qt-experimental' --enable-default-toolkit=cairo-qt
209 # else
210 mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
211 # fi
212
213 # Other ff-specific settings
214 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
215
216 if ! use bindist && ! use iceweasel; then
217 mozconfig_annotate '' --enable-official-branding
218 fi
219
220 # Finalize and report settings
221 mozconfig_final
222
223 if [[ $(gcc-major-version) -lt 4 ]]; then
224 append-cxxflags -fno-stack-protector
225 fi
226
227 ####################################
228 #
229 # Configure and build
230 #
231 ####################################
232
233 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
234 econf || die
235 }
236
237 src_compile() {
238 # Should the build use multiprocessing? Not enabled by default, as it tends to break
239 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
240 emake ${jobs} || die
241 }
242
243 src_install() {
244 emake DESTDIR="${D}" install || die "emake install failed"
245 rm "${D}"/usr/bin/firefox
246
247 linguas
248 for X in ${linguas}; do
249 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
250 done
251
252 cp "${FILESDIR}"/gentoo-default-prefs.js \
253 "${D}"${MOZILLA_FIVE_HOME}/defaults/preferences/all-gentoo.js
254
255 local LANG=${linguas%% *}
256 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
257 elog "Setting default locale to ${LANG}"
258 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
259 ${MOZILLA_FIVE_HOME}/defaults/preferences/firefox.js \
260 ${MOZILLA_FIVE_HOME}/defaults/preferences/firefox-l10n.js || \
261 die "sed failed to change locale"
262 fi
263
264 # Install icon and .desktop for menu entry
265 if use iceweasel; then
266 newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
267 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
268 ${PN}-${DESKTOP_PV}.desktop
269 elif ! use bindist; then
270 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
271 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
272 ${PN}-${DESKTOP_PV}.desktop
273 else
274 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
275 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
276 ${PN}-${DESKTOP_PV}.desktop
277 sed -e "s/Bon Echo/Minefield/" \
278 -i "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop
279 fi
280
281 # Add StartupNotify=true bug 237317
282 if use startup-notification; then
283 echo "StartupNotify=true" >> "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop
284 fi
285
286 # Create /usr/bin/firefox
287 cat <<EOF >"${D}"/usr/bin/firefox
288 #!/bin/sh
289 export LD_LIBRARY_PATH="${MOZILLA_FIVE_HOME}\${LD_LIBRARY_PATH+":\${LD_LIBRARY_PATH}"}"
290 exec "${MOZILLA_FIVE_HOME}"/firefox "\$@"
291 EOF
292
293 fperms 0755 /usr/bin/firefox
294
295 # Plugins dir
296 ln -s "${D}"/usr/$(get_libdir)/{nsbrowser,mozilla-firefox}/plugins
297 }
298
299 pkg_postinst() {
300 ewarn "All the packages built against ${PN} won't compile,"
301 ewarn "any package that fails to build warrants a bug report."
302 elog
303
304 # Update mimedb for the new .desktop file
305 fdo-mime_desktop_database_update
306 }

  ViewVC Help
Powered by ViewVC 1.1.20