Gentoo Archives: gentoo-commits

From: Ian Stakenvicius <axs@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mozilla:master commit in: www-client/firefox/files/, www-client/firefox/
Date: Fri, 02 Sep 2016 13:55:39
Message-Id: 1472824491.7e4a744a2505db6f7f3e639e459537ad39d57346.axs@gentoo
1 commit: 7e4a744a2505db6f7f3e639e459537ad39d57346
2 Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 2 13:54:51 2016 +0000
4 Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 2 13:54:51 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=7e4a744a
7
8 www-client/firefox-49.0: committing initial ebuild with beta8 codebase
9
10 www-client/firefox/Manifest | 2 +
11 www-client/firefox/files/firefox-48.0-pgo.patch | 12 +
12 www-client/firefox/firefox-49.0_beta8.ebuild | 369 ++++++++++++++++++++++++
13 3 files changed, 383 insertions(+)
14
15 diff --git a/www-client/firefox/Manifest b/www-client/firefox/Manifest
16 index 33bd4b1..4ac58ab 100644
17 --- a/www-client/firefox/Manifest
18 +++ b/www-client/firefox/Manifest
19 @@ -177,3 +177,5 @@ DIST firefox-48.0-xh.xpi 443336 SHA256 c16a47017795844456d029dbac215cec71cd09c8f
20 DIST firefox-48.0-zh-CN.xpi 469205 SHA256 5e6008806e9e2351aa25ed4158ec5b2756fa0a72ea8c544707391540f2083fa4 SHA512 b4bb864f18c527e6d3e252a45fcfb3ff5eafde67a85792ae8c862af63d6abaece612316615f4b89b73b76ada734c5f8764a75ec633b830fc128eb8d79a4773bd WHIRLPOOL fcd85686cba910a0fab8225d4607620f68b0ffd2ee82fab7c64660b82bda13be3b198c8e84df747ccd62b0b8cc47bcaaf6001bbed5d3f4335004027a41d22b46
21 DIST firefox-48.0-zh-TW.xpi 471419 SHA256 e012cd3a41acd21206f76326f2b08e2f458785d826e58300c354e5db3354b98c SHA512 d74cb21838de35e6324a8af43a5f24bc469e5becfaa2a2efb8caf09aaba3b86484f3168d14189031fd8225c1cf469ee60a57ada984d9850a395e819e784e8112 WHIRLPOOL 81f730bf571066d87caa0a4213f446d0827a68a1cdbbe94e6bd2e0d1caf0a81f32760685802d4115a05676ffdf82fc13f6c928128e6f854a0a19a7c13c0c632e
22 DIST firefox-48.0.source.tar.xz 188339876 SHA256 f474113a1ee75a01d43e270bf438ba78b9f7f2e397a66652b43603235fa76e21 SHA512 51bbb1954920b4d0e49e2834939748e596ed27c09a45adeea2be2cfbd32898dae41f13db17318e9699fa96c41fb50fba9966df1f88deeadc0ae3bdd679bd79c5 WHIRLPOOL f37b1b3ae7d775c5ce12bb7d2abf4983adad498e73e317e5f96a164783d1deadebce5ada3ee38916dab7c86d71b52ebbb10a5dc703af5d5d4ff42af1d4abeefa
23 +DIST firefox-49.0-patches-01.tar.xz 12264 SHA256 18824e451fd2a842d03d4cd067f87e28cd45e74cc119a83cb98f002ba0827373 SHA512 4062c548142e9b16d9a7be68879276b584df52aff61a7d3fc92e36f4c6a289115f45714de79e9d176792b197ada99560e0d21b85068d815653b87341bdf03f8d WHIRLPOOL 58cc6c60ea34c64595497606b1fd18486d11ccc61220c27671d13eebc89cca709a448ac884a55d089e008012a2221de7d8ee350bd235eb13cfae9e1da62a2d0d
24 +DIST firefox-49.0b8.source.tar.xz 189272336 SHA256 52fe6d7cb2eca42f3e55ace2de02c99f450901f53e6213a4394fc83e3d0ec988 SHA512 c24c490bf4fc84a3fe7ed216179421eca83f997b6bdccfbf72d0a2e2be71bb8d91d35ca2c8c7ded0eed52ab6f5000a60062684173d4bf7e9e0290b3ca9b61862 WHIRLPOOL 82f35a82955f7c8fffadf18d8582c62a95f9df8d893f881bb94111a022a0f3ecc1e0a5b1237d0850500d2427d65c09e1f5d57f473f191f897f79ff2251595225
25
26 diff --git a/www-client/firefox/files/firefox-48.0-pgo.patch b/www-client/firefox/files/firefox-48.0-pgo.patch
27 new file mode 100644
28 index 0000000..645c008
29 --- /dev/null
30 +++ b/www-client/firefox/files/firefox-48.0-pgo.patch
31 @@ -0,0 +1,12 @@
32 +--- firefox-47.0.1/Makefile.in.orig 2016-06-01 07:11:37.000000000 +0300
33 ++++ firefox-47.0.1/Makefile.in 2016-08-06 16:45:14.442699244 +0300
34 +@@ -55,6 +55,9 @@
35 + endif
36 + endif
37 +
38 ++pgo-profile-run:
39 ++ $(PYTHON) $(topsrcdir)/build/pgo/profileserver.py $(EXTRA_TEST_ARGS)
40 ++
41 + ifdef JS_STANDALONE
42 + .PHONY: CLOBBER
43 + CLOBBER:
44
45 diff --git a/www-client/firefox/firefox-49.0_beta8.ebuild b/www-client/firefox/firefox-49.0_beta8.ebuild
46 new file mode 100644
47 index 0000000..181f1b2
48 --- /dev/null
49 +++ b/www-client/firefox/firefox-49.0_beta8.ebuild
50 @@ -0,0 +1,369 @@
51 +# Copyright 1999-2016 Gentoo Foundation
52 +# Distributed under the terms of the GNU General Public License v2
53 +# $Id$
54 +
55 +EAPI=6
56 +VIRTUALX_REQUIRED="pgo"
57 +WANT_AUTOCONF="2.1"
58 +MOZ_ESR=""
59 +
60 +# This list can be updated with scripts/get_langs.sh from the mozilla overlay
61 +# Excluding cak, dsb, ff, gn, lij as they arent on the gentoo list
62 +MOZ_LANGS=( ach af an ar as ast az be bg bn-BD bn-IN br bs ca cs cy da de
63 +el en en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr fy-NL
64 +ga-IE gd gl gu-IN he hi-IN hr hsb hu hy-AM id is it ja kk km kn ko lt
65 +lv mai mk ml mr ms nb-NO nl nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl
66 +son sq sr sv-SE ta te th tr uk uz vi xh zh-CN zh-TW )
67 +
68 +# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
69 +MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
70 +MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
71 +MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
72 +
73 +if [[ ${MOZ_ESR} == 1 ]]; then
74 + # ESR releases have slightly different version numbers
75 + MOZ_PV="${MOZ_PV}esr"
76 +fi
77 +
78 +# Patch version
79 +PATCH="${PN}-49.0-patches-01"
80 +MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases"
81 +
82 +#MOZCONFIG_OPTIONAL_QT5=1 -- fails to build so leave it off until the code can be patched
83 +MOZCONFIG_OPTIONAL_GTK2ONLY=1
84 +MOZCONFIG_OPTIONAL_WIFI=1
85 +MOZCONFIG_OPTIONAL_JIT="enabled"
86 +
87 +inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.48 pax-utils fdo-mime autotools virtualx mozlinguas-v2
88 +
89 +DESCRIPTION="Firefox Web Browser"
90 +HOMEPAGE="http://www.mozilla.com/firefox"
91 +
92 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
93 +
94 +SLOT="0"
95 +LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
96 +IUSE="bindist egl hardened +hwaccel pgo selinux +gmp-autoupdate test"
97 +RESTRICT="!bindist? ( bindist )"
98 +
99 +PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/${PATCH}.tar.xz )
100 +SRC_URI="${SRC_URI}
101 + ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.xz
102 + ${PATCH_URIS[@]}"
103 +
104 +ASM_DEPEND=">=dev-lang/yasm-1.1"
105 +
106 +RDEPEND="
107 + >=dev-libs/nss-3.24
108 + >=dev-libs/nspr-4.12
109 + selinux? ( sec-policy/selinux-mozilla )"
110 +
111 +DEPEND="${RDEPEND}
112 + pgo? ( >=sys-devel/gcc-4.5 )
113 + amd64? ( ${ASM_DEPEND} virtual/opengl )
114 + x86? ( ${ASM_DEPEND} virtual/opengl )"
115 +
116 +S="${WORKDIR}/firefox-${MOZ_PV}"
117 +
118 +QA_PRESTRIPPED="usr/lib*/${PN}/firefox"
119 +
120 +BUILD_OBJ_DIR="${S}/ff"
121 +
122 +pkg_setup() {
123 + moz_pkgsetup
124 +
125 + # Avoid PGO profiling problems due to enviroment leakage
126 + # These should *always* be cleaned up anyway
127 + unset DBUS_SESSION_BUS_ADDRESS \
128 + DISPLAY \
129 + ORBIT_SOCKETDIR \
130 + SESSION_MANAGER \
131 + XDG_SESSION_COOKIE \
132 + XAUTHORITY
133 +
134 + if ! use bindist; then
135 + einfo
136 + elog "You are enabling official branding. You may not redistribute this build"
137 + elog "to any users on your network or the internet. Doing so puts yourself into"
138 + elog "a legal problem with Mozilla Foundation"
139 + elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
140 + fi
141 +
142 + if use pgo; then
143 + einfo
144 + ewarn "You will do a double build for profile guided optimization."
145 + ewarn "This will result in your build taking at least twice as long as before."
146 + fi
147 +}
148 +
149 +pkg_pretend() {
150 + # Ensure we have enough disk space to compile
151 + if use pgo || use debug || use test ; then
152 + CHECKREQS_DISK_BUILD="8G"
153 + else
154 + CHECKREQS_DISK_BUILD="4G"
155 + fi
156 + check-reqs_pkg_setup
157 +}
158 +
159 +src_unpack() {
160 + unpack ${A}
161 +
162 + # Unpack language packs
163 + mozlinguas_src_unpack
164 +}
165 +
166 +src_prepare() {
167 + # Apply our patches
168 + eapply "${WORKDIR}/firefox" \
169 + "${FILESDIR}"/${PN}-48.0-pgo.patch
170 +# "${FILESDIR}"/${PN}-45-qt-widget-fix.patch
171 +
172 + if ! tc-ld-is-gold && has_version ">=sys-devel/binutils-2.26" ; then
173 + eapply "${FILESDIR}"/xpcom-components-binutils-26.patch
174 + fi
175 +
176 + # Enable gnomebreakpad
177 + if use debug ; then
178 + sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
179 + "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
180 + fi
181 +
182 + # Ensure that our plugins dir is enabled as default
183 + sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
184 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
185 + sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
186 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
187 +
188 + # Fix sandbox violations during make clean, bug 372817
189 + sed -e "s:\(/no-such-file\):${T}\1:g" \
190 + -i "${S}"/config/rules.mk \
191 + -i "${S}"/nsprpub/configure{.in,} \
192 + || die
193 +
194 + # Don't exit with error when some libs are missing which we have in
195 + # system.
196 + sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
197 + -i "${S}"/browser/installer/Makefile.in || die
198 +
199 + # Don't error out when there's no files to be removed:
200 + sed 's@\(xargs rm\)$@\1 -f@' \
201 + -i "${S}"/toolkit/mozapps/installer/packager.mk || die
202 +
203 + # Keep codebase the same even if not using official branding
204 + sed '/^MOZ_DEV_EDITION=1/d' \
205 + -i "${S}"/browser/branding/aurora/configure.sh || die
206 +
207 + # Allow user to apply any additional patches without modifing ebuild
208 + eapply_user
209 +
210 + # Autotools configure is now called old-configure.in
211 + # This works because there is still a configure.in that happens to be for the
212 + # shell wrapper configure script
213 + eautoreconf old-configure.in
214 +
215 + # Must run autoconf in js/src
216 + cd "${S}"/js/src || die
217 +# /usr/bin/autoconf-2.13 -l ${SYSROOT}/usr/share/aclocal old-configure.in
218 + eautoconf old-configure.in
219 +
220 + # Need to update jemalloc's configure
221 + cd "${S}"/memory/jemalloc/src || die
222 + WANT_AUTOCONF= eautoconf
223 +}
224 +
225 +src_configure() {
226 + MEXTENSIONS="default"
227 + # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
228 + # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
229 + # get your own set of keys.
230 + _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
231 +
232 + ####################################
233 + #
234 + # mozconfig, CFLAGS and CXXFLAGS setup
235 + #
236 + ####################################
237 +
238 + mozconfig_init
239 + mozconfig_config
240 +
241 + # It doesn't compile on alpha without this LDFLAGS
242 + use alpha && append-ldflags "-Wl,--no-relax"
243 +
244 + # Add full relro support for hardened
245 + use hardened && append-ldflags "-Wl,-z,relro,-z,now"
246 +
247 + # Only available on mozilla-overlay for experimentation -- Removed in Gentoo repo per bug 571180
248 + use egl && mozconfig_annotate 'Enable EGL as GL provider' --with-gl-provider=EGL
249 +
250 + # Setup api key for location services
251 + echo -n "${_google_api_key}" > "${S}"/google-api-key
252 + mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
253 +
254 + mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
255 +
256 + # Allow for a proper pgo build
257 + if use pgo; then
258 + echo "mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 \$(MAKE) -C \$(MOZ_OBJDIR) pgo-profile-run'" >> "${S}"/.mozconfig
259 + fi
260 +
261 + echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
262 + echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig
263 +
264 + # Finalize and report settings
265 + mozconfig_final
266 +
267 + if [[ $(gcc-major-version) -lt 4 ]]; then
268 + append-cxxflags -fno-stack-protector
269 + fi
270 +
271 + # workaround for funky/broken upstream configure...
272 + SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
273 + emake -f client.mk configure
274 +}
275 +
276 +src_compile() {
277 + if use pgo; then
278 + addpredict /root
279 + addpredict /etc/gconf
280 + # Reset and cleanup environment variables used by GNOME/XDG
281 + gnome2_environment_reset
282 +
283 + # Firefox tries to use dri stuff when it's run, see bug 380283
284 + shopt -s nullglob
285 + cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
286 + if test -z "${cards}"; then
287 + cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
288 + if test -n "${cards}"; then
289 + # Binary drivers seem to cause access violations anyway, so
290 + # let's use indirect rendering so that the device files aren't
291 + # touched at all. See bug 394715.
292 + export LIBGL_ALWAYS_INDIRECT=1
293 + fi
294 + fi
295 + shopt -u nullglob
296 + addpredict "${cards}"
297 +
298 + MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
299 + virtx emake -f client.mk profiledbuild || die "virtx emake failed"
300 + else
301 + MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
302 + emake -f client.mk realbuild
303 + fi
304 +
305 +}
306 +
307 +src_install() {
308 + cd "${BUILD_OBJ_DIR}" || die
309 +
310 + # Pax mark xpcshell for hardened support, only used for startupcache creation.
311 + pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
312 +
313 + # Add our default prefs for firefox
314 + cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
315 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
316 + || die
317 +
318 + mozconfig_install_prefs \
319 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
320 +
321 + # Augment this with hwaccel prefs
322 + if use hwaccel ; then
323 + cat "${FILESDIR}"/gentoo-hwaccel-prefs.js-1 >> \
324 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
325 + || die
326 + fi
327 +
328 + echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
329 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
330 + || die
331 +
332 + local plugin
333 + use gmp-autoupdate || for plugin in \
334 + gmp-gmpopenh264 ; do
335 + echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
336 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
337 + || die
338 + done
339 +
340 + MOZ_MAKE_FLAGS="${MAKEOPTS}" \
341 + emake DESTDIR="${D}" install
342 +
343 + # Install language packs
344 + mozlinguas_src_install
345 +
346 + local size sizes icon_path icon name
347 + if use bindist; then
348 + sizes="16 32 48"
349 + icon_path="${S}/browser/branding/aurora"
350 + # Firefox's new rapid release cycle means no more codenames
351 + # Let's just stick with this one...
352 + icon="aurora"
353 + name="Aurora"
354 +
355 + # Override preferences to set the MOZ_DEV_EDITION defaults, since we
356 + # don't define MOZ_DEV_EDITION to avoid profile debaucles.
357 + # (source: browser/app/profile/firefox.js)
358 + cat >>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" <<PROFILE_EOF
359 +pref("app.feedback.baseURL", "https://input.mozilla.org/%LOCALE%/feedback/firefoxdev/%VERSION%/");
360 +sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@×××××××.org");
361 +sticky_pref("browser.devedition.theme.enabled", true);
362 +sticky_pref("devtools.theme", "dark");
363 +PROFILE_EOF
364 +
365 + else
366 + sizes="16 22 24 32 256"
367 + icon_path="${S}/browser/branding/official"
368 + icon="${PN}"
369 + name="Mozilla Firefox"
370 + fi
371 +
372 + # Install icons and .desktop for menu entry
373 + for size in ${sizes}; do
374 + insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
375 + newins "${icon_path}/default${size}.png" "${icon}.png"
376 + done
377 + # The 128x128 icon has a different name
378 + insinto "/usr/share/icons/hicolor/128x128/apps"
379 + newins "${icon_path}/mozicon128.png" "${icon}.png"
380 + # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
381 + newicon "${icon_path}/content/icon48.png" "${icon}.png"
382 + newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
383 + sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
384 + "${ED}/usr/share/applications/${PN}.desktop" || die
385 +
386 + # Add StartupNotify=true bug 237317
387 + if use startup-notification ; then
388 + echo "StartupNotify=true"\
389 + >> "${ED}/usr/share/applications/${PN}.desktop" \
390 + || die
391 + fi
392 +
393 + # Required in order to use plugins and even run firefox on hardened, with jit useflag.
394 + if use jit; then
395 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
396 + else
397 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
398 + fi
399 +
400 + # very ugly hack to make firefox not sigbus on sparc
401 + # FIXME: is this still needed??
402 + use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
403 + -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" \
404 + || die "sparc sed failed"; }
405 +}
406 +
407 +pkg_preinst() {
408 + gnome2_icon_savelist
409 +}
410 +
411 +pkg_postinst() {
412 + # Update mimedb for the new .desktop file
413 + fdo-mime_desktop_database_update
414 + gnome2_icon_cache_update
415 +}
416 +
417 +pkg_postrm() {
418 + gnome2_icon_cache_update
419 +}