Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mozilla:master commit in: eclass/, www-client/firefox/
Date: Thu, 26 Oct 2017 01:01:02
Message-Id: 1508979632.3f61a6740746d2d65876ee96776e5ccdbebc78d1.anarchy@gentoo
1 commit: 3f61a6740746d2d65876ee96776e5ccdbebc78d1
2 Author: Jory A. Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 26 01:00:32 2017 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 26 01:00:32 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=3f61a674
7
8 www-client/firefox - enable stylo support for amd64
9
10 eclass/mozconfig-v6.57.eclass | 393 ++++++++++++++++++++++++++
11 www-client/firefox/firefox-57.0_beta10.ebuild | 15 +-
12 2 files changed, 403 insertions(+), 5 deletions(-)
13
14 diff --git a/eclass/mozconfig-v6.57.eclass b/eclass/mozconfig-v6.57.eclass
15 new file mode 100644
16 index 0000000..e31556e
17 --- /dev/null
18 +++ b/eclass/mozconfig-v6.57.eclass
19 @@ -0,0 +1,393 @@
20 +# Copyright 1999-2017 Gentoo Foundation
21 +# Distributed under the terms of the GNU General Public License v2
22 +#
23 +# @ECLASS: mozconfig-v6.57.eclass
24 +# @MAINTAINER:
25 +# mozilla team <mozilla@g.o>
26 +# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
27 +# @DESCRIPTION:
28 +# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
29 +# to provide a single common place for the common mozilla engine compoments.
30 +#
31 +# The eclass provides all common dependencies as well as common use flags.
32 +#
33 +# Some use flags which may be optional in particular mozilla packages can be
34 +# supported through setting eclass variables.
35 +#
36 +# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
37 +# and so ebuilds inheriting this eclass do not need to inherit that.
38 +
39 +case ${EAPI} in
40 + 0|1|2|3|4)
41 + die "EAPI=${EAPI} not supported"
42 + ;;
43 + 5)
44 + inherit multilib
45 + ;;
46 +esac
47 +
48 +inherit flag-o-matic toolchain-funcs mozcoreconf-v5
49 +
50 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
51 +# @DESCRIPTION:
52 +# Set this variable before the inherit line, when an ebuild needs to provide
53 +# optional necko-wifi support via IUSE="wifi". Currently this would include
54 +# ebuilds for firefox, and potentially seamonkey.
55 +#
56 +# Leave the variable UNSET if necko-wifi support should not be available.
57 +# Set the variable to "enabled" if the use flag should be enabled by default.
58 +# Set the variable to any value if the use flag should exist but not be default-enabled.
59 +
60 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
61 +# @DESCRIPTION:
62 +# Set this variable before the inherit line, when an ebuild needs to provide
63 +# deterministic jit support via IUSE="jit". The upstream default will be used
64 +# otherwise, which is generally to enable jit unless support for the platform
65 +# is missing.
66 +#
67 +# Set the variable to "enabled" if the use flag should be enabled by default.
68 +# Set the variable to any value if the use flag should exist but not be default-enabled.
69 +
70 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
71 +# @DESCRIPTION:
72 +# Set this variable before the inherit line, when an ebuild can provide
73 +# optional gtk3 support via IUSE="force-gtk3". Currently this would include
74 +# thunderbird and seamonkey in the future, once support is ready for testing.
75 +#
76 +# Leave the variable UNSET if gtk3 support should not be optionally available.
77 +# Set the variable to "enabled" if the use flag should be enabled by default.
78 +# Set the variable to any value if the use flag should exist but not be default-enabled.
79 +# If gtk+:3 is to be the standard toolkit, do not use this and instead use
80 +# MOZCONFIG_OPTIONAL_GTK2ONLY.
81 +
82 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY
83 +# @DESCRIPTION:
84 +# Set this variable before the inherit line, when an ebuild can provide
85 +# optional gtk2-only support via IUSE="gtk2".
86 +#
87 +# Note that this option conflicts directly with MOZCONFIG_OPTIONAL_GTK3, both
88 +# variables cannot be set at the same time and this variable will be ignored if
89 +# MOZCONFIG_OPTIONAL_GTK3 is set.
90 +#
91 +# Leave the variable UNSET if gtk2-only support should not be available.
92 +# Set the variable to "enabled" if the use flag should be enabled by default.
93 +# Set the variable to any value if the use flag should exist but not be default-enabled.
94 +
95 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
96 +# @DESCRIPTION:
97 +# Set this variable before the inherit line, when an ebuild can provide
98 +# optional qt5 support via IUSE="qt5". Currently this would include
99 +# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
100 +#
101 +# Leave the variable UNSET if qt5 support should not be available.
102 +# Set the variable to "enabled" if the use flag should be enabled by default.
103 +# Set the variable to any value if the use flag should exist but not be default-enabled.
104 +
105 +# use-flags common among all mozilla ebuilds
106 +IUSE="${IUSE} dbus debug neon pulseaudio selinux startup-notification system-harfbuzz
107 + system-icu system-jpeg system-libevent system-sqlite system-libvpx"
108 +
109 +# some notes on deps:
110 +# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
111 +# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
112 +
113 +RDEPEND=">=app-text/hunspell-1.5.4:=
114 + dev-libs/atk
115 + dev-libs/expat
116 + >=x11-libs/cairo-1.10[X]
117 + >=x11-libs/gtk+-2.18:2
118 + x11-libs/gdk-pixbuf
119 + >=x11-libs/pango-1.22.0
120 + >=media-libs/libpng-1.6.31:0=[apng]
121 + >=media-libs/mesa-10.2:*
122 + media-libs/fontconfig
123 + >=media-libs/freetype-2.4.10
124 + kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
125 + pulseaudio? ( || ( media-sound/pulseaudio
126 + >=media-sound/apulse-0.1.9 ) )
127 + virtual/freedesktop-icon-theme
128 + dbus? ( >=sys-apps/dbus-0.60
129 + >=dev-libs/dbus-glib-0.72 )
130 + startup-notification? ( >=x11-libs/startup-notification-0.8 )
131 + >=x11-libs/pixman-0.19.2
132 + >=dev-libs/glib-2.26:2
133 + >=sys-libs/zlib-1.2.3
134 + >=virtual/libffi-3.0.10
135 + virtual/ffmpeg
136 + x11-libs/libX11
137 + x11-libs/libXcomposite
138 + x11-libs/libXdamage
139 + x11-libs/libXext
140 + x11-libs/libXfixes
141 + x11-libs/libXrender
142 + x11-libs/libXt
143 + system-icu? ( >=dev-libs/icu-59.1:= )
144 + system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
145 + system-libevent? ( >=dev-libs/libevent-2.0:0= )
146 + system-sqlite? ( >=dev-db/sqlite-3.20.1:3[secure-delete,debug=] )
147 + system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
148 + system-harfbuzz? ( >=media-libs/harfbuzz-1.3.3:0= >=media-gfx/graphite2-1.3.9-r1 )
149 +"
150 +
151 +if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
152 + MOZCONFIG_OPTIONAL_GTK2ONLY=
153 + if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
154 + IUSE+=" +force-gtk3"
155 + else
156 + IUSE+=" force-gtk3"
157 + fi
158 + RDEPEND+=" force-gtk3? ( >=x11-libs/gtk+-3.4.0:3 )"
159 +elif [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
160 + if [[ ${MOZCONFIG_OPTIONAL_GTK2ONLY} = "enabled" ]]; then
161 + IUSE+=" +gtk2"
162 + else
163 + IUSE+=" gtk2"
164 + fi
165 + RDEPEND+=" !gtk2? ( >=x11-libs/gtk+-3.4.0:3 )"
166 +else
167 + # no gtk3 related dep set by optional use flags, force it
168 + RDEPEND+=" >=x11-libs/gtk+-3.4.0:3"
169 +fi
170 +if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
171 + if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
172 + IUSE+=" +wifi"
173 + else
174 + IUSE+=" wifi"
175 + fi
176 + RDEPEND+="
177 + wifi? (
178 + kernel_linux? ( >=sys-apps/dbus-0.60
179 + >=dev-libs/dbus-glib-0.72
180 + net-misc/networkmanager )
181 + )"
182 +fi
183 +
184 +DEPEND="app-arch/zip
185 + app-arch/unzip
186 + >=sys-devel/binutils-2.16.1
187 + sys-apps/findutils
188 + pulseaudio? ( media-sound/pulseaudio )
189 + >=virtual/rust-1.19.0
190 + ${RDEPEND}"
191 +
192 +RDEPEND+="
193 + pulseaudio? ( || ( media-sound/pulseaudio
194 + >=media-sound/apulse-0.1.9 ) )
195 + selinux? ( sec-policy/selinux-mozilla )"
196 +
197 +# @FUNCTION: mozconfig_config
198 +# @DESCRIPTION:
199 +# Set common configure options for mozilla packages.
200 +# Call this within src_configure() phase, after mozconfig_init
201 +#
202 +# Example:
203 +#
204 +# inherit mozconfig-v6.46
205 +#
206 +# src_configure() {
207 +# mozconfig_init
208 +# mozconfig_config
209 +# # ... misc ebuild-unique settings via calls to
210 +# # ... mozconfig_{annotate,use_with,use_enable}
211 +# mozconfig_final
212 +# }
213 +
214 +mozconfig_config() {
215 + # Migrated from mozcoreconf-2
216 + mozconfig_annotate 'system_libs' \
217 + --with-system-zlib \
218 + --with-system-bz2
219 +
220 + # Stylo is only broken on x86 builds
221 + use x86 && mozconfig_annotate 'Upstream bug 1341234' --disable-stylo
222 +
223 + # Must pass release in order to properly select linker
224 + mozconfig_annotate 'Enable by Gentoo' --enable-release
225 +
226 + # Must pass --enable-gold if using ld.gold
227 + if tc-ld-is-gold ; then
228 + mozconfig_annotate 'tc-ld-is-gold=true' --enable-gold
229 + else
230 + mozconfig_annotate 'tc-ld-is-gold=false' --disable-gold
231 + fi
232 +
233 + if has bindist ${IUSE}; then
234 + mozconfig_use_enable !bindist official-branding
235 + if [[ ${PN} == firefox ]] && use bindist ; then
236 + mozconfig_annotate '' --with-branding=browser/branding/aurora
237 + fi
238 + fi
239 +
240 + # Enable position independent executables
241 + mozconfig_annotate 'enabled by Gentoo' --enable-pie
242 + mozconfig_use_enable debug
243 + mozconfig_use_enable debug tests
244 +
245 + if ! use debug ; then
246 + mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
247 + else
248 + mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
249 + fi
250 +
251 + mozconfig_use_enable startup-notification
252 +
253 + if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
254 + # wifi pulls in dbus so manage both here
255 + mozconfig_use_enable wifi necko-wifi
256 + if use kernel_linux && use wifi && ! use dbus; then
257 + echo "Enabling dbus support due to wifi request"
258 + mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus
259 + else
260 + mozconfig_use_enable dbus
261 + fi
262 + else
263 + mozconfig_use_enable dbus
264 + mozconfig_annotate 'disabled' --disable-necko-wifi
265 + fi
266 +
267 + if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
268 + mozconfig_use_enable jit ion
269 + fi
270 +
271 + # These are enabled by default in all mozilla applications
272 + mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
273 + mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
274 + mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
275 + if use system-libevent; then
276 + mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
277 + fi
278 + mozconfig_annotate '' --prefix="${EPREFIX}"/usr
279 + mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
280 + mozconfig_annotate 'Gentoo default' --enable-system-hunspell
281 + mozconfig_annotate '' --disable-crashreporter
282 + mozconfig_annotate 'Gentoo default' --with-system-png
283 + mozconfig_annotate '' --enable-system-ffi
284 + mozconfig_annotate '' --disable-gconf
285 + mozconfig_annotate '' --with-intl-api
286 +
287 + # skia has no support for big-endian platforms
288 + if [[ $(tc-endian) == "big" ]]; then
289 + mozconfig_annotate 'big endian target' --disable-skia
290 + else
291 + mozconfig_annotate '' --enable-skia
292 + fi
293 +
294 + # default toolkit is cairo-gtk3, optional use flags can change this
295 + local toolkit="cairo-gtk3"
296 + local toolkit_comment=""
297 + if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
298 + if ! use force-gtk3; then
299 + toolkit="cairo-gtk2"
300 + toolkit_comment="force-gtk3 use flag"
301 + fi
302 + fi
303 + if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
304 + if use gtk2 ; then
305 + toolkit="cairo-gtk2"
306 + else
307 + toolkit_comment="gtk2 use flag"
308 + fi
309 + fi
310 + if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
311 + if use qt5; then
312 + toolkit="cairo-qt"
313 + toolkit_comment="qt5 use flag"
314 + # need to specify these vars because the qt5 versions are not found otherwise,
315 + # and setting --with-qtdir overrides the pkg-config include dirs
316 + local i
317 + for i in qmake moc rcc; do
318 + echo "export HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \
319 + >> "${S}"/.mozconfig || die
320 + done
321 + echo 'unset QTDIR' >> "${S}"/.mozconfig || die
322 + mozconfig_annotate '+qt5' --disable-gio
323 + fi
324 + fi
325 + mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit}
326 +
327 + # Instead of the standard --build= and --host=, mozilla uses --host instead
328 + # of --build, and --target intstead of --host.
329 + # Note, mozilla also has --build but it does not do what you think it does.
330 + # Set both --target and --host as mozilla uses python to guess values otherwise
331 + mozconfig_annotate '' --target="${CHOST}"
332 + mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
333 +
334 + mozconfig_use_enable pulseaudio
335 + # force the deprecated alsa sound code if pulseaudio is disabled
336 + if use kernel_linux && ! use pulseaudio ; then
337 + mozconfig_annotate '-pulseaudio' --enable-alsa
338 + fi
339 +
340 + # For testing purpose only
341 + mozconfig_annotate 'Sandbox' --enable-content-sandbox
342 +
343 + mozconfig_use_enable system-sqlite
344 + mozconfig_use_with system-jpeg
345 + mozconfig_use_with system-icu
346 + mozconfig_use_with system-libvpx
347 + mozconfig_use_with system-harfbuzz
348 + mozconfig_use_with system-harfbuzz system-graphite2
349 +
350 + # Modifications to better support ARM, bug 553364
351 + if use neon ; then
352 + mozconfig_annotate '' --with-fpu=neon
353 + mozconfig_annotate '' --with-thumb=yes
354 + mozconfig_annotate '' --with-thumb-interwork=no
355 + fi
356 + if [[ ${CHOST} == armv* ]] ; then
357 + mozconfig_annotate '' --with-float-abi=hard
358 + if ! use system-libvpx ; then
359 + sed -i -e "s|softfp|hard|" \
360 + "${S}"/media/libvpx/moz.build
361 + fi
362 + fi
363 +}
364 +
365 +# @FUNCTION: mozconfig_install_prefs
366 +# @DESCRIPTION:
367 +# Set preferences into the prefs.js file specified as a parameter to
368 +# the function. This sets both some common prefs to all mozilla
369 +# packages, and any prefs that may relate to the use flags administered
370 +# by mozconfig_config().
371 +#
372 +# Call this within src_install() phase, after copying the template
373 +# prefs file (if any) from ${FILESDIR}
374 +#
375 +# Example:
376 +#
377 +# inherit mozconfig-v6.46
378 +#
379 +# src_install() {
380 +# cp "${FILESDIR}"/gentoo-default-prefs.js \
381 +# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
382 +# || die
383 +#
384 +# mozconfig_install_prefs \
385 +# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
386 +#
387 +# ...
388 +# }
389 +
390 +mozconfig_install_prefs() {
391 + local prefs_file="${1}"
392 +
393 + einfo "Adding prefs from mozconfig to ${prefs_file}"
394 +
395 + # set dictionary path, to use system hunspell
396 + echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
397 + >>"${prefs_file}" || die
398 +
399 + # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
400 + if use system-harfbuzz ; then
401 + echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
402 + >>"${prefs_file}" || die
403 + fi
404 +
405 + # force cairo as the canvas renderer on platforms without skia support
406 + if [[ $(tc-endian) == "big" ]] ; then
407 + echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \
408 + >>"${prefs_file}" || die
409 + echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \
410 + >>"${prefs_file}" || die
411 + fi
412 +}
413
414 diff --git a/www-client/firefox/firefox-57.0_beta10.ebuild b/www-client/firefox/firefox-57.0_beta10.ebuild
415 index 78d87d3..2b887fc 100644
416 --- a/www-client/firefox/firefox-57.0_beta10.ebuild
417 +++ b/www-client/firefox/firefox-57.0_beta10.ebuild
418 @@ -5,6 +5,7 @@ EAPI=6
419 VIRTUALX_REQUIRED="pgo"
420 WANT_AUTOCONF="2.1"
421 MOZ_ESR=""
422 +LLVM_MAX_SLOT="4"
423
424 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
425 MOZ_LANGS=( ach af an ar as ast az bg bn-BD bn-IN br bs ca cak cs cy da de dsb
426 @@ -29,7 +30,8 @@ MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases"
427
428 MOZCONFIG_OPTIONAL_WIFI=1
429
430 -inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.56 pax-utils xdg-utils autotools virtualx mozlinguas-v2
431 +inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.57 pax-utils xdg-utils autotools \
432 + virtualx mozlinguas-v2 llvm
433
434 DESCRIPTION="Firefox Web Browser"
435 HOMEPAGE="http://www.mozilla.com/firefox"
436 @@ -50,16 +52,15 @@ ASM_DEPEND=">=dev-lang/yasm-1.1"
437
438 RDEPEND="
439 jack? ( virtual/jack )
440 - system-sqlite? ( >=dev-db/sqlite-3.20.1:3[secure-delete,debug=] )
441 >=dev-libs/nss-3.33
442 >=dev-libs/nspr-4.17
443 selinux? ( sec-policy/selinux-mozilla )"
444
445 DEPEND="${RDEPEND}
446 pgo? ( >=sys-devel/gcc-4.5 )
447 - >=virtual/rust-1.17.1
448 - >=dev-util/cargo-0.17.1
449 - amd64? ( ${ASM_DEPEND} virtual/opengl )
450 + amd64? ( ${ASM_DEPEND} virtual/opengl
451 + sys-devel/llvm:4
452 + sys-devel/clang:4 )
453 x86? ( ${ASM_DEPEND} virtual/opengl )"
454
455 S="${WORKDIR}/firefox-${MOZ_PV}"
456 @@ -76,6 +77,10 @@ fi
457
458 pkg_setup() {
459 moz_pkgsetup
460 + llvm_pkg_setup
461 + # Build stylo
462 + use amd64 && export BINDGEN_CFLAGS=$(pkg-config --cflags nspr pixman-1 | xargs) \
463 + LLVMCONFIG=$(get_llvm_prefix "$LLVM_MAX_SLOT")/bin/llvm-config
464
465 # Avoid PGO profiling problems due to enviroment leakage
466 # These should *always* be cleaned up anyway