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

Contents of /www-client/mozilla-firefox/mozilla-firefox-3.6-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Mar 21 15:03:08 2010 UTC (10 years, 8 months ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Update for alignment issue in jemalloc, fix bug #310347
(Portage version: 2.1.8.3/cvs/Linux x86_64)

1 # Copyright 1999-2010 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.6-r4.ebuild,v 1.2 2010/03/06 14:12:08 anarchy Exp $
4 EAPI="2"
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib pax-utils fdo-mime autotools mozextension java-pkg-opt-2
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 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.2"
16 MAJ_XUL_PV="1.9.2"
17 MAJ_PV="${PV/_*/}" # Without the _rc and _beta stuff
18 DESKTOP_PV="3.6"
19 MY_PV="${PV/_rc/rc}" # Handle beta for SRC_URI
20 PATCH="${PN}-3.6-patches-0.6"
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="+alsa bindist java libnotify system-sqlite wifi"
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 http://dev.gentoo.org/~anarchy/dist/${PATCH}.tar.bz2"
33
34 for X in ${LANGS} ; do
35 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
36 SRC_URI="${SRC_URI}
37 linguas_${X/-/_}? ( ${REL_URI}/${MY_PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
38 fi
39 IUSE="${IUSE} linguas_${X/-/_}"
40 # english is handled internally
41 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
42 if [ "${X}" != "en-US" ]; then
43 SRC_URI="${SRC_URI}
44 linguas_${X%%-*}? ( ${REL_URI}/${PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
45 fi
46 IUSE="${IUSE} linguas_${X%%-*}"
47 fi
48 done
49
50 RDEPEND="
51 >=sys-devel/binutils-2.16.1
52 >=dev-libs/nss-3.12.4
53 >=dev-libs/nspr-4.8
54 >=app-text/hunspell-1.2
55 system-sqlite? ( >=dev-db/sqlite-3.6.22-r2[fts3,secure-delete] )
56 alsa? ( media-libs/alsa-lib )
57 >=x11-libs/cairo-1.8.8[X]
58 x11-libs/pango[X]
59 wifi? ( net-wireless/wireless-tools )
60 libnotify? ( >=x11-libs/libnotify-0.4 )
61 ~net-libs/xulrunner-${XUL_PV}[java=,wifi=,libnotify=,system-sqlite=]"
62
63 DEPEND="${RDEPEND}
64 java? ( >=virtual/jdk-1.4 )
65 dev-util/pkgconfig"
66
67 RDEPEND="${RDEPEND} java? ( >=virtual/jre-1.4 )"
68
69 S="${WORKDIR}/mozilla-1.9.2"
70
71 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
72
73 linguas() {
74 local LANG SLANG
75 for LANG in ${LINGUAS}; do
76 if has ${LANG} en en_US; then
77 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
78 continue
79 elif has ${LANG} ${LANGS//-/_}; then
80 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
81 continue
82 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
83 for X in ${LANGS}; do
84 if [[ "${X}" == "${LANG}-"* ]] && \
85 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
86 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
87 continue 2
88 fi
89 done
90 fi
91 ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA"
92 done
93 }
94
95 pkg_setup() {
96 # Ensure we always build with C locale.
97 export LANG="C"
98 export LC_ALL="C"
99 export LC_MESSAGES="C"
100 export LC_CTYPE="C"
101
102 if ! use bindist ; then
103 einfo
104 elog "You are enabling official branding. You may not redistribute this build"
105 elog "to any users on your network or the internet. Doing so puts yourself into"
106 elog "a legal problem with Mozilla Foundation"
107 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
108 fi
109
110 java-pkg-opt-2_pkg_setup
111 }
112
113 src_unpack() {
114 unpack firefox-${MY_PV}.source.tar.bz2 ${PATCH}.tar.bz2
115
116 linguas
117 for X in ${linguas}; do
118 # FIXME: Add support for unpacking xpis to portage
119 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
120 done
121 }
122
123 src_prepare() {
124 # Apply our patches
125 EPATCH_SUFFIX="patch" \
126 EPATCH_FORCE="yes" \
127 epatch "${WORKDIR}"
128
129 # Fix media build failure
130 epatch "${FILESDIR}/xulrunner-1.9.2-noalsa-fixup.patch"
131
132 eautoreconf
133
134 cd js/src
135 eautoreconf
136 }
137
138 src_configure() {
139 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
140 MEXTENSIONS="default"
141
142 ####################################
143 #
144 # mozconfig, CFLAGS and CXXFLAGS setup
145 #
146 ####################################
147
148 mozconfig_init
149 mozconfig_config
150
151 # It doesn't compile on alpha without this LDFLAGS
152 use alpha && append-ldflags "-Wl,--no-relax"
153
154 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
155 mozconfig_annotate '' --enable-application=browser
156 mozconfig_annotate '' --disable-mailnews
157 mozconfig_annotate 'broken' --disable-crashreporter
158 mozconfig_annotate '' --enable-image-encoder=all
159 mozconfig_annotate '' --enable-canvas
160 mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
161 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
162 # regardless of java setting.
163 mozconfig_annotate '' --enable-oji --enable-mathml
164 mozconfig_annotate 'places' --enable-storage --enable-places
165 mozconfig_annotate '' --enable-safe-browsing
166
167 # Build mozdevelop permately
168 mozconfig_annotate '' --enable-jsd --enable-xpctools
169
170 # System-wide install specs
171 mozconfig_annotate '' --disable-installer
172 mozconfig_annotate '' --disable-updater
173 mozconfig_annotate '' --disable-strip
174 mozconfig_annotate '' --disable-install-strip
175
176 # Use system libraries
177 mozconfig_annotate '' --enable-system-cairo
178 mozconfig_annotate '' --enable-system-hunspell
179 mozconfig_annotate '' --with-system-nspr
180 mozconfig_annotate '' --with-system-nss
181 mozconfig_annotate '' --enable-system-lcms
182 mozconfig_annotate '' --with-system-bz2
183 mozconfig_annotate '' --with-system-libxul
184 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-devel-${MAJ_XUL_PV}
185
186 mozconfig_use_enable libnotify
187 mozconfig_use_enable java javaxpcom
188 mozconfig_use_enable wifi necko-wifi
189 mozconfig_use_enable alsa ogg
190 mozconfig_use_enable alsa wave
191 mozconfig_use_enable system-sqlite
192 mozconfig_use_enable !bindist official-branding
193
194 # Other ff-specific settings
195 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
196
197 # Finalize and report settings
198 mozconfig_final
199
200 if [[ $(gcc-major-version) -lt 4 ]]; then
201 append-cxxflags -fno-stack-protector
202 fi
203
204 ####################################
205 #
206 # Configure and build
207 #
208 ####################################
209
210 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" econf
211 }
212
213 src_compile() {
214 # Should the build use multiprocessing? Not enabled by default, as it tends to break
215 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
216 emake ${jobs} || die
217 }
218
219 src_install() {
220 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
221
222 emake DESTDIR="${D}" install || die "emake install failed"
223
224 linguas
225 for X in ${linguas}; do
226 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
227 done
228
229 # Install icon and .desktop for menu entry
230 if ! use bindist ; then
231 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
232 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
233 ${PN}-${DESKTOP_PV}.desktop
234 else
235 newicon "${S}"//browser/branding/unofficial/content/icon48.png firefox-icon-unbranded.png
236 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
237 ${PN}-${DESKTOP_PV}.desktop
238 sed -i -e "s:Bon Echo:Namoroka:" \
239 "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop || die "sed failed!"
240 fi
241
242 # Add StartupNotify=true bug 237317
243 if use startup-notification ; then
244 echo "StartupNotify=true" >> "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop
245 fi
246
247 pax-mark m "${D}"/${MOZILLA_FIVE_HOME}/firefox
248
249 # Enable very specific settings not inherited from xulrunner
250 cp "${FILESDIR}"/firefox-default-prefs.js \
251 "${D}/${MOZILLA_FIVE_HOME}/defaults/preferences/all-gentoo.js" || \
252 die "failed to cp firefox-default-prefs.js"
253
254 # Plugins dir
255 dosym ../nsbrowser/plugins "${MOZILLA_FIVE_HOME}"/plugins \
256 || die "failed to symlink"
257
258 # very ugly hack to make firefox not sigbus on sparc
259 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
260 -i "${D}/${MOZILLA_FIVE_HOME}/application.ini" || \
261 die "sparc sed failed"; }
262 }
263
264 pkg_postinst() {
265 ewarn "All the packages built against ${PN} won't compile,"
266 ewarn "any package that fails to build warrants a bug report."
267 elog
268
269 # Update mimedb for the new .desktop file
270 fdo-mime_desktop_database_update
271 }

  ViewVC Help
Powered by ViewVC 1.1.20