Gentoo Archives: gentoo-commits

From: Ian Stakenvicius <axs@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Fri, 28 Apr 2017 18:20:53
Message-Id: 1493403636.e241901d10ab73f2d4b54ceb9a9b0bc5f9cfffa0.axs@gentoo
1 commit: e241901d10ab73f2d4b54ceb9a9b0bc5f9cfffa0
2 Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 28 14:02:21 2017 +0000
4 Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 28 18:20:36 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e241901d
7
8 mozconfig-6.53.eclass: bump for mozilla53 support (makes cairo-gtk3 default)
9
10 eclass/mozconfig-v6.53.eclass | 388 ++++++++++++++++++++++++++++++++++++++++++
11 1 file changed, 388 insertions(+)
12
13 diff --git a/eclass/mozconfig-v6.53.eclass b/eclass/mozconfig-v6.53.eclass
14 new file mode 100644
15 index 00000000000..9222c7b0d8c
16 --- /dev/null
17 +++ b/eclass/mozconfig-v6.53.eclass
18 @@ -0,0 +1,388 @@
19 +# Copyright 1999-2015 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +#
22 +# @ECLASS: mozconfig-v6.52.eclass
23 +# @MAINTAINER:
24 +# mozilla team <mozilla@g.o>
25 +# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
26 +# @DESCRIPTION:
27 +# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
28 +# to provide a single common place for the common mozilla engine compoments.
29 +#
30 +# The eclass provides all common dependencies as well as common use flags.
31 +#
32 +# Some use flags which may be optional in particular mozilla packages can be
33 +# supported through setting eclass variables.
34 +#
35 +# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
36 +# and so ebuilds inheriting this eclass do not need to inherit that.
37 +
38 +case ${EAPI} in
39 + 0|1|2|3|4)
40 + die "EAPI=${EAPI} not supported"
41 + ;;
42 + 5)
43 + inherit multilib
44 + ;;
45 +esac
46 +
47 +inherit flag-o-matic toolchain-funcs mozcoreconf-v4
48 +
49 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
50 +# @DESCRIPTION:
51 +# Set this variable before the inherit line, when an ebuild needs to provide
52 +# optional necko-wifi support via IUSE="wifi". Currently this would include
53 +# ebuilds for firefox, and potentially seamonkey.
54 +#
55 +# Leave the variable UNSET if necko-wifi support should not be available.
56 +# Set the variable to "enabled" if the use flag should be enabled by default.
57 +# Set the variable to any value if the use flag should exist but not be default-enabled.
58 +
59 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
60 +# @DESCRIPTION:
61 +# Set this variable before the inherit line, when an ebuild needs to provide
62 +# deterministic jit support via IUSE="jit". The upstream default will be used
63 +# otherwise, which is generally to enable jit unless support for the platform
64 +# is missing.
65 +#
66 +# Set the variable to "enabled" if the use flag should be enabled by default.
67 +# Set the variable to any value if the use flag should exist but not be default-enabled.
68 +
69 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
70 +# @DESCRIPTION:
71 +# Set this variable before the inherit line, when an ebuild can provide
72 +# optional gtk3 support via IUSE="force-gtk3". Currently this would include
73 +# thunderbird and seamonkey in the future, once support is ready for testing.
74 +#
75 +# Leave the variable UNSET if gtk3 support should not be optionally available.
76 +# Set the variable to "enabled" if the use flag should be enabled by default.
77 +# Set the variable to any value if the use flag should exist but not be default-enabled.
78 +# If gtk+:3 is to be the standard toolkit, do not use this and instead use
79 +# MOZCONFIG_OPTIONAL_GTK2ONLY.
80 +
81 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY
82 +# @DESCRIPTION:
83 +# Set this variable before the inherit line, when an ebuild can provide
84 +# optional gtk2-only support via IUSE="gtk2".
85 +#
86 +# Note that this option conflicts directly with MOZCONFIG_OPTIONAL_GTK3, both
87 +# variables cannot be set at the same time and this variable will be ignored if
88 +# MOZCONFIG_OPTIONAL_GTK3 is set.
89 +#
90 +# Leave the variable UNSET if gtk2-only support should not be available.
91 +# Set the variable to "enabled" if the use flag should be enabled by default.
92 +# Set the variable to any value if the use flag should exist but not be default-enabled.
93 +
94 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
95 +# @DESCRIPTION:
96 +# Set this variable before the inherit line, when an ebuild can provide
97 +# optional qt5 support via IUSE="qt5". Currently this would include
98 +# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
99 +#
100 +# Leave the variable UNSET if qt5 support should not be available.
101 +# Set the variable to "enabled" if the use flag should be enabled by default.
102 +# Set the variable to any value if the use flag should exist but not be default-enabled.
103 +
104 +# use-flags common among all mozilla ebuilds
105 +IUSE="${IUSE} dbus debug +jemalloc neon pulseaudio selinux startup-notification system-cairo
106 + system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx"
107 +
108 +# some notes on deps:
109 +# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
110 +# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
111 +
112 +RDEPEND=">=app-text/hunspell-1.5.4:=
113 + dev-libs/atk
114 + dev-libs/expat
115 + >=x11-libs/cairo-1.10[X]
116 + >=x11-libs/gtk+-2.18:2
117 + x11-libs/gdk-pixbuf
118 + >=x11-libs/pango-1.22.0
119 + >=media-libs/libpng-1.6.28:0=[apng]
120 + >=media-libs/mesa-10.2:*
121 + media-libs/fontconfig
122 + >=media-libs/freetype-2.4.10
123 + kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
124 + pulseaudio? ( || ( media-sound/pulseaudio
125 + >=media-sound/apulse-0.1.9 ) )
126 + virtual/freedesktop-icon-theme
127 + dbus? ( >=sys-apps/dbus-0.60
128 + >=dev-libs/dbus-glib-0.72 )
129 + startup-notification? ( >=x11-libs/startup-notification-0.8 )
130 + >=dev-libs/glib-2.26:2
131 + >=sys-libs/zlib-1.2.3
132 + >=virtual/libffi-3.0.10
133 + virtual/ffmpeg
134 + x11-libs/libX11
135 + x11-libs/libXcomposite
136 + x11-libs/libXdamage
137 + x11-libs/libXext
138 + x11-libs/libXfixes
139 + x11-libs/libXrender
140 + x11-libs/libXt
141 + system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
142 + system-icu? ( >=dev-libs/icu-58.1:= )
143 + system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
144 + system-libevent? ( >=dev-libs/libevent-2.0:0= )
145 + system-sqlite? ( >=dev-db/sqlite-3.17.0:3[secure-delete,debug=] )
146 + system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
147 + system-harfbuzz? ( >=media-libs/harfbuzz-1.3.3:0= >=media-gfx/graphite2-1.3.9-r1 )
148 +"
149 +
150 +if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
151 + MOZCONFIG_OPTIONAL_GTK2ONLY=
152 + if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
153 + IUSE+=" +force-gtk3"
154 + else
155 + IUSE+=" force-gtk3"
156 + fi
157 + RDEPEND+=" force-gtk3? ( >=x11-libs/gtk+-3.4.0:3 )"
158 +elif [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
159 + if [[ ${MOZCONFIG_OPTIONAL_GTK2ONLY} = "enabled" ]]; then
160 + IUSE+=" +gtk2"
161 + else
162 + IUSE+=" gtk2"
163 + fi
164 + RDEPEND+=" !gtk2? ( >=x11-libs/gtk+-3.4.0:3 )"
165 +else
166 + # no gtk3 related dep set by optional use flags, force it
167 + RDEPEND+=" >=x11-libs/gtk+-3.4.0:3"
168 +fi
169 +if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
170 + if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
171 + IUSE+=" +wifi"
172 + else
173 + IUSE+=" wifi"
174 + fi
175 + RDEPEND+="
176 + wifi? (
177 + kernel_linux? ( >=sys-apps/dbus-0.60
178 + >=dev-libs/dbus-glib-0.72
179 + net-misc/networkmanager )
180 + )"
181 +fi
182 +
183 +DEPEND="app-arch/zip
184 + app-arch/unzip
185 + >=sys-devel/binutils-2.16.1
186 + sys-apps/findutils
187 + pulseaudio? ( media-sound/pulseaudio )
188 + ${RDEPEND}"
189 +
190 +RDEPEND+="
191 + pulseaudio? ( || ( media-sound/pulseaudio
192 + >=media-sound/apulse-0.1.9 ) )
193 + selinux? ( sec-policy/selinux-mozilla )"
194 +
195 +# @FUNCTION: mozconfig_config
196 +# @DESCRIPTION:
197 +# Set common configure options for mozilla packages.
198 +# Call this within src_configure() phase, after mozconfig_init
199 +#
200 +# Example:
201 +#
202 +# inherit mozconfig-v6.46
203 +#
204 +# src_configure() {
205 +# mozconfig_init
206 +# mozconfig_config
207 +# # ... misc ebuild-unique settings via calls to
208 +# # ... mozconfig_{annotate,use_with,use_enable}
209 +# mozconfig_final
210 +# }
211 +
212 +mozconfig_config() {
213 + # Migrated from mozcoreconf-2
214 + mozconfig_annotate 'system_libs' \
215 + --with-system-zlib \
216 + --with-system-bz2
217 +
218 + if has bindist ${IUSE}; then
219 + mozconfig_use_enable !bindist official-branding
220 + if [[ ${PN} == firefox ]] && use bindist ; then
221 + mozconfig_annotate '' --with-branding=browser/branding/aurora
222 + fi
223 + fi
224 +
225 + # Enable position independent executables
226 + mozconfig_annotate 'enabled by Gentoo' --enable-pie
227 + mozconfig_use_enable debug
228 + mozconfig_use_enable debug tests
229 +
230 + if ! use debug ; then
231 + mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
232 + else
233 + mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
234 + fi
235 +
236 + mozconfig_use_enable startup-notification
237 +
238 + if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
239 + # wifi pulls in dbus so manage both here
240 + mozconfig_use_enable wifi necko-wifi
241 + if use kernel_linux && use wifi && ! use dbus; then
242 + echo "Enabling dbus support due to wifi request"
243 + mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus
244 + else
245 + mozconfig_use_enable dbus
246 + fi
247 + else
248 + mozconfig_use_enable dbus
249 + mozconfig_annotate 'disabled' --disable-necko-wifi
250 + fi
251 +
252 + if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
253 + mozconfig_use_enable jit ion
254 + fi
255 +
256 + # These are enabled by default in all mozilla applications
257 + mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
258 + mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
259 + mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
260 + if use system-libevent; then
261 + mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
262 + fi
263 + mozconfig_annotate '' --prefix="${EPREFIX}"/usr
264 + mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
265 + mozconfig_annotate 'Gentoo default' --enable-system-hunspell
266 + mozconfig_annotate '' --disable-gnomeui
267 + mozconfig_annotate '' --enable-gio
268 + mozconfig_annotate '' --disable-crashreporter
269 + mozconfig_annotate 'Gentoo default' --with-system-png
270 + mozconfig_annotate '' --enable-system-ffi
271 + mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
272 + mozconfig_annotate '' --disable-gconf
273 + mozconfig_annotate '' --with-intl-api
274 +
275 + # skia has no support for big-endian platforms
276 + if [[ $(tc-endian) == "big" ]]; then
277 + mozconfig_annotate 'big endian target' --disable-skia
278 + else
279 + mozconfig_annotate '' --enable-skia
280 + fi
281 +
282 + # default toolkit is cairo-gtk3, optional use flags can change this
283 + local toolkit="cairo-gtk3"
284 + local toolkit_comment=""
285 + if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
286 + if ! use force-gtk3; then
287 + toolkit="cairo-gtk2"
288 + toolkit_comment="force-gtk3 use flag"
289 + fi
290 + fi
291 + if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
292 + if use gtk2 ; then
293 + toolkit="cairo-gtk2"
294 + else
295 + toolkit_comment="gtk2 use flag"
296 + fi
297 + fi
298 + if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
299 + if use qt5; then
300 + toolkit="cairo-qt"
301 + toolkit_comment="qt5 use flag"
302 + # need to specify these vars because the qt5 versions are not found otherwise,
303 + # and setting --with-qtdir overrides the pkg-config include dirs
304 + local i
305 + for i in qmake moc rcc; do
306 + echo "export HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \
307 + >> "${S}"/.mozconfig || die
308 + done
309 + echo 'unset QTDIR' >> "${S}"/.mozconfig || die
310 + mozconfig_annotate '+qt5' --disable-gio
311 + fi
312 + fi
313 + mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit}
314 +
315 + # Use jemalloc unless libc is not glibc >= 2.4
316 + # at this time the minimum glibc in the tree is 2.9 so we should be safe.
317 + if use elibc_glibc && use jemalloc; then
318 + # We must force-enable jemalloc 4 via .mozconfig
319 + echo "export MOZ_JEMALLOC4=1" >> "${S}"/.mozconfig || die
320 + mozconfig_annotate '' --enable-replace-malloc
321 + fi
322 +
323 + # Instead of the standard --build= and --host=, mozilla uses --host instead
324 + # of --build, and --target intstead of --host.
325 + # Note, mozilla also has --build but it does not do what you think it does.
326 + # Set both --target and --host as mozilla uses python to guess values otherwise
327 + mozconfig_annotate '' --target="${CHOST}"
328 + mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
329 +
330 + mozconfig_use_enable pulseaudio
331 + # force the deprecated alsa sound code if pulseaudio is disabled
332 + if use kernel_linux && ! use pulseaudio ; then
333 + mozconfig_annotate '-pulseaudio' --enable-alsa
334 + fi
335 +
336 + mozconfig_use_enable system-cairo
337 + mozconfig_use_enable system-sqlite
338 + mozconfig_use_with system-jpeg
339 + mozconfig_use_with system-icu
340 + mozconfig_use_with system-libvpx
341 + mozconfig_use_with system-harfbuzz
342 + mozconfig_use_with system-harfbuzz system-graphite2
343 +
344 + # Modifications to better support ARM, bug 553364
345 + if use neon ; then
346 + mozconfig_annotate '' --with-fpu=neon
347 + mozconfig_annotate '' --with-thumb=yes
348 + mozconfig_annotate '' --with-thumb-interwork=no
349 + fi
350 + if [[ ${CHOST} == armv* ]] ; then
351 + mozconfig_annotate '' --with-float-abi=hard
352 + if ! use system-libvpx ; then
353 + sed -i -e "s|softfp|hard|" \
354 + "${S}"/media/libvpx/moz.build
355 + fi
356 + fi
357 +}
358 +
359 +# @FUNCTION: mozconfig_install_prefs
360 +# @DESCRIPTION:
361 +# Set preferences into the prefs.js file specified as a parameter to
362 +# the function. This sets both some common prefs to all mozilla
363 +# packages, and any prefs that may relate to the use flags administered
364 +# by mozconfig_config().
365 +#
366 +# Call this within src_install() phase, after copying the template
367 +# prefs file (if any) from ${FILESDIR}
368 +#
369 +# Example:
370 +#
371 +# inherit mozconfig-v6.46
372 +#
373 +# src_install() {
374 +# cp "${FILESDIR}"/gentoo-default-prefs.js \
375 +# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
376 +# || die
377 +#
378 +# mozconfig_install_prefs \
379 +# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
380 +#
381 +# ...
382 +# }
383 +
384 +mozconfig_install_prefs() {
385 + local prefs_file="${1}"
386 +
387 + einfo "Adding prefs from mozconfig to ${prefs_file}"
388 +
389 + # set dictionary path, to use system hunspell
390 + echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
391 + >>"${prefs_file}" || die
392 +
393 + # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
394 + if use system-harfbuzz ; then
395 + echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
396 + >>"${prefs_file}" || die
397 + fi
398 +
399 + # force cairo as the canvas renderer on platforms without skia support
400 + if [[ $(tc-endian) == "big" ]] ; then
401 + echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \
402 + >>"${prefs_file}" || die
403 + echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \
404 + >>"${prefs_file}" || die
405 + fi
406 +}