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

Contents of /www-client/firefox/firefox-26.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Feb 22 08:42:39 2014 UTC (6 years, 1 month ago) by polynomial-c
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Removed vulnerable versions

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-26.0.ebuild,v 1.2 2013/12/16 20:17:58 anarchy Exp $
4
5 EAPI="3"
6 VIRTUALX_REQUIRED="pgo"
7 WANT_AUTOCONF="2.1"
8 MOZ_ESR=""
9
10 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
11 MOZ_LANGS=(af ak ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de
12 el en en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr
13 fy-NL ga-IE gd gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko ku
14 lg lt lv mai mk ml mr nb-NO nl nn-NO nso or pa-IN pl pt-BR pt-PT rm ro
15 ru si sk sl son sq sr sv-SE ta ta-LK te th tr uk vi zh-CN zh-TW zu )
16
17 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
18 MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
19 MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
20 MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
21
22 if [[ ${MOZ_ESR} == 1 ]]; then
23 # ESR releases have slightly version numbers
24 MOZ_PV="${MOZ_PV}esr"
25 fi
26
27 # Patch version
28 PATCH="${PN}-26.0-patches-0.3"
29 # Upstream ftp release URI that's used by mozlinguas.eclass
30 # We don't use the http mirror because it deletes old tarballs.
31 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
32 MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases/"
33
34 inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 multilib pax-utils fdo-mime autotools virtualx mozlinguas
35
36 DESCRIPTION="Firefox Web Browser"
37 HOMEPAGE="http://www.mozilla.com/firefox"
38
39 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
40 SLOT="0"
41 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
42 IUSE="bindist gstreamer +jit +minimal pgo pulseaudio selinux system-cairo system-icu system-jpeg system-sqlite"
43
44 # More URIs appended below...
45 SRC_URI="${SRC_URI}
46 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
47 http://dev.gentoo.org/~nirbheek/mozilla/patchsets/${PATCH}.tar.xz"
48
49 ASM_DEPEND=">=dev-lang/yasm-1.1"
50
51 # Mesa 7.10 needed for WebGL + bugfixes
52 RDEPEND="
53 >=dev-libs/nss-3.15.3
54 >=dev-libs/nspr-4.10.2
55 >=dev-libs/glib-2.26:2
56 >=media-libs/mesa-7.10
57 >=media-libs/libpng-1.5.17[apng]
58 virtual/libffi
59 gstreamer? ( media-plugins/gst-plugins-meta:0.10[ffmpeg] )
60 pulseaudio? ( media-sound/pulseaudio )
61 system-cairo? ( >=x11-libs/cairo-1.12[X] )
62 system-icu? ( >=dev-libs/icu-0.51.1 )
63 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
64 system-sqlite? ( >=dev-db/sqlite-3.7.17:3[secure-delete,debug=] )
65 >=media-libs/libvpx-1.0.0
66 kernel_linux? ( media-libs/alsa-lib )
67 selinux? ( sec-policy/selinux-mozilla )"
68
69 DEPEND="${RDEPEND}
70 >=sys-devel/binutils-2.16.1
71 virtual/pkgconfig
72 pgo? (
73 >=sys-devel/gcc-4.5 )
74 amd64? ( ${ASM_DEPEND}
75 virtual/opengl )
76 x86? ( ${ASM_DEPEND}
77 virtual/opengl )"
78
79 # No source releases for alpha|beta
80 if [[ ${PV} =~ alpha ]]; then
81 CHANGESET="8a3042764de7"
82 SRC_URI="${SRC_URI}
83 http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
84 S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
85 elif [[ ${PV} =~ beta ]]; then
86 S="${WORKDIR}/mozilla-beta"
87 SRC_URI="${SRC_URI}
88 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
89 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
90 else
91 SRC_URI="${SRC_URI}
92 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
93 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
94 if [[ ${MOZ_ESR} == 1 ]]; then
95 S="${WORKDIR}/mozilla-esr${PV%%.*}"
96 else
97 S="${WORKDIR}/mozilla-release"
98 fi
99 fi
100
101 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
102
103 pkg_setup() {
104 moz_pkgsetup
105
106 # Avoid PGO profiling problems due to enviroment leakage
107 # These should *always* be cleaned up anyway
108 unset DBUS_SESSION_BUS_ADDRESS \
109 DISPLAY \
110 ORBIT_SOCKETDIR \
111 SESSION_MANAGER \
112 XDG_SESSION_COOKIE \
113 XAUTHORITY
114
115 if ! use bindist; then
116 einfo
117 elog "You are enabling official branding. You may not redistribute this build"
118 elog "to any users on your network or the internet. Doing so puts yourself into"
119 elog "a legal problem with Mozilla Foundation"
120 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
121 fi
122
123 if use pgo; then
124 einfo
125 ewarn "You will do a double build for profile guided optimization."
126 ewarn "This will result in your build taking at least twice as long as before."
127 fi
128
129 # Ensure we have enough disk space to compile
130 if use pgo || use debug || use test ; then
131 CHECKREQS_DISK_BUILD="8G"
132 else
133 CHECKREQS_DISK_BUILD="4G"
134 fi
135 check-reqs_pkg_setup
136 }
137
138 src_unpack() {
139 unpack ${A}
140
141 # Unpack language packs
142 mozlinguas_src_unpack
143 }
144
145 src_prepare() {
146 # Apply our patches
147 EPATCH_SUFFIX="patch" \
148 EPATCH_FORCE="yes" \
149 epatch "${WORKDIR}/firefox"
150
151 # Allow user to apply any additional patches without modifing ebuild
152 epatch_user
153
154 # Enable gnomebreakpad
155 if use debug ; then
156 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
157 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
158 fi
159
160 # Ensure that our plugins dir is enabled as default
161 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
162 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
163 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
164 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
165
166 # Fix sandbox violations during make clean, bug 372817
167 sed -e "s:\(/no-such-file\):${T}\1:g" \
168 -i "${S}"/config/rules.mk \
169 -i "${S}"/js/src/config/rules.mk \
170 -i "${S}"/nsprpub/configure{.in,} \
171 || die
172
173 # Don't exit with error when some libs are missing which we have in
174 # system.
175 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
176 -i "${S}"/browser/installer/Makefile.in || die
177
178 # Don't error out when there's no files to be removed:
179 sed 's@\(xargs rm\)$@\1 -f@' \
180 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
181
182 eautoreconf
183
184 # Must run autoconf in js/src
185 cd "${S}"/js/src
186 eautoconf
187 }
188
189 src_configure() {
190 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
191 MEXTENSIONS="default"
192
193 ####################################
194 #
195 # mozconfig, CFLAGS and CXXFLAGS setup
196 #
197 ####################################
198
199 mozconfig_init
200 mozconfig_config
201
202 # It doesn't compile on alpha without this LDFLAGS
203 use alpha && append-ldflags "-Wl,--no-relax"
204
205 # We must force enable jemalloc 3 threw .mozconfig
206 echo "export MOZ_JEMALLOC=1" >> ${S}/.mozconfig
207
208 mozconfig_annotate '' --enable-jemalloc
209 mozconfig_annotate '' --enable-replace-malloc
210 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
211 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
212 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
213 mozconfig_annotate '' --disable-gconf
214 mozconfig_annotate '' --disable-mailnews
215 mozconfig_annotate '' --with-system-png
216 mozconfig_annotate '' --enable-system-ffi
217
218 # Other ff-specific settings
219 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
220 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
221 mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
222
223 mozconfig_use_enable gstreamer
224 mozconfig_use_enable pulseaudio
225 mozconfig_use_enable system-cairo
226 mozconfig_use_enable system-sqlite
227 mozconfig_use_with system-jpeg
228 mozconfig_use_with system-icu
229 mozconfig_use_enable system-icu intl-api
230 # Feature is know to cause problems on hardened
231 mozconfig_use_enable jit ion
232
233 # Allow for a proper pgo build
234 if use pgo; then
235 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
236 fi
237
238 # Finalize and report settings
239 mozconfig_final
240
241 if [[ $(gcc-major-version) -lt 4 ]]; then
242 append-cxxflags -fno-stack-protector
243 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
244 if use amd64 || use x86; then
245 append-flags -mno-avx
246 fi
247 fi
248 }
249
250 src_compile() {
251 if use pgo; then
252 addpredict /root
253 addpredict /etc/gconf
254 # Reset and cleanup environment variables used by GNOME/XDG
255 gnome2_environment_reset
256
257 # Firefox tries to use dri stuff when it's run, see bug 380283
258 shopt -s nullglob
259 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
260 if test -z "${cards}"; then
261 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
262 if test -n "${cards}"; then
263 # Binary drivers seem to cause access violations anyway, so
264 # let's use indirect rendering so that the device files aren't
265 # touched at all. See bug 394715.
266 export LIBGL_ALWAYS_INDIRECT=1
267 fi
268 fi
269 shopt -u nullglob
270 addpredict "${cards}"
271
272 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
273 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
274 Xemake -f client.mk profiledbuild || die "Xemake failed"
275 else
276 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
277 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
278 emake -f client.mk || die "emake failed"
279 fi
280
281 }
282
283 src_install() {
284 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
285 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
286
287 # MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler, pgo, etc.
288 local obj_dir="$(echo */config.log)"
289 obj_dir="${obj_dir%/*}"
290 cd "${S}/${obj_dir}"
291
292 # Pax mark xpcshell for hardened support, only used for startupcache creation.
293 pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
294
295 # Add our default prefs for firefox
296 cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
297 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
298
299 # Set default path to search for dictionaries.
300 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
301 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
302
303 if ! use libnotify; then
304 echo "pref(\"browser.download.manager.showAlertOnComplete\", false);" \
305 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
306 fi
307
308 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
309 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
310
311 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
312 emake DESTDIR="${D}" install || die "emake install failed"
313
314 # Install language packs
315 mozlinguas_src_install
316
317 local size sizes icon_path icon name
318 if use bindist; then
319 sizes="16 32 48"
320 icon_path="${S}/browser/branding/aurora"
321 # Firefox's new rapid release cycle means no more codenames
322 # Let's just stick with this one...
323 icon="aurora"
324 name="Aurora"
325 else
326 sizes="16 22 24 32 256"
327 icon_path="${S}/browser/branding/official"
328 icon="${PN}"
329 name="Mozilla Firefox"
330 fi
331
332 # Install icons and .desktop for menu entry
333 for size in ${sizes}; do
334 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
335 newins "${icon_path}/default${size}.png" "${icon}.png" || die
336 done
337 # The 128x128 icon has a different name
338 insinto "/usr/share/icons/hicolor/128x128/apps"
339 newins "${icon_path}/mozicon128.png" "${icon}.png" || die
340 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
341 newicon "${icon_path}/content/icon48.png" "${icon}.png" || die
342 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop" || die
343 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
344 "${ED}/usr/share/applications/${PN}.desktop" || die
345
346 # Add StartupNotify=true bug 237317
347 if use startup-notification ; then
348 echo "StartupNotify=true" >> "${ED}/usr/share/applications/${PN}.desktop"
349 fi
350
351 # Required in order to use plugins and even run firefox on hardened.
352 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
353
354 if use minimal; then
355 rm -rf "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} || \
356 die "Failed to remove sdk and headers"
357 fi
358
359 # very ugly hack to make firefox not sigbus on sparc
360 # FIXME: is this still needed??
361 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
362 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" || \
363 die "sparc sed failed"; }
364 }
365
366 pkg_preinst() {
367 gnome2_icon_savelist
368 }
369
370 pkg_postinst() {
371 # Update mimedb for the new .desktop file
372 fdo-mime_desktop_database_update
373 gnome2_icon_cache_update
374 }
375
376 pkg_postrm() {
377 gnome2_icon_cache_update
378 }

  ViewVC Help
Powered by ViewVC 1.1.20