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

Contents of /www-client/mozilla-firefox/mozilla-firefox-3.5.3-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Dec 13 06:43:25 2009 UTC (10 years, 11 months ago) by nirbheek
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Remove old vulnerable versions of mozilla-firefox
(Portage version: 2.1.7.13/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.3-r1.ebuild,v 1.2 2009/10/25 20:11:45 ssuominen 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.3"
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.2-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 restrict-javascript -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.10 )
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 PDEPEND="restrict-javascript? ( >=www-plugins/noscript-1.9.6.6 )"
72
73 S="${WORKDIR}/mozilla-1.9.1"
74
75 # Needed by src_compile() and src_install().
76 # Would do in pkg_setup but that loses the export attribute, they
77 # become pure shell variables.
78 export BUILD_OFFICIAL=1
79 export MOZILLA_OFFICIAL=1
80
81 linguas() {
82 local LANG SLANG
83 for LANG in ${LINGUAS}; do
84 if has ${LANG} en en_US; then
85 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
86 continue
87 elif has ${LANG} ${LANGS//-/_}; then
88 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
89 continue
90 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
91 for X in ${LANGS}; do
92 if [[ "${X}" == "${LANG}-"* ]] && \
93 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
94 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
95 continue 2
96 fi
97 done
98 fi
99 ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA"
100 done
101 }
102
103 pkg_setup() {
104 if ! use bindist ; then
105 elog "You are enabling official branding. You may not redistribute this build"
106 elog "to any users on your network or the internet. Doing so puts yourself into"
107 elog "a legal problem with Mozilla Foundation"
108 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
109 fi
110
111 if use iceweasel ; then
112 elog "You have enabled iceweasel useflag which does nothing in current ebuild."
113 elog "Please 'emerge -C mozilla-firefox; emerge icecat' if you wish to have same support"
114 elog "as you currently had with iceweasel useflag."
115 eerror "Please 'emerge -C mozilla-firefox; emerge icecat' to have a same support"
116 fi
117 }
118
119 src_unpack() {
120 unpack ${A}
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 eautoreconf
139
140 cd js/src
141 eautoreconf
142
143 # We need to re-patch this because autoreconf overwrites it
144 epatch "${FILESDIR}/000_flex-configure-LANG.patch"
145 }
146
147 src_configure() {
148 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
149 MEXTENSIONS="default"
150
151 ####################################
152 #
153 # mozconfig, CFLAGS and CXXFLAGS setup
154 #
155 ####################################
156
157 mozconfig_init
158 mozconfig_config
159
160 # It doesn't compile on alpha without this LDFLAGS
161 use alpha && append-ldflags "-Wl,--no-relax"
162
163 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
164 mozconfig_annotate '' --enable-application=browser
165 mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
166 mozconfig_annotate '' --disable-mailnews
167 mozconfig_annotate 'broken' --disable-crashreporter
168 mozconfig_annotate '' --enable-image-encoder=all
169 mozconfig_annotate '' --enable-canvas
170 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
171 # regardless of java setting.
172 mozconfig_annotate '' --enable-oji --enable-mathml
173 mozconfig_annotate 'places' --enable-storage --enable-places
174 mozconfig_annotate '' --enable-safe-browsing
175
176 # System-wide install specs
177 mozconfig_annotate '' --disable-installer
178 mozconfig_annotate '' --disable-updater
179 mozconfig_annotate '' --disable-strip
180 mozconfig_annotate '' --disable-install-strip
181
182 # Use system libraries
183 mozconfig_annotate '' --enable-system-cairo
184 mozconfig_annotate '' --enable-system-hunspell
185 mozconfig_annotate '' --with-system-nspr
186 mozconfig_annotate '' --with-system-nss
187 mozconfig_annotate '' --enable-system-lcms
188 mozconfig_annotate '' --with-system-bz2
189 mozconfig_annotate '' --with-system-libxul
190 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-devel-${MAJ_XUL_PV}
191
192 # Enable/Disable based on useflag
193 mozconfig_use_enable sqlite system-sqlite
194 mozconfig_use_enable mozdevelop jsd
195 mozconfig_use_enable mozdevelop xpctools
196 mozconfig_use_enable alsa ogg
197 mozconfig_use_enable alsa wave
198
199 if ! use bindist ; then
200 mozconfig_annotate '' --enable-official-branding
201 fi
202
203 # Finalize and report settings
204 mozconfig_final
205
206 if [[ $(gcc-major-version) -lt 4 ]]; then
207 append-cxxflags -fno-stack-protector
208 fi
209
210 ####################################
211 #
212 # Configure and build
213 #
214 ####################################
215
216 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" econf
217 }
218
219 src_compile() {
220 # Should the build use multiprocessing? Not enabled by default, as it tends to break
221 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
222 emake ${jobs} || die
223 }
224
225 src_install() {
226 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
227
228 emake DESTDIR="${D}" install || die "emake install failed"
229
230 linguas
231 for X in ${linguas}; do
232 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
233 done
234
235 # Install icon and .desktop for menu entry
236 if ! use bindist ; then
237 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
238 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
239 ${PN}-${DESKTOP_PV}.desktop
240 else
241 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
242 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
243 ${PN}-${DESKTOP_PV}.desktop
244 sed -i -e "s:Bon Echo:Shiretoko:" \
245 "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop || die "sed failed!"
246 fi
247
248 # Add StartupNotify=true bug 237317
249 if use startup-notification ; then
250 echo "StartupNotify=true" >> "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop
251 fi
252
253 pax-mark m "${D}"/${MOZILLA_FIVE_HOME}/firefox
254
255 # Enable very specific settings not inherited from xulrunner
256 cp "${FILESDIR}"/firefox-default-prefs.js \
257 "${D}/${MOZILLA_FIVE_HOME}/defaults/preferences/all-gentoo.js" || \
258 die "failed to cp xulrunner-default-prefs.js"
259
260 # Plugins dir
261 dosym ../nsbrowser/plugins "${MOZILLA_FIVE_HOME}"/plugins \
262 || die "failed to symlink"
263 }
264
265 pkg_postinst() {
266 ewarn "All the packages built against ${PN} won't compile,"
267 ewarn "any package that fails to build warrants a bug report."
268 elog
269
270 # Update mimedb for the new .desktop file
271 fdo-mime_desktop_database_update
272 }

  ViewVC Help
Powered by ViewVC 1.1.20