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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Thu Mar 4 14:36:26 2010 UTC (10 years, 8 months ago) by nirbheek
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
Remove old, vulnerable 3.5.6
(Portage version: 2.1.7.17/cvs/Linux i686)

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.5.6.ebuild,v 1.10 2010/01/02 18:32:23 armin76 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
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.6"
16 MAJ_XUL_PV="1.9.1"
17 MAJ_PV="${PV/_*/}" # Without the _rc and _beta stuff
18 DESKTOP_PV="3.5"
19 MY_PV="${PV/_beta/b}" # Handle betas for SRC_URI
20 MY_PV="${PV/_/}" # Handle rcs for SRC_URI
21 PATCH="${PN}-3.5.5-patches-0.1"
22
23 DESCRIPTION="Firefox Web Browser"
24 HOMEPAGE="http://www.mozilla.com/firefox"
25
26 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86"
27 SLOT="0"
28 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
29 IUSE="+alsa bindist java mozdevelop sqlite iceweasel" # qt-experimental
30
31 REL_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases"
32 SRC_URI="${REL_URI}/${MY_PV}/source/firefox-${MY_PV}.source.tar.bz2
33 http://dev.gentoo.org/~anarchy/dist/${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 >=app-text/hunspell-1.2
62 sqlite? ( >=dev-db/sqlite-3.6.20-r1[fts3] )
63 alsa? ( media-libs/alsa-lib )
64 ~net-libs/xulrunner-${XUL_PV}[java=,sqlite=]
65 >=x11-libs/cairo-1.8.8[X]
66 x11-libs/pango[X]"
67
68 DEPEND="${RDEPEND}
69 dev-util/pkgconfig"
70
71 S="${WORKDIR}/mozilla-1.9.1"
72
73 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
74
75 linguas() {
76 local LANG SLANG
77 for LANG in ${LINGUAS}; do
78 if has ${LANG} en en_US; then
79 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
80 continue
81 elif has ${LANG} ${LANGS//-/_}; then
82 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
83 continue
84 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
85 for X in ${LANGS}; do
86 if [[ "${X}" == "${LANG}-"* ]] && \
87 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
88 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
89 continue 2
90 fi
91 done
92 fi
93 ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA"
94 done
95 }
96
97 pkg_setup() {
98 if ! use bindist ; then
99 elog "You are enabling official branding. You may not redistribute this build"
100 elog "to any users on your network or the internet. Doing so puts yourself into"
101 elog "a legal problem with Mozilla Foundation"
102 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
103 fi
104
105 if use iceweasel ; then
106 elog "You have enabled iceweasel useflag which does nothing in current ebuild."
107 elog "Please 'emerge -C mozilla-firefox; emerge icecat' if you wish to have same support"
108 elog "as you currently had with iceweasel useflag."
109 eerror "Please 'emerge -C mozilla-firefox; emerge icecat' to have a same support"
110 fi
111 }
112
113 src_unpack() {
114 unpack ${A}
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 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
122 einfo "Selected language packs (first will be default): ${linguas}"
123 fi
124 }
125
126 src_prepare() {
127 # Apply our patches
128 EPATCH_EXCLUDE="136-fix_ftbfs_with_cairo_fb.patch" \
129 EPATCH_SUFFIX="patch" \
130 EPATCH_FORCE="yes" \
131 epatch "${WORKDIR}"
132
133 eautoreconf
134
135 cd js/src
136 eautoreconf
137
138 # We need to re-patch this because autoreconf overwrites it
139 cd "${S}"
140 epatch "${FILESDIR}/000_flex-configure-LANG.patch"
141 }
142
143 src_configure() {
144 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
145 MEXTENSIONS="default"
146
147 ####################################
148 #
149 # mozconfig, CFLAGS and CXXFLAGS setup
150 #
151 ####################################
152
153 mozconfig_init
154 mozconfig_config
155
156 # It doesn't compile on alpha without this LDFLAGS
157 use alpha && append-ldflags "-Wl,--no-relax"
158
159 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
160 mozconfig_annotate '' --enable-application=browser
161 mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
162 mozconfig_annotate '' --disable-mailnews
163 mozconfig_annotate 'broken' --disable-crashreporter
164 mozconfig_annotate '' --enable-image-encoder=all
165 mozconfig_annotate '' --enable-canvas
166 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
167 # regardless of java setting.
168 mozconfig_annotate '' --enable-oji --enable-mathml
169 mozconfig_annotate 'places' --enable-storage --enable-places
170 mozconfig_annotate '' --enable-safe-browsing
171
172 # System-wide install specs
173 mozconfig_annotate '' --disable-installer
174 mozconfig_annotate '' --disable-updater
175 mozconfig_annotate '' --disable-strip
176 mozconfig_annotate '' --disable-install-strip
177
178 # Use system libraries
179 mozconfig_annotate '' --enable-system-cairo
180 mozconfig_annotate '' --enable-system-hunspell
181 mozconfig_annotate '' --with-system-nspr
182 mozconfig_annotate '' --with-system-nss
183 mozconfig_annotate '' --enable-system-lcms
184 mozconfig_annotate '' --with-system-bz2
185 mozconfig_annotate '' --with-system-libxul
186 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-devel-${MAJ_XUL_PV}
187
188 # Enable/Disable based on useflag
189 mozconfig_use_enable sqlite system-sqlite
190 mozconfig_use_enable mozdevelop jsd
191 mozconfig_use_enable mozdevelop xpctools
192 mozconfig_use_enable alsa ogg
193 mozconfig_use_enable alsa wave
194
195 if ! use bindist ; then
196 mozconfig_annotate '' --enable-official-branding
197 fi
198
199 # Finalize and report settings
200 mozconfig_final
201
202 if [[ $(gcc-major-version) -lt 4 ]]; then
203 append-cxxflags -fno-stack-protector
204 fi
205
206 ####################################
207 #
208 # Configure and build
209 #
210 ####################################
211
212 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" econf
213 }
214
215 src_compile() {
216 # Should the build use multiprocessing? Not enabled by default, as it tends to break
217 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
218 emake ${jobs} || die
219 }
220
221 src_install() {
222 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
223
224 emake DESTDIR="${D}" install || die "emake install failed"
225
226 linguas
227 for X in ${linguas}; do
228 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
229 done
230
231 # Install icon and .desktop for menu entry
232 if ! use bindist ; then
233 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
234 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
235 ${PN}-${DESKTOP_PV}.desktop
236 else
237 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
238 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
239 ${PN}-${DESKTOP_PV}.desktop
240 sed -i -e "s:Bon Echo:Shiretoko:" \
241 "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop || die "sed failed!"
242 fi
243
244 # Add StartupNotify=true bug 237317
245 if use startup-notification ; then
246 echo "StartupNotify=true" >> "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop
247 fi
248
249 pax-mark m "${D}"/${MOZILLA_FIVE_HOME}/firefox
250
251 # Enable very specific settings not inherited from xulrunner
252 cp "${FILESDIR}"/firefox-default-prefs.js \
253 "${D}/${MOZILLA_FIVE_HOME}/defaults/preferences/all-gentoo.js" || \
254 die "failed to cp xulrunner-default-prefs.js"
255
256 # Plugins dir
257 dosym ../nsbrowser/plugins "${MOZILLA_FIVE_HOME}"/plugins \
258 || die "failed to symlink"
259
260 # very ugly hack to make firefox not sigbus on sparc
261 if use sparc ; then
262 sed -i \
263 -e 's/Firefox/FirefoxGentoo/g' \
264 "${D}/${MOZILLA_FIVE_HOME}/application.ini" \
265 || die "sparc sed failed"
266 fi
267 }
268
269 pkg_postinst() {
270 ewarn "All the packages built against ${PN} won't compile,"
271 ewarn "any package that fails to build warrants a bug report."
272 elog
273
274 # Update mimedb for the new .desktop file
275 fdo-mime_desktop_database_update
276 }

  ViewVC Help
Powered by ViewVC 1.1.20