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

Contents of /www-client/mozilla-firefox/mozilla-firefox-3.5.2-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20