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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Aug 5 14:50:37 2009 UTC (11 years, 3 months ago) by tommy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bump for security fixes (proxy commit for mozilla team)
(Portage version: 2.2_rc35-r1/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-r2.ebuild,v 1.2 2009/08/03 13:34:40 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.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="+alsa 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 alsa? ( media-libs/alsa-lib )
65
66 >=net-libs/xulrunner-${XUL_PV}[java=]
67 >=x11-libs/cairo-1.8.8[X]
68 x11-libs/pango[X]"
69
70 DEPEND="${RDEPEND}
71 dev-util/pkgconfig"
72
73 PDEPEND="restrict-javascript? ( >=www-plugins/noscript-1.8.7 )"
74
75 S="${WORKDIR}/mozilla-1.9.1"
76
77 # Needed by src_compile() and src_install().
78 # Would do in pkg_setup but that loses the export attribute, they
79 # become pure shell variables.
80 export BUILD_OFFICIAL=1
81 export MOZILLA_OFFICIAL=1
82
83 linguas() {
84 local LANG SLANG
85 for LANG in ${LINGUAS}; do
86 if has ${LANG} en en_US; then
87 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
88 continue
89 elif has ${LANG} ${LANGS//-/_}; then
90 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
91 continue
92 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
93 for X in ${LANGS}; do
94 if [[ "${X}" == "${LANG}-"* ]] && \
95 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
96 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
97 continue 2
98 fi
99 done
100 fi
101 ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA"
102 done
103 }
104
105 pkg_setup(){
106 if ! use bindist && ! use iceweasel; then
107 elog "You are enabling official branding. You may not redistribute this build"
108 elog "to any users on your network or the internet. Doing so puts yourself into"
109 elog "a legal problem with Mozilla Foundation"
110 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
111 fi
112 }
113
114 src_unpack() {
115 unpack ${A}
116
117 if use iceweasel; then
118 unpack iceweasel-icons-3.0.tar.bz2
119
120 cp -r iceweaselicons/browser "${WORKDIR}"
121 fi
122
123 linguas
124 for X in ${linguas}; do
125 # FIXME: Add support for unpacking xpis to portage
126 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
127 done
128 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
129 einfo "Selected language packs (first will be default): ${linguas}"
130 fi
131 }
132
133 src_prepare() {
134 # Apply our patches
135 EPATCH_SUFFIX="patch" \
136 EPATCH_FORCE="yes" \
137 epatch "${WORKDIR}"
138
139 if use iceweasel; then
140 sed -i -e "s|Minefield|Iceweasel|" browser/locales/en-US/chrome/branding/brand.* \
141 browser/branding/nightly/configure.sh
142 fi
143
144 eautoreconf
145
146 cd js/src
147 eautoreconf
148
149 # We need to re-patch this because autoreconf overwrites it
150 # epatch "${WORKDIR}"/patch/000_flex-configure-LANG.patch
151 }
152
153 src_configure() {
154 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
155 MEXTENSIONS="default"
156
157 ####################################
158 #
159 # mozconfig, CFLAGS and CXXFLAGS setup
160 #
161 ####################################
162
163 mozconfig_init
164 mozconfig_config
165
166 # It doesn't compile on alpha without this LDFLAGS
167 use alpha && append-ldflags "-Wl,--no-relax"
168
169 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
170 mozconfig_annotate '' --enable-application=browser
171 mozconfig_annotate '' --disable-mailnews
172 mozconfig_annotate 'broken' --disable-crashreporter
173 mozconfig_annotate '' --enable-image-encoder=all
174 mozconfig_annotate '' --enable-canvas
175 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
176 # regardless of java setting.
177 mozconfig_annotate '' --enable-oji --enable-mathml
178 mozconfig_annotate 'places' --enable-storage --enable-places
179 mozconfig_annotate '' --enable-safe-browsing
180
181 # System-wide install specs
182 mozconfig_annotate '' --disable-installer
183 mozconfig_annotate '' --disable-updater
184 mozconfig_annotate '' --disable-strip
185 mozconfig_annotate '' --disable-install-strip
186
187 # Use system libraries
188 mozconfig_annotate '' --enable-system-cairo
189 mozconfig_annotate '' --enable-system-hunspell
190 mozconfig_annotate '' --enable-system-sqlite
191 mozconfig_annotate '' --with-system-nspr
192 mozconfig_annotate '' --with-system-nss
193 mozconfig_annotate '' --enable-system-lcms
194 mozconfig_annotate '' --with-system-bz2
195 mozconfig_annotate '' --with-system-libxul
196 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-devel-${XUL_PV}
197 mozconfig_use_enable alsa ogg
198 mozconfig_use_enable alsa wave
199
200 # IUSE mozdevelop
201 mozconfig_use_enable mozdevelop jsd
202 mozconfig_use_enable mozdevelop xpctools
203 #mozconfig_use_extension mozdevelop venkman
204
205 # IUSE qt-experimental
206 # if use qt-experimental; then
207 # ewarn "You are enabling the EXPERIMENTAL qt toolkit"
208 # ewarn "Usage is at your own risk"
209 # ewarn "Known to be broken. DO NOT file bugs."
210 # mozconfig_annotate '' --disable-system-cairo
211 # mozconfig_annotate 'qt-experimental' --enable-default-toolkit=cairo-qt
212 # else
213 mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
214 # fi
215
216 # Other ff-specific settings
217 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
218
219 if ! use bindist && ! use iceweasel; then
220 mozconfig_annotate '' --enable-official-branding
221 fi
222
223 # Finalize and report settings
224 mozconfig_final
225
226 if [[ $(gcc-major-version) -lt 4 ]]; then
227 append-cxxflags -fno-stack-protector
228 fi
229
230 ####################################
231 #
232 # Configure and build
233 #
234 ####################################
235
236 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
237 econf || die
238 }
239
240 src_compile() {
241 # Should the build use multiprocessing? Not enabled by default, as it tends to break
242 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
243 emake ${jobs} || die
244 }
245
246 src_install() {
247 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
248
249 emake DESTDIR="${D}" install || die "emake install failed"
250 rm "${D}"/usr/bin/firefox
251
252 linguas
253 for X in ${linguas}; do
254 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
255 done
256
257 # Install icon and .desktop for menu entry
258 if use iceweasel; then
259 newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
260 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
261 ${PN}-${DESKTOP_PV}.desktop
262 elif ! use bindist; then
263 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
264 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
265 ${PN}-${DESKTOP_PV}.desktop
266 else
267 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
268 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
269 ${PN}-${DESKTOP_PV}.desktop
270 sed -e "s/Bon Echo/Minefield/" \
271 -i "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop
272 fi
273
274 # Add StartupNotify=true bug 237317
275 if use startup-notification; then
276 echo "StartupNotify=true" >> "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop
277 fi
278
279 # Create /usr/bin/firefox
280 cat <<EOF >"${D}"/usr/bin/firefox
281 #!/bin/sh
282 export LD_LIBRARY_PATH="${MOZILLA_FIVE_HOME}\${LD_LIBRARY_PATH+":\${LD_LIBRARY_PATH}"}"
283 exec "${MOZILLA_FIVE_HOME}"/firefox "\$@"
284 EOF
285
286 fperms 0755 /usr/bin/firefox
287
288 #Enable very specific settings not inherited from xulrunner
289 cp "${FILESDIR}"/firefox-default-prefs.js \
290 "${D}/${MOZILLA_FIVE_HOME}/defaults/preferences/all-gentoo.js" || die "failed to cp xulrunner-default-prefs.js"
291
292 # Plugins dir
293 ln -s "${D}"/usr/$(get_libdir)/{nsbrowser,mozilla-firefox}/plugins
294 }
295
296 pkg_postinst() {
297 ewarn "All the packages built against ${PN} won't compile,"
298 ewarn "any package that fails to build warrants a bug report."
299 elog
300
301 # Update mimedb for the new .desktop file
302 fdo-mime_desktop_database_update
303 }

  ViewVC Help
Powered by ViewVC 1.1.20