Gentoo Archives: gentoo-commits

From: Ian Stakenvicius <axs@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mozilla:master commit in: eclass/, www-client/firefox/
Date: Wed, 26 Apr 2017 20:30:30
Message-Id: 1493238618.7c968e3cf79024eb6440c3628474ebc8b5401a33.axs@gentoo
1 commit: 7c968e3cf79024eb6440c3628474ebc8b5401a33
2 Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 26 20:30:18 2017 +0000
4 Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 26 20:30:18 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=7c968e3c
7
8 disable cairo-gtk2 toolkit support for 53 and newer via new mozconfig eclass
9
10 eclass/mozconfig-v6.53.eclass | 388 +++++++++++++++++++++++++++++++++
11 www-client/firefox/firefox-53.0.ebuild | 9 +-
12 2 files changed, 389 insertions(+), 8 deletions(-)
13
14 diff --git a/eclass/mozconfig-v6.53.eclass b/eclass/mozconfig-v6.53.eclass
15 new file mode 100644
16 index 0000000..18d5c0f
17 --- /dev/null
18 +++ b/eclass/mozconfig-v6.53.eclass
19 @@ -0,0 +1,388 @@
20 +# Copyright 1999-2015 Gentoo Foundation
21 +# Distributed under the terms of the GNU General Public License v2
22 +#
23 +# @ECLASS: mozconfig-v6.52.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-v4
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 +jemalloc neon pulseaudio selinux startup-notification system-cairo
107 + system-harfbuzz 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.28: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 + >=dev-libs/glib-2.26:2
132 + >=sys-libs/zlib-1.2.3
133 + >=virtual/libffi-3.0.10
134 + virtual/ffmpeg
135 + x11-libs/libX11
136 + x11-libs/libXcomposite
137 + x11-libs/libXdamage
138 + x11-libs/libXext
139 + x11-libs/libXfixes
140 + x11-libs/libXrender
141 + x11-libs/libXt
142 + system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
143 + system-icu? ( >=dev-libs/icu-58.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.17.0: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.8 )
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 + ${RDEPEND}"
190 +
191 +RDEPEND+="
192 + pulseaudio? ( || ( media-sound/pulseaudio
193 + >=media-sound/apulse-0.1.9 ) )
194 + selinux? ( sec-policy/selinux-mozilla )"
195 +
196 +# @FUNCTION: mozconfig_config
197 +# @DESCRIPTION:
198 +# Set common configure options for mozilla packages.
199 +# Call this within src_configure() phase, after mozconfig_init
200 +#
201 +# Example:
202 +#
203 +# inherit mozconfig-v6.46
204 +#
205 +# src_configure() {
206 +# mozconfig_init
207 +# mozconfig_config
208 +# # ... misc ebuild-unique settings via calls to
209 +# # ... mozconfig_{annotate,use_with,use_enable}
210 +# mozconfig_final
211 +# }
212 +
213 +mozconfig_config() {
214 + # Migrated from mozcoreconf-2
215 + mozconfig_annotate 'system_libs' \
216 + --with-system-zlib \
217 + --with-system-bz2
218 +
219 + if has bindist ${IUSE}; then
220 + mozconfig_use_enable !bindist official-branding
221 + if [[ ${PN} == firefox ]] && use bindist ; then
222 + mozconfig_annotate '' --with-branding=browser/branding/aurora
223 + fi
224 + fi
225 +
226 + # Enable position independent executables
227 + mozconfig_annotate 'enabled by Gentoo' --enable-pie
228 + mozconfig_use_enable debug
229 + mozconfig_use_enable debug tests
230 +
231 + if ! use debug ; then
232 + mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
233 + else
234 + mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
235 + fi
236 +
237 + mozconfig_use_enable startup-notification
238 +
239 + if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
240 + # wifi pulls in dbus so manage both here
241 + mozconfig_use_enable wifi necko-wifi
242 + if use kernel_linux && use wifi && ! use dbus; then
243 + echo "Enabling dbus support due to wifi request"
244 + mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus
245 + else
246 + mozconfig_use_enable dbus
247 + fi
248 + else
249 + mozconfig_use_enable dbus
250 + mozconfig_annotate 'disabled' --disable-necko-wifi
251 + fi
252 +
253 + if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
254 + mozconfig_use_enable jit ion
255 + fi
256 +
257 + # These are enabled by default in all mozilla applications
258 + mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
259 + mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
260 + mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
261 + if use system-libevent; then
262 + mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
263 + fi
264 + mozconfig_annotate '' --prefix="${EPREFIX}"/usr
265 + mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
266 + mozconfig_annotate 'Gentoo default' --enable-system-hunspell
267 + mozconfig_annotate '' --disable-gnomeui
268 + mozconfig_annotate '' --enable-gio
269 + mozconfig_annotate '' --disable-crashreporter
270 + mozconfig_annotate 'Gentoo default' --with-system-png
271 + mozconfig_annotate '' --enable-system-ffi
272 + mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
273 + mozconfig_annotate '' --disable-gconf
274 + mozconfig_annotate '' --with-intl-api
275 +
276 + # skia has no support for big-endian platforms
277 + if [[ $(tc-endian) == "big" ]]; then
278 + mozconfig_annotate 'big endian target' --disable-skia
279 + else
280 + mozconfig_annotate '' --enable-skia
281 + fi
282 +
283 + # default toolkit is cairo-gtk3, optional use flags can change this
284 + local toolkit="cairo-gtk3"
285 + local toolkit_comment=""
286 + if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
287 + if ! use force-gtk3; then
288 + toolkit="cairo-gtk2"
289 + toolkit_comment="force-gtk3 use flag"
290 + fi
291 + fi
292 + if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
293 + if use gtk2 ; then
294 + toolkit="cairo-gtk2"
295 + else
296 + toolkit_comment="gtk2 use flag"
297 + fi
298 + fi
299 + if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
300 + if use qt5; then
301 + toolkit="cairo-qt"
302 + toolkit_comment="qt5 use flag"
303 + # need to specify these vars because the qt5 versions are not found otherwise,
304 + # and setting --with-qtdir overrides the pkg-config include dirs
305 + local i
306 + for i in qmake moc rcc; do
307 + echo "export HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \
308 + >> "${S}"/.mozconfig || die
309 + done
310 + echo 'unset QTDIR' >> "${S}"/.mozconfig || die
311 + mozconfig_annotate '+qt5' --disable-gio
312 + fi
313 + fi
314 + mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit}
315 +
316 + # Use jemalloc unless libc is not glibc >= 2.4
317 + # at this time the minimum glibc in the tree is 2.9 so we should be safe.
318 + if use elibc_glibc && use jemalloc; then
319 + # We must force-enable jemalloc 4 via .mozconfig
320 + echo "export MOZ_JEMALLOC4=1" >> "${S}"/.mozconfig || die
321 + mozconfig_annotate '' --enable-replace-malloc
322 + fi
323 +
324 + # Instead of the standard --build= and --host=, mozilla uses --host instead
325 + # of --build, and --target intstead of --host.
326 + # Note, mozilla also has --build but it does not do what you think it does.
327 + # Set both --target and --host as mozilla uses python to guess values otherwise
328 + mozconfig_annotate '' --target="${CHOST}"
329 + mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
330 +
331 + mozconfig_use_enable pulseaudio
332 + # force the deprecated alsa sound code if pulseaudio is disabled
333 + if use kernel_linux && ! use pulseaudio ; then
334 + mozconfig_annotate '-pulseaudio' --enable-alsa
335 + fi
336 +
337 + mozconfig_use_enable system-cairo
338 + mozconfig_use_enable system-sqlite
339 + mozconfig_use_with system-jpeg
340 + mozconfig_use_with system-icu
341 + mozconfig_use_with system-libvpx
342 + mozconfig_use_with system-harfbuzz
343 + mozconfig_use_with system-harfbuzz system-graphite2
344 +
345 + # Modifications to better support ARM, bug 553364
346 + if use neon ; then
347 + mozconfig_annotate '' --with-fpu=neon
348 + mozconfig_annotate '' --with-thumb=yes
349 + mozconfig_annotate '' --with-thumb-interwork=no
350 + fi
351 + if [[ ${CHOST} == armv* ]] ; then
352 + mozconfig_annotate '' --with-float-abi=hard
353 + if ! use system-libvpx ; then
354 + sed -i -e "s|softfp|hard|" \
355 + "${S}"/media/libvpx/moz.build
356 + fi
357 + fi
358 +}
359 +
360 +# @FUNCTION: mozconfig_install_prefs
361 +# @DESCRIPTION:
362 +# Set preferences into the prefs.js file specified as a parameter to
363 +# the function. This sets both some common prefs to all mozilla
364 +# packages, and any prefs that may relate to the use flags administered
365 +# by mozconfig_config().
366 +#
367 +# Call this within src_install() phase, after copying the template
368 +# prefs file (if any) from ${FILESDIR}
369 +#
370 +# Example:
371 +#
372 +# inherit mozconfig-v6.46
373 +#
374 +# src_install() {
375 +# cp "${FILESDIR}"/gentoo-default-prefs.js \
376 +# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
377 +# || die
378 +#
379 +# mozconfig_install_prefs \
380 +# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
381 +#
382 +# ...
383 +# }
384 +
385 +mozconfig_install_prefs() {
386 + local prefs_file="${1}"
387 +
388 + einfo "Adding prefs from mozconfig to ${prefs_file}"
389 +
390 + # set dictionary path, to use system hunspell
391 + echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
392 + >>"${prefs_file}" || die
393 +
394 + # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
395 + if use system-harfbuzz ; then
396 + echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
397 + >>"${prefs_file}" || die
398 + fi
399 +
400 + # force cairo as the canvas renderer on platforms without skia support
401 + if [[ $(tc-endian) == "big" ]] ; then
402 + echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \
403 + >>"${prefs_file}" || die
404 + echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \
405 + >>"${prefs_file}" || die
406 + fi
407 +}
408
409 diff --git a/www-client/firefox/firefox-53.0.ebuild b/www-client/firefox/firefox-53.0.ebuild
410 index 8ac2470..f56c0e0 100644
411 --- a/www-client/firefox/firefox-53.0.ebuild
412 +++ b/www-client/firefox/firefox-53.0.ebuild
413 @@ -27,10 +27,9 @@ fi
414 PATCH="${PN}-53.0-patches-01"
415 MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases"
416
417 -MOZCONFIG_OPTIONAL_GTK2ONLY=1
418 MOZCONFIG_OPTIONAL_WIFI=1
419
420 -inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.52 pax-utils fdo-mime autotools virtualx mozlinguas-v2
421 +inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.53 pax-utils fdo-mime autotools virtualx mozlinguas-v2
422
423 DESCRIPTION="Firefox Web Browser"
424 HOMEPAGE="http://www.mozilla.com/firefox"
425 @@ -55,12 +54,6 @@ RDEPEND="
426 >=dev-libs/nspr-4.13.1
427 selinux? ( sec-policy/selinux-mozilla )"
428
429 -# atoms in mozconfig that need to be newer than what is inherited
430 -RDEPEND+="
431 - >=app-text/hunspell-1.5.4
432 - >=media-libs/libpng-1.6.28
433 -"
434 -
435 DEPEND="${RDEPEND}
436 pgo? ( >=sys-devel/gcc-4.5 )
437 rust? ( dev-lang/rust )