Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/anarchy:master commit in: www-client/firefox/, www-client/firefox/files/icon/, www-client/firefox/files/
Date: Wed, 01 Aug 2012 13:20:35
Message-Id: 1343827187.34d029fece0aa1a77d42228c70a1809ee5716fa0.anarchy@gentoo
1 commit: 34d029fece0aa1a77d42228c70a1809ee5716fa0
2 Author: Jory A. Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 1 13:19:47 2012 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 1 13:19:47 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/anarchy.git;a=commit;h=34d029fe
7
8 firefox-15.0_beta2 with jemalloc-3 as default
9
10 ---
11 www-client/firefox/Manifest | 8 +
12 .../files/firefox-14.0_beta7-gst-aac-mp3.patch | 70 ++++
13 .../firefox-14.0_beta7-gst-youtube-h264.patch | 26 ++
14 .../firefox-15.0-fix-gstreamer-html5-crash.patch | 26 ++
15 www-client/firefox/files/gentoo-default-prefs.js-1 | 17 +
16 www-client/firefox/files/icon/firefox.desktop | 9 +
17 www-client/firefox/firefox-15.0_beta2-r1.ebuild | 385 ++++++++++++++++++++
18 7 files changed, 541 insertions(+), 0 deletions(-)
19
20 diff --git a/www-client/firefox/Manifest b/www-client/firefox/Manifest
21 new file mode 100644
22 index 0000000..8a691f1
23 --- /dev/null
24 +++ b/www-client/firefox/Manifest
25 @@ -0,0 +1,8 @@
26 +AUX firefox-14.0_beta7-gst-aac-mp3.patch 2454 SHA256 ef3e6539d292629a52a592cecd90a23562480d7280cfd3883d4407ad06e418a7 SHA512 ecd4b594371b6ff00980fd79959805e87e2f54deb5b790c246c7e592b5c29e7e847c3a9863730c891532a5180c67937e73f8474aa3e4a16b94a35ba4e29624ad WHIRLPOOL cc977bd7cc1b48162e906ad4541592b153d9a0434c8d608fdb2b281ba143385a95808135e967876813435a31caf323f4f0b28bc6751d5285969d7c6dfe46874e
27 +AUX firefox-14.0_beta7-gst-youtube-h264.patch 1437 SHA256 9b871769727e6d16939c55695b4f08c6b460c3f6cf5bce46ce429f40c4801669 SHA512 b5964f9e569281209db492d27f6f1c12fb316fd52bb67e624ed438a3c005018f1c5554f6c976ab226541dc86a3ac47e26a07146c1cf9f549685d03605e217909 WHIRLPOOL 928bb7abe481188ad229fd833fd282e388cbf65166477c65e166f0af83784e4d3219cc4d2b8127df2cad13213d1cecfbb26afe9f6dc2059618c7f7c39c52fd6a
28 +AUX firefox-15.0-fix-gstreamer-html5-crash.patch 1094 SHA256 1fa2a1963ef3146ef71a51affc46179fdae5fcd5a4bfdf5acb3da0f035b482f2 SHA512 42b8fc013ee061f9b7c00d347fe2712c2a1110574f578ae815dd4b5287dfa27b5643c74d41f2e2913d147017026d61f8b7a3603b2a40586f30f0e70c41f6af74 WHIRLPOOL dae601e40e1e9cfcb9775313ef5f5b57af40124a64e204261ef6de05b01533df36e28e333356ba2d09ada996e82a882ef492fa0efbd4c7cc06572dde16d83346
29 +AUX gentoo-default-prefs.js-1 821 SHA256 16259ec24a231d1d60097c8d892caa80d2703ba5be72304f6da55cfce1b329de SHA512 b63542c51edfe0158ce487b317ea6d36ffc17cf8457534adb6aa3f613d9a027f4285c9dcf76eb1b96de6bbc10ba09948fa6c081e00cfb25ca47450cbc32923f2 WHIRLPOOL 770d4b15f1b142ee1f59ce47f7b6d9e4bf4adb20a8a9fc104ea7d6c2481edb0d685c2e672008dbd869d92e8b24ea6ad8efdb4180421ff19ae88d0a9f6f752121
30 +AUX icon/firefox.desktop 276 SHA256 06565ade11b6e4b448cf10339696c43f31e73cb6824491094bb6e0ab902c7cf5 SHA512 3ab9aa94d3006518fb154c887e9be99fd372a75ac128b8d37debe5d72f26fb7103dd36f75bb6111750e93d520b730a29a8118805fe84be8f3021e4528c0ec47e WHIRLPOOL 9722c40c167bb1a76e7a81e3b1aedbb3cd10a09e00361fe1678883feff33e1d9ce31379f150a757d8b2667715175c2bbc16a714164d02210b4284ee91a25f8f5
31 +DIST firefox-15.0-patches-0.3.tar.xz 233752 SHA256 423690cc47fb79c5b884c17219b8f2303def8ba0b8d983a199db3fa29617839b SHA512 2dd472f13bf4032738915ce5e5f52a92feb86a2765b64f7d18aa57c575332ee60011131a1fefd7bff0bba684725f8dfea2cea2d6f90b2d45520cb1b13bd62622 WHIRLPOOL 25e4347c25ded36166679f83d253598a39fa7df2805e1c416c715e95cd45891d1425733c37fecc179d2d5e8d44b9eb977a9ba178a4f23f84a068bbb3b22d03d1
32 +DIST firefox-15.0b2.source.tar.bz2 83547413 SHA256 6ba75c15e0c3fd7d14a3337f25237636e572356753b71b4abae7ce6a4ba11e71 SHA512 ea7e5d58e8076d1ff8803108f331ad779cf3562f92a29e04417d54a8a69ef4ddeb896a3b4358c19971aefb2d9ee3b23655d9a626d16cb751fe8a427a8a215d74 WHIRLPOOL 8a9aac3d6fb85cc059871f625b5e89e48e8f0bd8ea8cf49066e01c81a9d0458acdbbb718389c7ea0891d2555463b866cd02eaefd0baa7c2d918c568dc580366f
33 +EBUILD firefox-15.0_beta2-r1.ebuild 12015 SHA256 71469aff76ff711dfddda08cb666ec776c6fde1a0e0b4eb857c2b8eaff9c3767 SHA512 48a70b5581d4d9d767525fa5f27eac64647315dd00c397208826567fd02a33dc84fc0726e23463ed09068ab55a7b54fdca70d3895b91d3a2015fd834894c3049 WHIRLPOOL b7789e8e1e69ef4cecb557da9a6edcb3c67a163c85e65b4e3aa6dcb7954128996f109e9c9d6d962f992d118dc5e87409448ee52b2cd0e4a65f77e8b582ab37f8
34
35 diff --git a/www-client/firefox/files/firefox-14.0_beta7-gst-aac-mp3.patch b/www-client/firefox/files/firefox-14.0_beta7-gst-aac-mp3.patch
36 new file mode 100644
37 index 0000000..136375a
38 --- /dev/null
39 +++ b/www-client/firefox/files/firefox-14.0_beta7-gst-aac-mp3.patch
40 @@ -0,0 +1,70 @@
41 +diff -urNp mozilla-aurora-7f3c5dd8e78f.old/content/html/content/public/nsHTMLMediaElement.h mozilla-aurora-7f3c5dd8e78f/content/html/content/public/nsHTMLMediaElement.h
42 +--- mozilla-aurora-7f3c5dd8e78f.old/content/html/content/public/nsHTMLMediaElement.h 2012-06-04 11:37:25.791017257 +0530
43 ++++ mozilla-aurora-7f3c5dd8e78f/content/html/content/public/nsHTMLMediaElement.h 2012-06-04 11:38:22.259014896 +0530
44 +@@ -305,8 +305,10 @@ public:
45 + #ifdef MOZ_GSTREAMER
46 + static bool IsH264Enabled();
47 + static bool IsH264Type(const nsACString& aType);
48 ++ static bool IsSupportedAudioType(const nsACString& aType);
49 + static const char gH264Types[3][17];
50 + static char const *const gH264Codecs[6];
51 ++ static const char gSupportedAudioTypes[2][11];
52 + #endif
53 +
54 + /**
55 +diff -urNp mozilla-aurora-7f3c5dd8e78f.old/content/html/content/src/nsHTMLMediaElement.cpp mozilla-aurora-7f3c5dd8e78f/content/html/content/src/nsHTMLMediaElement.cpp
56 +--- mozilla-aurora-7f3c5dd8e78f.old/content/html/content/src/nsHTMLMediaElement.cpp 2012-06-04 11:37:25.834017256 +0530
57 ++++ mozilla-aurora-7f3c5dd8e78f/content/html/content/src/nsHTMLMediaElement.cpp 2012-06-04 11:40:04.358010627 +0530
58 +@@ -1865,6 +1865,11 @@ char const *const nsHTMLMediaElement::gH
59 + nsnull
60 + };
61 +
62 ++const char nsHTMLMediaElement::gSupportedAudioTypes[2][11] = {
63 ++ "audio/mp4",
64 ++ "audio/mpeg",
65 ++};
66 ++
67 + bool
68 + nsHTMLMediaElement::IsH264Enabled()
69 + {
70 +@@ -1886,6 +1891,18 @@ nsHTMLMediaElement::IsH264Type(const nsA
71 +
72 + return false;
73 + }
74 ++
75 ++bool
76 ++nsHTMLMediaElement::IsSupportedAudioType(const nsACString& aType)
77 ++{
78 ++ for (PRUint32 i = 0; i < ArrayLength(gSupportedAudioTypes); ++i) {
79 ++ if (aType.EqualsASCII(gSupportedAudioTypes[i])) {
80 ++ return true;
81 ++ }
82 ++ }
83 ++
84 ++ return false;
85 ++}
86 + #endif
87 +
88 + /* static */
89 +@@ -1919,6 +1936,11 @@ nsHTMLMediaElement::CanHandleMediaType(c
90 + #endif
91 +
92 + #ifdef MOZ_GSTREAMER
93 ++ if (IsSupportedAudioType(nsDependentCString(aMIMEType))) {
94 ++ *aCodecList = NULL;
95 ++ return CANPLAY_MAYBE;
96 ++ }
97 ++
98 + if (IsH264Type(nsDependentCString(aMIMEType))) {
99 + *aCodecList = gH264Codecs;
100 + return CANPLAY_YES;
101 +@@ -1992,7 +2014,8 @@ nsHTMLMediaElement::GetCanPlay(const nsA
102 + while (tokenizer.hasMoreTokens()) {
103 + const nsSubstring& token = tokenizer.nextToken();
104 +
105 +- if (!CodecListContains(supportedCodecs, token)) {
106 ++ if (supportedCodecs == NULL ||
107 ++ !CodecListContains(supportedCodecs, token)) {
108 + // Totally unsupported codec
109 + return CANPLAY_NO;
110 + }
111
112 diff --git a/www-client/firefox/files/firefox-14.0_beta7-gst-youtube-h264.patch b/www-client/firefox/files/firefox-14.0_beta7-gst-youtube-h264.patch
113 new file mode 100644
114 index 0000000..c9002c7
115 --- /dev/null
116 +++ b/www-client/firefox/files/firefox-14.0_beta7-gst-youtube-h264.patch
117 @@ -0,0 +1,26 @@
118 +diff -urNp mozilla-aurora-7f3c5dd8e78f.old/content/html/content/public/nsHTMLMediaElement.h mozilla-aurora-7f3c5dd8e78f/content/html/content/public/nsHTMLMediaElement.h
119 +--- mozilla-aurora-7f3c5dd8e78f.old/content/html/content/public/nsHTMLMediaElement.h 2012-06-04 11:48:14.664990120 +0530
120 ++++ mozilla-aurora-7f3c5dd8e78f/content/html/content/public/nsHTMLMediaElement.h 2012-06-04 11:48:43.970988893 +0530
121 +@@ -307,7 +307,7 @@ public:
122 + static bool IsH264Type(const nsACString& aType);
123 + static bool IsSupportedAudioType(const nsACString& aType);
124 + static const char gH264Types[3][17];
125 +- static char const *const gH264Codecs[6];
126 ++ static char const *const gH264Codecs[7];
127 + static const char gSupportedAudioTypes[2][11];
128 + #endif
129 +
130 +diff -urNp mozilla-aurora-7f3c5dd8e78f.old/content/html/content/src/nsHTMLMediaElement.cpp mozilla-aurora-7f3c5dd8e78f/content/html/content/src/nsHTMLMediaElement.cpp
131 +--- mozilla-aurora-7f3c5dd8e78f.old/content/html/content/src/nsHTMLMediaElement.cpp 2012-06-04 11:48:14.667990120 +0530
132 ++++ mozilla-aurora-7f3c5dd8e78f/content/html/content/src/nsHTMLMediaElement.cpp 2012-06-04 11:49:18.261987460 +0530
133 +@@ -1856,8 +1856,9 @@ const char nsHTMLMediaElement::gH264Type
134 + "video/quicktime",
135 + };
136 +
137 +-char const *const nsHTMLMediaElement::gH264Codecs[6] = {
138 ++char const *const nsHTMLMediaElement::gH264Codecs[7] = {
139 + "avc1.42E01E",
140 ++ "avc1.42001E",
141 + "avc1.58A01E",
142 + "avc1.4D401E",
143 + "avc1.64001E",
144
145 diff --git a/www-client/firefox/files/firefox-15.0-fix-gstreamer-html5-crash.patch b/www-client/firefox/files/firefox-15.0-fix-gstreamer-html5-crash.patch
146 new file mode 100644
147 index 0000000..85d6999
148 --- /dev/null
149 +++ b/www-client/firefox/files/firefox-15.0-fix-gstreamer-html5-crash.patch
150 @@ -0,0 +1,26 @@
151 +https://bugzilla.mozilla.org/show_bug.cgi?id=761030
152 +
153 +Went into Fx 16, but not 15
154 +
155 +diff -r 07d362aa2c1b content/media/gstreamer/nsGStreamerReader.cpp
156 +--- a/content/media/gstreamer/nsGStreamerReader.cpp Sun Jun 03 12:04:40 2012 -0700
157 ++++ b/content/media/gstreamer/nsGStreamerReader.cpp Sun Jun 03 14:37:55 2012 -0700
158 +@@ -447,16 +447,18 @@ bool nsGStreamerReader::DecodeVideoFrame
159 + for(int i = 0; i < 3; i++) {
160 + b.mPlanes[i].mData = data + gst_video_format_get_component_offset(format, i,
161 + width, height);
162 + b.mPlanes[i].mStride = gst_video_format_get_row_stride(format, i, width);
163 + b.mPlanes[i].mHeight = gst_video_format_get_component_height(format,
164 + i, height);
165 + b.mPlanes[i].mWidth = gst_video_format_get_component_width(format,
166 + i, width);
167 ++ b.mPlanes[i].mOffset = 0;
168 ++ b.mPlanes[i].mSkip = 0;
169 + }
170 +
171 + bool isKeyframe = !GST_BUFFER_FLAG_IS_SET(buffer,
172 + GST_BUFFER_FLAG_DELTA_UNIT);
173 + /* XXX ? */
174 + PRInt64 offset = 0;
175 + VideoData *video = VideoData::Create(mInfo,
176 + mDecoder->GetImageContainer(),
177
178 diff --git a/www-client/firefox/files/gentoo-default-prefs.js-1 b/www-client/firefox/files/gentoo-default-prefs.js-1
179 new file mode 100644
180 index 0000000..22a51ff
181 --- /dev/null
182 +++ b/www-client/firefox/files/gentoo-default-prefs.js-1
183 @@ -0,0 +1,17 @@
184 +pref("app.update.enabled", false);
185 +pref("app.update.autoInstallEnabled", false);
186 +pref("browser.display.use_system_colors", true);
187 +pref("browser.link.open_external", 3);
188 +pref("general.smoothScroll", true);
189 +pref("general.autoScroll", false);
190 +pref("browser.tabs.tabMinWidth", 15);
191 +pref("browser.backspace_action", 0);
192 +pref("browser.urlbar.hideGoButton", true);
193 +pref("accessibility.typeaheadfind", true);
194 +pref("browser.shell.checkDefaultBrowser", false);
195 +pref("browser.EULA.override", true);
196 +pref("general.useragent.vendor", "Gentoo");
197 +pref("intl.locale.matchOS", true);
198 +pref("general.useragent.locale", "chrome://global/locale/intl.properties");
199 +pref("extensions.autoDisableScopes", 0);
200 +pref("layout.css.dpi", 0);
201
202 diff --git a/www-client/firefox/files/icon/firefox.desktop b/www-client/firefox/files/icon/firefox.desktop
203 new file mode 100644
204 index 0000000..35999a8
205 --- /dev/null
206 +++ b/www-client/firefox/files/icon/firefox.desktop
207 @@ -0,0 +1,9 @@
208 +[Desktop Entry]
209 +Name=@NAME@
210 +Comment=Web Browser
211 +Exec=firefox %U
212 +Icon=@ICON@
213 +Terminal=false
214 +Type=Application
215 +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
216 +Categories=Network;WebBrowser;
217
218 diff --git a/www-client/firefox/firefox-15.0_beta2-r1.ebuild b/www-client/firefox/firefox-15.0_beta2-r1.ebuild
219 new file mode 100644
220 index 0000000..103172e
221 --- /dev/null
222 +++ b/www-client/firefox/firefox-15.0_beta2-r1.ebuild
223 @@ -0,0 +1,385 @@
224 +# Copyright 1999-2012 Gentoo Foundation
225 +# Distributed under the terms of the GNU General Public License v2
226 +# $Header: $
227 +
228 +EAPI="3"
229 +VIRTUALX_REQUIRED="pgo"
230 +WANT_AUTOCONF="2.1"
231 +MOZ_ESR=""
232 +
233 +# This list can be updated with scripts/get_langs.sh from the mozilla overlay
234 +MOZ_LANGS=(af ak ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de el en
235 +en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl
236 +gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko ku lg lij lt lv mai mk ml mn
237 +mr nb-NO nl nn-NO nso or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE
238 +sw ta ta-LK te th tr uk vi zh-CN zh-TW zu )
239 +
240 +# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
241 +MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
242 +MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
243 +MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
244 +
245 +if [[ ${MOZ_ESR} == 1 ]]; then
246 + # ESR releases have slightly version numbers
247 + MOZ_PV="${MOZ_PV}esr"
248 +fi
249 +
250 +# Patch version
251 +PATCH="${PN}-15.0-patches-0.3"
252 +# Upstream ftp release URI that's used by mozlinguas.eclass
253 +# We don't use the http mirror because it deletes old tarballs.
254 +MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
255 +
256 +inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 multilib pax-utils fdo-mime autotools python virtualx nsplugins mozlinguas
257 +
258 +DESCRIPTION="Firefox Web Browser"
259 +HOMEPAGE="http://www.mozilla.com/firefox"
260 +
261 +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
262 +SLOT="0"
263 +LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
264 +IUSE="bindist gstreamer +ipc +jit +minimal pgo selinux system-sqlite +webm"
265 +
266 +# More URIs appended below...
267 +SRC_URI="${SRC_URI}
268 + http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz"
269 +
270 +ASM_DEPEND=">=dev-lang/yasm-1.1"
271 +
272 +# Mesa 7.10 needed for WebGL + bugfixes
273 +RDEPEND="
274 + >=sys-devel/binutils-2.16.1
275 + >=dev-libs/nss-3.13.5
276 + >=dev-libs/nspr-4.9.1
277 + >=dev-libs/glib-2.26:2
278 + >=media-libs/mesa-7.10
279 + >=media-libs/libpng-1.5.9[apng]
280 + virtual/libffi
281 + gstreamer? (
282 + >=media-libs/gstreamer-0.10.33:0.10
283 + >=media-libs/gst-plugins-base-0.10.33:0.10 )
284 + system-sqlite? ( >=dev-db/sqlite-3.7.12.1[fts3,secure-delete,threadsafe,unlock-notify,debug=] )
285 + webm? ( >=media-libs/libvpx-1.0.0
286 + media-libs/alsa-lib )
287 + selinux? ( sec-policy/selinux-mozilla )"
288 +# We don't use PYTHON_DEPEND/PYTHON_USE_WITH for some silly reason
289 +DEPEND="${RDEPEND}
290 + >=sys-devel/patch-2.6.1.169
291 + virtual/pkgconfig
292 + pgo? (
293 + =dev-lang/python-2*[sqlite]
294 + >=sys-devel/gcc-4.5 )
295 + webm? ( x86? ( ${ASM_DEPEND} )
296 + amd64? ( ${ASM_DEPEND} )
297 + virtual/opengl )"
298 +
299 +# No source releases for alpha|beta
300 +if [[ ${PV} =~ alpha ]]; then
301 + CHANGESET="8a3042764de7"
302 + SRC_URI="${SRC_URI}
303 + http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
304 + S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
305 +elif [[ ${PV} =~ beta ]]; then
306 + S="${WORKDIR}/mozilla-beta"
307 + SRC_URI="${SRC_URI}
308 + ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
309 +else
310 + SRC_URI="${SRC_URI}
311 + ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
312 + if [[ ${MOZ_ESR} == 1 ]]; then
313 + S="${WORKDIR}/mozilla-esr${PV%%.*}"
314 + else
315 + S="${WORKDIR}/mozilla-release"
316 + fi
317 +fi
318 +
319 +QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
320 +
321 +pkg_setup() {
322 + moz_pkgsetup
323 +
324 + # Avoid PGO profiling problems due to enviroment leakage
325 + # These should *always* be cleaned up anyway
326 + unset DBUS_SESSION_BUS_ADDRESS \
327 + DISPLAY \
328 + ORBIT_SOCKETDIR \
329 + SESSION_MANAGER \
330 + XDG_SESSION_COOKIE \
331 + XAUTHORITY
332 +
333 + if ! use bindist; then
334 + einfo
335 + elog "You are enabling official branding. You may not redistribute this build"
336 + elog "to any users on your network or the internet. Doing so puts yourself into"
337 + elog "a legal problem with Mozilla Foundation"
338 + elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
339 + fi
340 +
341 + if use pgo; then
342 + einfo
343 + ewarn "You will do a double build for profile guided optimization."
344 + ewarn "This will result in your build taking at least twice as long as before."
345 + fi
346 +
347 + # Ensure we have enough disk space to compile
348 + if use pgo || use debug || use test ; then
349 + CHECKREQS_DISK_BUILD="8G"
350 + else
351 + CHECKREQS_DISK_BUILD="4G"
352 + fi
353 + check-reqs_pkg_setup
354 +}
355 +
356 +src_unpack() {
357 + unpack ${A}
358 +
359 + # Unpack language packs
360 + mozlinguas_src_unpack
361 +}
362 +
363 +src_prepare() {
364 + # Apply our patches
365 + EPATCH_SUFFIX="patch" \
366 + EPATCH_FORCE="yes" \
367 + epatch "${WORKDIR}/firefox"
368 +
369 + # Allow AAC and H.264 files to be played using <audio> and <video>
370 + epatch "${FILESDIR}"/${PN}*-gst*.patch
371 +
372 + # Allow user to apply any additional patches without modifing ebuild
373 + epatch_user
374 +
375 + # Enable gnomebreakpad
376 + if use debug ; then
377 + sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
378 + "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
379 + fi
380 +
381 + # Disable gnomevfs extension
382 + sed -i -e "s:gnomevfs::" "${S}/"browser/confvars.sh \
383 + -e "s:gnomevfs::" "${S}/"xulrunner/confvars.sh \
384 + || die "Failed to remove gnomevfs extension"
385 +
386 + # Ensure that are plugins dir is enabled as default
387 + sed -i -e "s:/usr/lib/mozilla/plugins:/usr/$(get_libdir)/nsbrowser/plugins:" \
388 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path!"
389 +
390 + # Fix sandbox violations during make clean, bug 372817
391 + sed -e "s:\(/no-such-file\):${T}\1:g" \
392 + -i "${S}"/config/rules.mk \
393 + -i "${S}"/js/src/config/rules.mk \
394 + -i "${S}"/nsprpub/configure{.in,} \
395 + || die
396 +
397 + #Fix compilation with curl-7.21.7 bug 376027
398 + sed -e '/#include <curl\/types.h>/d' \
399 + -i "${S}"/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc \
400 + -i "${S}"/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc \
401 + -i "${S}"/config/system-headers \
402 + -i "${S}"/js/src/config/system-headers || die "Sed failed"
403 +
404 + # Don't exit with error when some libs are missing which we have in
405 + # system.
406 + sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
407 + -i "${S}"/browser/installer/Makefile.in || die
408 +
409 + # Don't error out when there's no files to be removed:
410 + sed 's@\(xargs rm\)$@\1 -f@' \
411 + -i "${S}"/toolkit/mozapps/installer/packager.mk || die
412 +
413 + # Used to properly configure and use jemalloc-3
414 + chmod a+x "${S}/memory/jemalloc/src/configure"
415 + chmod a+x "${S}/memory/jemalloc/src/include/jemalloc/internal/size_classes.sh"
416 + echo "stamp" > "${S}/memory/jemalloc/src/config.stamp.in"
417 +
418 + eautoreconf
419 +}
420 +
421 +src_configure() {
422 + MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
423 + MEXTENSIONS="default"
424 +
425 + ####################################
426 + #
427 + # mozconfig, CFLAGS and CXXFLAGS setup
428 + #
429 + ####################################
430 +
431 + mozconfig_init
432 + mozconfig_config
433 +
434 + # It doesn't compile on alpha without this LDFLAGS
435 + use alpha && append-ldflags "-Wl,--no-relax"
436 +
437 + # We must force enable jemalloc 3 threw .mozconfig
438 + echo "export MOZ_JEMALLOC=1" > ${S}/.mozconfig
439 +
440 + # Basic options to control the enviroment in which we compile
441 + mozconfig_annotate '' --prefix="${EPREFIX}"/usr
442 + mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
443 + mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
444 + mozconfig_annotate '' --disable-gconf
445 + mozconfig_annotate '' --disable-mailnews
446 + mozconfig_annotate '' --enable-canvas
447 + mozconfig_annotate '' --enable-safe-browsing
448 + mozconfig_annotate '' --with-system-png
449 + mozconfig_annotate '' --enable-system-ffi
450 +
451 + # Other ff-specific settings
452 + mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
453 + mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
454 +
455 + mozconfig_use_enable gstreamer
456 + mozconfig_use_enable system-sqlite
457 + # Both methodjit and tracejit conflict with PaX
458 + mozconfig_use_enable jit methodjit
459 + mozconfig_use_enable jit tracejit
460 +
461 + # Allow for a proper pgo build
462 + if use pgo; then
463 + echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
464 + fi
465 +
466 + # Finalize and report settings
467 + mozconfig_final
468 +
469 + if [[ $(gcc-major-version) -lt 4 ]]; then
470 + append-cxxflags -fno-stack-protector
471 + elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
472 + if use amd64 || use x86; then
473 + append-flags -mno-avx
474 + fi
475 + fi
476 +}
477 +
478 +src_compile() {
479 + if use pgo; then
480 + addpredict /root
481 + addpredict /etc/gconf
482 + # Reset and cleanup environment variables used by GNOME/XDG
483 + gnome2_environment_reset
484 +
485 + # Firefox tries to use dri stuff when it's run, see bug 380283
486 + shopt -s nullglob
487 + cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
488 + if test -n "${cards}"; then
489 + # FOSS drivers are fine
490 + addpredict "${cards}"
491 + else
492 + cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
493 + if test -n "${cards}"; then
494 + # Binary drivers seem to cause access violations anyway, so
495 + # let's use indirect rendering so that the device files aren't
496 + # touched at all. See bug 394715.
497 + export LIBGL_ALWAYS_INDIRECT=1
498 + fi
499 + fi
500 + shopt -u nullglob
501 +
502 + CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
503 + MOZ_MAKE_FLAGS="${MAKEOPTS}" \
504 + Xemake -f client.mk profiledbuild || die "Xemake failed"
505 + else
506 + CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
507 + MOZ_MAKE_FLAGS="${MAKEOPTS}" \
508 + emake -f client.mk || die "emake failed"
509 + fi
510 +
511 +}
512 +
513 +src_install() {
514 + MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
515 +
516 + # MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler, pgo, etc.
517 + local obj_dir="$(echo */config.log)"
518 + obj_dir="${obj_dir%/*}"
519 + cd "${S}/${obj_dir}"
520 +
521 + # Without methodjit and tracejit there's no conflict with PaX
522 + if use jit; then
523 + # Pax mark xpcshell for hardened support, only used for startupcache creation.
524 + pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
525 + fi
526 +
527 + # Add our default prefs for firefox
528 + cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
529 + "${S}/${obj_dir}/dist/bin/defaults/preferences/all-gentoo.js" || die
530 +
531 + MOZ_MAKE_FLAGS="${MAKEOPTS}" \
532 + emake DESTDIR="${D}" install || die "emake install failed"
533 +
534 + # Install language packs
535 + mozlinguas_src_install
536 +
537 + local size sizes icon_path icon name
538 + if use bindist; then
539 + sizes="16 32 48"
540 + icon_path="${S}/browser/branding/aurora"
541 + # Firefox's new rapid release cycle means no more codenames
542 + # Let's just stick with this one...
543 + icon="aurora"
544 + name="Aurora"
545 + else
546 + sizes="16 22 24 32 256"
547 + icon_path="${S}/browser/branding/official"
548 + icon="${PN}"
549 + name="Mozilla Firefox"
550 + fi
551 +
552 + # Install icons and .desktop for menu entry
553 + for size in ${sizes}; do
554 + insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
555 + newins "${icon_path}/default${size}.png" "${icon}.png" || die
556 + done
557 + # The 128x128 icon has a different name
558 + insinto "/usr/share/icons/hicolor/128x128/apps"
559 + newins "${icon_path}/mozicon128.png" "${icon}.png" || die
560 + # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
561 + newicon "${icon_path}/content/icon48.png" "${icon}.png" || die
562 + newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop" || die
563 + sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
564 + "${ED}/usr/share/applications/${PN}.desktop" || die
565 +
566 + # Add StartupNotify=true bug 237317
567 + if use startup-notification ; then
568 + echo "StartupNotify=true" >> "${ED}/usr/share/applications/${PN}.desktop"
569 + fi
570 +
571 + # Without methodjit and tracejit there's no conflict with PaX
572 + if use jit; then
573 + # Required in order to use plugins and even run firefox on hardened.
574 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin}
575 + fi
576 +
577 + # Plugin-container needs to be pax-marked for hardened to ensure plugins such as flash
578 + # continue to work as expected.
579 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
580 +
581 + # Plugins dir
582 + share_plugins_dir
583 +
584 + if use minimal; then
585 + rm -rf "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} || \
586 + die "Failed to remove sdk and headers"
587 + fi
588 +
589 + # very ugly hack to make firefox not sigbus on sparc
590 + # FIXME: is this still needed??
591 + use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
592 + -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" || \
593 + die "sparc sed failed"; }
594 +}
595 +
596 +pkg_preinst() {
597 + gnome2_icon_savelist
598 +}
599 +
600 +pkg_postinst() {
601 + # Update mimedb for the new .desktop file
602 + fdo-mime_desktop_database_update
603 + gnome2_icon_cache_update
604 +}
605 +
606 +pkg_postrm() {
607 + gnome2_icon_cache_update
608 +}