Gentoo Archives: gentoo-commits

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