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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Aug 30 14:59:52 2009 UTC (11 years, 3 months ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
drop system sqlite support until segv is fixed
(Portage version: 2.1.6.13/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.ebuild,v 1.4 2009/08/25 14:14:55 armin76 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.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="${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 hardened 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 alsa? ( media-libs/alsa-lib )
64 >=net-libs/xulrunner-${XUL_PV}[hardened=,java=]
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.8.7 )"
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 && ! use iceweasel ; 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
112 src_unpack() {
113 unpack ${A}
114
115 if use iceweasel ; then
116 unpack iceweasel-icons-3.0.tar.bz2
117
118 cp -r iceweaselicons/browser "${WORKDIR}"
119 fi
120
121 linguas
122 for X in ${linguas}; do
123 # FIXME: Add support for unpacking xpis to portage
124 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
125 done
126 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
127 einfo "Selected language packs (first will be default): ${linguas}"
128 fi
129 }
130
131 src_prepare() {
132 # Apply our patches
133 EPATCH_SUFFIX="patch" \
134 EPATCH_FORCE="yes" \
135 epatch "${WORKDIR}"
136
137 if use iceweasel ; then
138 sed -i -e "s:Minefield:Iceweasel:" browser/locales/en-US/chrome/branding/brand.* \
139 browser/branding/nightly/configure.sh || die "iceweasel sed failed!"
140 fi
141
142 eautoreconf
143
144 cd js/src
145 eautoreconf
146
147 # We need to re-patch this because autoreconf overwrites it
148 epatch "${FILESDIR}/000_flex-configure-LANG.patch"
149 }
150
151 src_configure() {
152 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
153 MEXTENSIONS="default"
154
155 ####################################
156 #
157 # mozconfig, CFLAGS and CXXFLAGS setup
158 #
159 ####################################
160
161 mozconfig_init
162 mozconfig_config
163
164 # It doesn't compile on alpha without this LDFLAGS
165 use alpha && append-ldflags "-Wl,--no-relax"
166
167 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
168 mozconfig_annotate '' --enable-application=browser
169 mozconfig_annotate '' --disable-mailnews
170 mozconfig_annotate 'broken' --disable-crashreporter
171 mozconfig_annotate '' --enable-image-encoder=all
172 mozconfig_annotate '' --enable-canvas
173 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
174 # regardless of java setting.
175 mozconfig_annotate '' --enable-oji --enable-mathml
176 mozconfig_annotate 'places' --enable-storage --enable-places
177 mozconfig_annotate '' --enable-safe-browsing
178
179 # System-wide install specs
180 mozconfig_annotate '' --disable-installer
181 mozconfig_annotate '' --disable-updater
182 mozconfig_annotate '' --disable-strip
183 mozconfig_annotate '' --disable-install-strip
184
185 # Use system libraries
186 mozconfig_annotate '' --enable-system-cairo
187 mozconfig_annotate '' --enable-system-hunspell
188 mozconfig_annotate '' --enable-system-sqlite
189 mozconfig_annotate '' --with-system-nspr
190 mozconfig_annotate '' --with-system-nss
191 mozconfig_annotate '' --enable-system-lcms
192 mozconfig_annotate '' --with-system-bz2
193 mozconfig_annotate '' --with-system-libxul
194 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-devel-${XUL_PV}
195
196 # IUSE mozdevelop
197 mozconfig_use_enable mozdevelop jsd
198 mozconfig_use_enable mozdevelop xpctools
199 #mozconfig_use_extension mozdevelop venkman
200
201 # IUSE qt-experimental
202 # if use qt-experimental ; then
203 # ewarn "You are enabling the EXPERIMENTAL qt toolkit"
204 # ewarn "Usage is at your own risk"
205 # ewarn "Known to be broken. DO NOT file bugs."
206 # mozconfig_annotate '' --disable-system-cairo
207 # mozconfig_annotate 'qt-experimental' --enable-default-toolkit=cairo-qt
208 # else
209 mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
210 # fi
211
212 # Other ff-specific settings
213 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
214
215 # Enable/Disable audio in firefox
216 mozconfig_use_enable alsa ogg
217 mozconfig_use_enable alsa wave
218
219 if ! use bindist && ! use iceweasel ; then
220 mozconfig_annotate '' --enable-official-branding
221 fi
222
223 # Bug #278698
224 if use hardened ; then
225 mozconfig_annotate 'hardened' --disable-jemalloc
226 fi
227
228 # Finalize and report settings
229 mozconfig_final
230
231 if [[ $(gcc-major-version) -lt 4 ]]; then
232 append-cxxflags -fno-stack-protector
233 fi
234
235 ####################################
236 #
237 # Configure and build
238 #
239 ####################################
240
241 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" econf
242 }
243
244 src_compile() {
245 # Should the build use multiprocessing? Not enabled by default, as it tends to break
246 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
247 emake ${jobs} || die
248 }
249
250 src_install() {
251 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
252
253 emake DESTDIR="${D}" install || die "emake install failed"
254 rm "${D}"/usr/bin/firefox
255
256 linguas
257 for X in ${linguas}; do
258 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
259 done
260
261 # Install icon and .desktop for menu entry
262 if use iceweasel ; then
263 newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
264 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
265 ${PN}-${DESKTOP_PV}.desktop
266 elif ! use bindist ; then
267 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
268 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
269 ${PN}-${DESKTOP_PV}.desktop
270 else
271 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
272 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
273 ${PN}-${DESKTOP_PV}.desktop
274 sed -i -e "s:Bon Echo:Minefield:" \
275 "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop || die "sed failed!"
276 fi
277
278 # Add StartupNotify=true bug 237317
279 if use startup-notification ; then
280 echo "StartupNotify=true" >> "${D}"/usr/share/applications/${PN}-${DESKTOP_PV}.desktop
281 fi
282
283 # Create /usr/bin/firefox
284 cat <<EOF >"${D}"/usr/bin/firefox
285 #!/bin/sh
286 export LD_LIBRARY_PATH="${MOZILLA_FIVE_HOME}\${LD_LIBRARY_PATH+":\${LD_LIBRARY_PATH}"}"
287 exec "${MOZILLA_FIVE_HOME}"/firefox "\$@"
288 EOF
289
290 fperms 0755 /usr/bin/firefox
291
292 # Enable very specific settings not inherited from xulrunner
293 cp "${FILESDIR}"/firefox-default-prefs.js \
294 "${D}/${MOZILLA_FIVE_HOME}/defaults/preferences/all-gentoo.js" || \
295 die "failed to cp xulrunner-default-prefs.js"
296
297 # Plugins dir
298 ln -s "${D}"/usr/$(get_libdir)/{nsbrowser,mozilla-firefox}/plugins
299 }
300
301 pkg_postinst() {
302 ewarn "All the packages built against ${PN} won't compile,"
303 ewarn "any package that fails to build warrants a bug report."
304 elog
305
306 # Update mimedb for the new .desktop file
307 fdo-mime_desktop_database_update
308 }

  ViewVC Help
Powered by ViewVC 1.1.20