1 |
commit: 7e2c04af9006c16dd640c223ddec2e9705e7894d |
2 |
Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 29 19:23:54 2017 +0000 |
4 |
Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 29 19:49:00 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e2c04af |
7 |
|
8 |
eclass: add mozconfig-v6.56.eclass to support new firefox series |
9 |
|
10 |
eclass/mozconfig-v6.56.eclass | 392 ++++++++++++++++++++++++++++++++++++++++++ |
11 |
1 file changed, 392 insertions(+) |
12 |
|
13 |
diff --git a/eclass/mozconfig-v6.56.eclass b/eclass/mozconfig-v6.56.eclass |
14 |
new file mode 100644 |
15 |
index 00000000000..c0ecf5992b4 |
16 |
--- /dev/null |
17 |
+++ b/eclass/mozconfig-v6.56.eclass |
18 |
@@ -0,0 +1,392 @@ |
19 |
+# Copyright 1999-2017 Gentoo Foundation |
20 |
+# Distributed under the terms of the GNU General Public License v2 |
21 |
+# |
22 |
+# @ECLASS: mozconfig-v6.55.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-v5 |
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 neon pulseaudio selinux startup-notification system-harfbuzz |
106 |
+ 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.31: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 |
+ >=x11-libs/pixman-0.19.2 |
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-icu? ( >=dev-libs/icu-59.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.19.3: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 |
+ # Disable for testing purposes only |
219 |
+ mozconfig_annotate 'Upstream bug 1341234' --disable-stylo |
220 |
+ |
221 |
+ # Must pass release in order to properly select linker via gold useflag |
222 |
+ mozconfig_annotate 'Enable by Gentoo' --enable-release |
223 |
+ |
224 |
+ # Must pass --enable-gold if using ld.gold |
225 |
+ if tc-ld-is-gold ; then |
226 |
+ mozconfig_annotate 'tc-ld-is-gold=true' --enable-gold |
227 |
+ else |
228 |
+ mozconfig_annotate 'tc-ld-is-gold=false' --disable-gold |
229 |
+ fi |
230 |
+ |
231 |
+ if has bindist ${IUSE}; then |
232 |
+ mozconfig_use_enable !bindist official-branding |
233 |
+ if [[ ${PN} == firefox ]] && use bindist ; then |
234 |
+ mozconfig_annotate '' --with-branding=browser/branding/aurora |
235 |
+ fi |
236 |
+ fi |
237 |
+ |
238 |
+ # Enable position independent executables |
239 |
+ mozconfig_annotate 'enabled by Gentoo' --enable-pie |
240 |
+ mozconfig_use_enable debug |
241 |
+ mozconfig_use_enable debug tests |
242 |
+ |
243 |
+ if ! use debug ; then |
244 |
+ mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols |
245 |
+ else |
246 |
+ mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols |
247 |
+ fi |
248 |
+ |
249 |
+ mozconfig_use_enable startup-notification |
250 |
+ |
251 |
+ if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then |
252 |
+ # wifi pulls in dbus so manage both here |
253 |
+ mozconfig_use_enable wifi necko-wifi |
254 |
+ if use kernel_linux && use wifi && ! use dbus; then |
255 |
+ echo "Enabling dbus support due to wifi request" |
256 |
+ mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus |
257 |
+ else |
258 |
+ mozconfig_use_enable dbus |
259 |
+ fi |
260 |
+ else |
261 |
+ mozconfig_use_enable dbus |
262 |
+ mozconfig_annotate 'disabled' --disable-necko-wifi |
263 |
+ fi |
264 |
+ |
265 |
+ if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then |
266 |
+ mozconfig_use_enable jit ion |
267 |
+ fi |
268 |
+ |
269 |
+ # These are enabled by default in all mozilla applications |
270 |
+ mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr |
271 |
+ mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr |
272 |
+ mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir) |
273 |
+ if use system-libevent; then |
274 |
+ mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr |
275 |
+ fi |
276 |
+ mozconfig_annotate '' --prefix="${EPREFIX}"/usr |
277 |
+ mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir) |
278 |
+ mozconfig_annotate 'Gentoo default' --enable-system-hunspell |
279 |
+ mozconfig_annotate '' --disable-crashreporter |
280 |
+ mozconfig_annotate 'Gentoo default' --with-system-png |
281 |
+ mozconfig_annotate '' --enable-system-ffi |
282 |
+ mozconfig_annotate '' --disable-gconf |
283 |
+ mozconfig_annotate '' --with-intl-api |
284 |
+ |
285 |
+ # skia has no support for big-endian platforms |
286 |
+ if [[ $(tc-endian) == "big" ]]; then |
287 |
+ mozconfig_annotate 'big endian target' --disable-skia |
288 |
+ else |
289 |
+ mozconfig_annotate '' --enable-skia |
290 |
+ fi |
291 |
+ |
292 |
+ # default toolkit is cairo-gtk3, optional use flags can change this |
293 |
+ local toolkit="cairo-gtk3" |
294 |
+ local toolkit_comment="" |
295 |
+ if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then |
296 |
+ if ! use force-gtk3; then |
297 |
+ toolkit="cairo-gtk2" |
298 |
+ toolkit_comment="force-gtk3 use flag" |
299 |
+ fi |
300 |
+ fi |
301 |
+ if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then |
302 |
+ if use gtk2 ; then |
303 |
+ toolkit="cairo-gtk2" |
304 |
+ else |
305 |
+ toolkit_comment="gtk2 use flag" |
306 |
+ fi |
307 |
+ fi |
308 |
+ if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then |
309 |
+ if use qt5; then |
310 |
+ toolkit="cairo-qt" |
311 |
+ toolkit_comment="qt5 use flag" |
312 |
+ # need to specify these vars because the qt5 versions are not found otherwise, |
313 |
+ # and setting --with-qtdir overrides the pkg-config include dirs |
314 |
+ local i |
315 |
+ for i in qmake moc rcc; do |
316 |
+ echo "export HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \ |
317 |
+ >> "${S}"/.mozconfig || die |
318 |
+ done |
319 |
+ echo 'unset QTDIR' >> "${S}"/.mozconfig || die |
320 |
+ mozconfig_annotate '+qt5' --disable-gio |
321 |
+ fi |
322 |
+ fi |
323 |
+ mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit} |
324 |
+ |
325 |
+ # Instead of the standard --build= and --host=, mozilla uses --host instead |
326 |
+ # of --build, and --target intstead of --host. |
327 |
+ # Note, mozilla also has --build but it does not do what you think it does. |
328 |
+ # Set both --target and --host as mozilla uses python to guess values otherwise |
329 |
+ mozconfig_annotate '' --target="${CHOST}" |
330 |
+ mozconfig_annotate '' --host="${CBUILD:-${CHOST}}" |
331 |
+ |
332 |
+ mozconfig_use_enable pulseaudio |
333 |
+ # force the deprecated alsa sound code if pulseaudio is disabled |
334 |
+ if use kernel_linux && ! use pulseaudio ; then |
335 |
+ mozconfig_annotate '-pulseaudio' --enable-alsa |
336 |
+ fi |
337 |
+ |
338 |
+ # For testing purpose only |
339 |
+ mozconfig_annotate 'Sandbox' --enable-content-sandbox |
340 |
+ |
341 |
+ mozconfig_use_enable system-sqlite |
342 |
+ mozconfig_use_with system-jpeg |
343 |
+ mozconfig_use_with system-icu |
344 |
+ mozconfig_use_with system-libvpx |
345 |
+ mozconfig_use_with system-harfbuzz |
346 |
+ mozconfig_use_with system-harfbuzz system-graphite2 |
347 |
+ |
348 |
+ # Modifications to better support ARM, bug 553364 |
349 |
+ if use neon ; then |
350 |
+ mozconfig_annotate '' --with-fpu=neon |
351 |
+ mozconfig_annotate '' --with-thumb=yes |
352 |
+ mozconfig_annotate '' --with-thumb-interwork=no |
353 |
+ fi |
354 |
+ if [[ ${CHOST} == armv* ]] ; then |
355 |
+ mozconfig_annotate '' --with-float-abi=hard |
356 |
+ if ! use system-libvpx ; then |
357 |
+ sed -i -e "s|softfp|hard|" \ |
358 |
+ "${S}"/media/libvpx/moz.build |
359 |
+ fi |
360 |
+ fi |
361 |
+} |
362 |
+ |
363 |
+# @FUNCTION: mozconfig_install_prefs |
364 |
+# @DESCRIPTION: |
365 |
+# Set preferences into the prefs.js file specified as a parameter to |
366 |
+# the function. This sets both some common prefs to all mozilla |
367 |
+# packages, and any prefs that may relate to the use flags administered |
368 |
+# by mozconfig_config(). |
369 |
+# |
370 |
+# Call this within src_install() phase, after copying the template |
371 |
+# prefs file (if any) from ${FILESDIR} |
372 |
+# |
373 |
+# Example: |
374 |
+# |
375 |
+# inherit mozconfig-v6.46 |
376 |
+# |
377 |
+# src_install() { |
378 |
+# cp "${FILESDIR}"/gentoo-default-prefs.js \ |
379 |
+# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \ |
380 |
+# || die |
381 |
+# |
382 |
+# mozconfig_install_prefs \ |
383 |
+# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" |
384 |
+# |
385 |
+# ... |
386 |
+# } |
387 |
+ |
388 |
+mozconfig_install_prefs() { |
389 |
+ local prefs_file="${1}" |
390 |
+ |
391 |
+ einfo "Adding prefs from mozconfig to ${prefs_file}" |
392 |
+ |
393 |
+ # set dictionary path, to use system hunspell |
394 |
+ echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \ |
395 |
+ >>"${prefs_file}" || die |
396 |
+ |
397 |
+ # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it |
398 |
+ if use system-harfbuzz ; then |
399 |
+ echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \ |
400 |
+ >>"${prefs_file}" || die |
401 |
+ fi |
402 |
+ |
403 |
+ # force cairo as the canvas renderer on platforms without skia support |
404 |
+ if [[ $(tc-endian) == "big" ]] ; then |
405 |
+ echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \ |
406 |
+ >>"${prefs_file}" || die |
407 |
+ echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \ |
408 |
+ >>"${prefs_file}" || die |
409 |
+ fi |
410 |
+} |