1 |
commit: d5d03e308d5fd02e980314641295fbef792311b0 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 1 10:37:53 2018 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 1 11:32:09 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5d03e30 |
7 |
|
8 |
mail-client/thunderbird: bump sqlite3 FTS3 tokenizer patch |
9 |
|
10 |
Bug: https://bugs.gentoo.org/583156 |
11 |
Closes: https://bugs.gentoo.org/672316 |
12 |
Package-Manager: Portage-2.3.52, Repoman-2.3.12 |
13 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
14 |
|
15 |
.../thunderbird-60-sqlite3-fts3-tokenizer.patch | 86 ++++ |
16 |
.../thunderbird/thunderbird-60.3.2-r1.ebuild | 555 +++++++++++++++++++++ |
17 |
2 files changed, 641 insertions(+) |
18 |
|
19 |
diff --git a/mail-client/thunderbird/files/thunderbird-60-sqlite3-fts3-tokenizer.patch b/mail-client/thunderbird/files/thunderbird-60-sqlite3-fts3-tokenizer.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..2909c6cf476 |
22 |
--- /dev/null |
23 |
+++ b/mail-client/thunderbird/files/thunderbird-60-sqlite3-fts3-tokenizer.patch |
24 |
@@ -0,0 +1,86 @@ |
25 |
+# HG changeset patch |
26 |
+# User Arfrever Frehtes Taifersar Arahesis <Arfrever@××××××.Org> |
27 |
+# Date 1543532530 0 |
28 |
+# Thu Nov 29 23:02:10 2018 +0000 |
29 |
+# Node ID 1c480085935783bd1d240860bb44f410e2d36322 |
30 |
+# Parent 6453222232be364fb8ce3fd29b6cbcd480e5f2e3 |
31 |
+Bug 1270882 - Enable support for SQLite custom FTS3 tokenizers at run time. |
32 |
+ |
33 |
+Do not require that SQLite has been built with support for custom FTS3 |
34 |
+tokenizers enabled by default. This allows to use system SQLite in |
35 |
+distributions which provide SQLite configured in this way (which is SQLite |
36 |
+upstream's default configuration due to security concerns). |
37 |
+ |
38 |
+Disable no longer needed setting of SQLITE_ENABLE_FTS3_TOKENIZER macro in |
39 |
+bundled SQLite build. |
40 |
+ |
41 |
+diff -r 6453222232be -r 1c4800859357 db/sqlite3/src/moz.build |
42 |
+--- a/db/sqlite3/src/moz.build Thu Nov 29 19:08:28 2018 +0000 |
43 |
++++ b/db/sqlite3/src/moz.build Thu Nov 29 23:02:10 2018 +0000 |
44 |
+@@ -58,10 +58,6 @@ |
45 |
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': |
46 |
+ DEFINES['SQLITE_ENABLE_LOCKING_STYLE'] = 0 |
47 |
+ |
48 |
+-# Thunderbird needs the 2-argument version of fts3_tokenizer() |
49 |
+-if CONFIG['MOZ_THUNDERBIRD'] or CONFIG['MOZ_SUITE']: |
50 |
+- DEFINES['SQLITE_ENABLE_FTS3_TOKENIZER'] = 1 |
51 |
+- |
52 |
+ # Turn on SQLite's assertions in debug builds. |
53 |
+ if CONFIG['MOZ_DEBUG']: |
54 |
+ DEFINES['SQLITE_DEBUG'] = 1 |
55 |
+diff -r 6453222232be -r 1c4800859357 db/sqlite3/src/sqlite.symbols |
56 |
+--- a/db/sqlite3/src/sqlite.symbols Thu Nov 29 19:08:28 2018 +0000 |
57 |
++++ b/db/sqlite3/src/sqlite.symbols Thu Nov 29 23:02:10 2018 +0000 |
58 |
+@@ -45,6 +45,7 @@ |
59 |
+ sqlite3_create_function16 |
60 |
+ sqlite3_create_module |
61 |
+ sqlite3_data_count |
62 |
++sqlite3_db_config |
63 |
+ sqlite3_db_filename |
64 |
+ sqlite3_db_handle |
65 |
+ sqlite3_db_mutex |
66 |
+diff -r 6453222232be -r 1c4800859357 storage/mozStorageConnection.cpp |
67 |
+--- a/storage/mozStorageConnection.cpp Thu Nov 29 19:08:28 2018 +0000 |
68 |
++++ b/storage/mozStorageConnection.cpp Thu Nov 29 23:02:10 2018 +0000 |
69 |
+@@ -679,6 +679,13 @@ |
70 |
+ return convertResultCode(srv); |
71 |
+ } |
72 |
+ |
73 |
++#if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) |
74 |
++ // Thunderbird needs support for custom FTS3 tokenizers |
75 |
++ // (used by the 2-argument version of fts3_tokenizer() function). |
76 |
++ // https://sqlite.org/fts3.html#custom_application_defined_tokenizers |
77 |
++ ::sqlite3_db_config(mDBConn, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, 0); |
78 |
++#endif |
79 |
++ |
80 |
+ // Do not set mDatabaseFile or mFileURL here since this is a "memory" |
81 |
+ // database. |
82 |
+ |
83 |
+@@ -715,6 +722,13 @@ |
84 |
+ return convertResultCode(srv); |
85 |
+ } |
86 |
+ |
87 |
++#if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) |
88 |
++ // Thunderbird needs support for custom FTS3 tokenizers |
89 |
++ // (used by the 2-argument version of fts3_tokenizer() function). |
90 |
++ // https://sqlite.org/fts3.html#custom_application_defined_tokenizers |
91 |
++ ::sqlite3_db_config(mDBConn, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, 0); |
92 |
++#endif |
93 |
++ |
94 |
+ // Do not set mFileURL here since this is database does not have an associated |
95 |
+ // URL. |
96 |
+ mDatabaseFile = aDatabaseFile; |
97 |
+@@ -746,6 +760,13 @@ |
98 |
+ return convertResultCode(srv); |
99 |
+ } |
100 |
+ |
101 |
++#if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) |
102 |
++ // Thunderbird needs support for custom FTS3 tokenizers |
103 |
++ // (used by the 2-argument version of fts3_tokenizer() function). |
104 |
++ // https://sqlite.org/fts3.html#custom_application_defined_tokenizers |
105 |
++ ::sqlite3_db_config(mDBConn, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, 0); |
106 |
++#endif |
107 |
++ |
108 |
+ // Set both mDatabaseFile and mFileURL here. |
109 |
+ mFileURL = aFileURL; |
110 |
+ mDatabaseFile = databaseFile; |
111 |
|
112 |
diff --git a/mail-client/thunderbird/thunderbird-60.3.2-r1.ebuild b/mail-client/thunderbird/thunderbird-60.3.2-r1.ebuild |
113 |
new file mode 100644 |
114 |
index 00000000000..b50bc9259df |
115 |
--- /dev/null |
116 |
+++ b/mail-client/thunderbird/thunderbird-60.3.2-r1.ebuild |
117 |
@@ -0,0 +1,555 @@ |
118 |
+# Copyright 1999-2018 Gentoo Authors |
119 |
+# Distributed under the terms of the GNU General Public License v2 |
120 |
+ |
121 |
+EAPI=6 |
122 |
+VIRTUALX_REQUIRED="pgo" |
123 |
+WANT_AUTOCONF="2.1" |
124 |
+MOZ_ESR="" |
125 |
+MOZ_LIGHTNING_VER="6.2.2.1" |
126 |
+MOZ_LIGHTNING_GDATA_VER="4.4.1" |
127 |
+ |
128 |
+PYTHON_COMPAT=( python3_{5,6,7} ) |
129 |
+PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)' |
130 |
+ |
131 |
+# This list can be updated using scripts/get_langs.sh from the mozilla overlay |
132 |
+MOZ_LANGS=(ar ast be bg br ca cs cy da de el en en-GB en-US es-AR |
133 |
+es-ES et eu fi fr fy-NL ga-IE gd gl he hr hsb hu hy-AM id is it ja ko lt |
134 |
+nb-NO nl nn-NO pl pt-BR pt-PT rm ro ru si sk sl sq sr sv-SE tr |
135 |
+uk vi zh-CN zh-TW ) |
136 |
+ |
137 |
+# Convert the ebuild version to the upstream mozilla version, used by mozlinguas |
138 |
+MOZ_PV="${PV/_beta/b}" |
139 |
+ |
140 |
+# Patches |
141 |
+PATCHTB="thunderbird-60.0-patches-0" |
142 |
+PATCHFF="firefox-60.0-patches-04" |
143 |
+ |
144 |
+MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases" |
145 |
+ |
146 |
+# ESR releases have slightly version numbers |
147 |
+if [[ ${MOZ_ESR} == 1 ]]; then |
148 |
+ MOZ_PV="${MOZ_PV}esr" |
149 |
+fi |
150 |
+MOZ_P="${PN}-${MOZ_PV}" |
151 |
+ |
152 |
+inherit check-reqs flag-o-matic toolchain-funcs gnome2-utils llvm mozcoreconf-v6 pax-utils xdg-utils autotools mozlinguas-v2 |
153 |
+ |
154 |
+DESCRIPTION="Thunderbird Mail Client" |
155 |
+HOMEPAGE="https://www.mozilla.org/thunderbird" |
156 |
+ |
157 |
+KEYWORDS="~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" |
158 |
+SLOT="0" |
159 |
+LICENSE="MPL-2.0 GPL-2 LGPL-2.1" |
160 |
+IUSE="bindist clang dbus debug hardened jack lightning neon pulseaudio |
161 |
+ selinux startup-notification system-harfbuzz system-icu system-jpeg |
162 |
+ system-libevent system-libvpx system-sqlite wifi" |
163 |
+RESTRICT="!bindist? ( bindist )" |
164 |
+ |
165 |
+PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c,whissi}/mozilla/patchsets/{${PATCHTB},${PATCHFF}}.tar.xz ) |
166 |
+SRC_URI="${SRC_URI} |
167 |
+ ${MOZ_HTTP_URI}/${MOZ_PV}/source/${MOZ_P}.source.tar.xz |
168 |
+ https://dev.gentoo.org/~axs/distfiles/lightning-${MOZ_LIGHTNING_VER}.tar.xz |
169 |
+ lightning? ( https://dev.gentoo.org/~axs/distfiles/gdata-provider-${MOZ_LIGHTNING_GDATA_VER}.tar.xz ) |
170 |
+ ${PATCH_URIS[@]}" |
171 |
+ |
172 |
+ASM_DEPEND=">=dev-lang/yasm-1.1" |
173 |
+ |
174 |
+CDEPEND=" |
175 |
+ >=dev-libs/nss-3.36.4 |
176 |
+ >=dev-libs/nspr-4.19 |
177 |
+ >=app-text/hunspell-1.5.4:= |
178 |
+ dev-libs/atk |
179 |
+ dev-libs/expat |
180 |
+ >=x11-libs/cairo-1.10[X] |
181 |
+ >=x11-libs/gtk+-2.18:2 |
182 |
+ >=x11-libs/gtk+-3.4.0:3 |
183 |
+ x11-libs/gdk-pixbuf |
184 |
+ >=x11-libs/pango-1.22.0 |
185 |
+ >=media-libs/libpng-1.6.34:0=[apng] |
186 |
+ >=media-libs/mesa-10.2:* |
187 |
+ media-libs/fontconfig |
188 |
+ >=media-libs/freetype-2.4.10 |
189 |
+ kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) ) |
190 |
+ virtual/freedesktop-icon-theme |
191 |
+ dbus? ( |
192 |
+ >=sys-apps/dbus-0.60 |
193 |
+ >=dev-libs/dbus-glib-0.72 |
194 |
+ ) |
195 |
+ startup-notification? ( >=x11-libs/startup-notification-0.8 ) |
196 |
+ >=x11-libs/pixman-0.19.2 |
197 |
+ >=dev-libs/glib-2.26:2 |
198 |
+ >=sys-libs/zlib-1.2.3 |
199 |
+ >=virtual/libffi-3.0.10:= |
200 |
+ virtual/ffmpeg |
201 |
+ x11-libs/libX11 |
202 |
+ x11-libs/libXcomposite |
203 |
+ x11-libs/libXdamage |
204 |
+ x11-libs/libXext |
205 |
+ x11-libs/libXfixes |
206 |
+ x11-libs/libXrender |
207 |
+ x11-libs/libXt |
208 |
+ system-harfbuzz? ( |
209 |
+ >=media-libs/harfbuzz-1.4.2:0= |
210 |
+ >=media-gfx/graphite2-1.3.9-r1 |
211 |
+ ) |
212 |
+ system-icu? ( >=dev-libs/icu-59.1:= ) |
213 |
+ system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1:= ) |
214 |
+ system-libevent? ( >=dev-libs/libevent-2.0:0= ) |
215 |
+ system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] ) |
216 |
+ system-sqlite? ( >=dev-db/sqlite-3.23.1:3[secure-delete,debug=] ) |
217 |
+ wifi? ( |
218 |
+ kernel_linux? ( |
219 |
+ >=sys-apps/dbus-0.60 |
220 |
+ >=dev-libs/dbus-glib-0.72 |
221 |
+ net-misc/networkmanager |
222 |
+ ) |
223 |
+ ) |
224 |
+ jack? ( virtual/jack )" |
225 |
+ |
226 |
+DEPEND="${CDEPEND} |
227 |
+ app-arch/zip |
228 |
+ app-arch/unzip |
229 |
+ >=sys-devel/binutils-2.30 |
230 |
+ sys-apps/findutils |
231 |
+ >=sys-devel/llvm-4.0.1 |
232 |
+ >=sys-devel/clang-4.0.1 |
233 |
+ clang? ( |
234 |
+ >=sys-devel/llvm-4.0.1[gold] |
235 |
+ >=sys-devel/lld-4.0.1 |
236 |
+ ) |
237 |
+ pulseaudio? ( media-sound/pulseaudio ) |
238 |
+ elibc_glibc? ( |
239 |
+ virtual/cargo |
240 |
+ virtual/rust |
241 |
+ ) |
242 |
+ elibc_musl? ( |
243 |
+ virtual/cargo |
244 |
+ virtual/rust |
245 |
+ ) |
246 |
+ amd64? ( |
247 |
+ ${ASM_DEPEND} |
248 |
+ virtual/opengl |
249 |
+ ) |
250 |
+ x86? ( |
251 |
+ ${ASM_DEPEND} |
252 |
+ virtual/opengl |
253 |
+ )" |
254 |
+ |
255 |
+RDEPEND="${CDEPEND} |
256 |
+ pulseaudio? ( |
257 |
+ || ( |
258 |
+ media-sound/pulseaudio |
259 |
+ >=media-sound/apulse-0.1.9 |
260 |
+ ) |
261 |
+ ) |
262 |
+ selinux? ( |
263 |
+ sec-policy/selinux-mozilla |
264 |
+ sec-policy/selinux-thunderbird |
265 |
+ )" |
266 |
+ |
267 |
+REQUIRED_USE="wifi? ( dbus )" |
268 |
+ |
269 |
+S="${WORKDIR}/${MOZ_P%b[0-9]*}" |
270 |
+ |
271 |
+BUILD_OBJ_DIR="${S}/tbird" |
272 |
+ |
273 |
+pkg_setup() { |
274 |
+ moz_pkgsetup |
275 |
+ |
276 |
+ # Avoid PGO profiling problems due to enviroment leakage |
277 |
+ # These should *always* be cleaned up anyway |
278 |
+ unset DBUS_SESSION_BUS_ADDRESS \ |
279 |
+ DISPLAY \ |
280 |
+ ORBIT_SOCKETDIR \ |
281 |
+ SESSION_MANAGER \ |
282 |
+ XDG_SESSION_COOKIE \ |
283 |
+ XAUTHORITY |
284 |
+ |
285 |
+ if ! use bindist ; then |
286 |
+ elog "You are enabling official branding. You may not redistribute this build" |
287 |
+ elog "to any users on your network or the internet. Doing so puts yourself into" |
288 |
+ elog "a legal problem with Mozilla Foundation" |
289 |
+ elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag" |
290 |
+ elog |
291 |
+ fi |
292 |
+ |
293 |
+ addpredict /proc/self/oom_score_adj |
294 |
+ |
295 |
+ llvm_pkg_setup |
296 |
+} |
297 |
+ |
298 |
+pkg_pretend() { |
299 |
+ # Ensure we have enough disk space to compile |
300 |
+ CHECKREQS_DISK_BUILD="4G" |
301 |
+ check-reqs_pkg_setup |
302 |
+} |
303 |
+ |
304 |
+src_unpack() { |
305 |
+ unpack ${A} |
306 |
+ |
307 |
+ # Unpack language packs |
308 |
+ mozlinguas_src_unpack |
309 |
+} |
310 |
+ |
311 |
+src_prepare() { |
312 |
+ # Apply our patchset from firefox to thunderbird as well |
313 |
+ rm -f "${WORKDIR}"/firefox/2007_fix_nvidia_latest.patch \ |
314 |
+ "${WORKDIR}"/firefox/2005_ffmpeg4.patch \ |
315 |
+ "${WORKDIR}"/firefox/2012_update-cc-to-honor-CC.patch \ |
316 |
+ || die |
317 |
+ eapply "${WORKDIR}/firefox" |
318 |
+ |
319 |
+ eapply "${FILESDIR}"/thunderbird-60-sqlite3-fts3-tokenizer.patch |
320 |
+ |
321 |
+ # Ensure that are plugins dir is enabled as default |
322 |
+ sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \ |
323 |
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!" |
324 |
+ sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \ |
325 |
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!" |
326 |
+ |
327 |
+ # Don't error out when there's no files to be removed: |
328 |
+ sed 's@\(xargs rm\)$@\1 -f@' \ |
329 |
+ -i "${S}"/toolkit/mozapps/installer/packager.mk || die |
330 |
+ |
331 |
+ # Don't exit with error when some libs are missing which we have in |
332 |
+ # system. |
333 |
+ sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \ |
334 |
+ -i "${S}"/comm/mail/installer/Makefile.in || die |
335 |
+ |
336 |
+ # Apply our Thunderbird patchset |
337 |
+ pushd "${S}"/comm &>/dev/null || die |
338 |
+ eapply "${WORKDIR}"/thunderbird |
339 |
+ |
340 |
+ # NOT TRIGGERED starting with 60.3, as script just maps ${PV} without any actual |
341 |
+ # check on lightning version or changes: |
342 |
+ # |
343 |
+ # Confirm the version of lightning being grabbed for langpacks is the same |
344 |
+ # as that used in thunderbird |
345 |
+ #local THIS_MOZ_LIGHTNING_VER=$(${PYTHON} calendar/lightning/build/makeversion.py ${PV}) |
346 |
+ #if [[ ${MOZ_LIGHTNING_VER} != ${THIS_MOZ_LIGHTNING_VER} ]]; then |
347 |
+ # eqawarn "The version of lightning used for localization differs from the version" |
348 |
+ # eqawarn "in thunderbird. Please update MOZ_LIGHTNING_VER in the ebuild from ${MOZ_LIGHTNING_VER}" |
349 |
+ # eqawarn "to ${THIS_MOZ_LIGHTNING_VER}" |
350 |
+ #fi |
351 |
+ |
352 |
+ popd &>/dev/null || die |
353 |
+ |
354 |
+ # Allow user to apply any additional patches without modifing ebuild |
355 |
+ eapply_user |
356 |
+ |
357 |
+ # Autotools configure is now called old-configure.in |
358 |
+ # This works because there is still a configure.in that happens to be for the |
359 |
+ # shell wrapper configure script |
360 |
+ eautoreconf old-configure.in |
361 |
+ |
362 |
+ # Must run autoconf in js/src |
363 |
+ cd "${S}"/js/src || die |
364 |
+ eautoconf old-configure.in |
365 |
+} |
366 |
+ |
367 |
+src_configure() { |
368 |
+ # Add information about TERM to output (build.log) to aid debugging |
369 |
+ # blessings problems |
370 |
+ if [[ -n "${TERM}" ]] ; then |
371 |
+ einfo "TERM is set to: \"${TERM}\"" |
372 |
+ else |
373 |
+ einfo "TERM is unset." |
374 |
+ fi |
375 |
+ |
376 |
+ if use clang && ! tc-is-clang ; then |
377 |
+ # Force clang |
378 |
+ einfo "Enforcing the use of clang due to USE=clang ..." |
379 |
+ CC=${CHOST}-clang |
380 |
+ CXX=${CHOST}-clang++ |
381 |
+ strip-unsupported-flags |
382 |
+ elif ! use clang && ! tc-is-gcc ; then |
383 |
+ # Force gcc |
384 |
+ einfo "Enforcing the use of gcc due to USE=-clang ..." |
385 |
+ CC=${CHOST}-gcc |
386 |
+ CXX=${CHOST}-g++ |
387 |
+ strip-unsupported-flags |
388 |
+ fi |
389 |
+ |
390 |
+ #################################### |
391 |
+ # |
392 |
+ # mozconfig, CFLAGS and CXXFLAGS setup |
393 |
+ # |
394 |
+ #################################### |
395 |
+ |
396 |
+ mozconfig_init |
397 |
+ # common config components |
398 |
+ mozconfig_annotate 'system_libs' \ |
399 |
+ --with-system-zlib \ |
400 |
+ --with-system-bz2 |
401 |
+ |
402 |
+ # Must pass release in order to properly select linker |
403 |
+ mozconfig_annotate 'Enable by Gentoo' --enable-release |
404 |
+ |
405 |
+ # Avoid auto-magic on linker |
406 |
+ if use clang ; then |
407 |
+ # This is upstream's default |
408 |
+ mozconfig_annotate "forcing ld=lld due to USE=clang" --enable-linker=lld |
409 |
+ elif tc-ld-is-gold ; then |
410 |
+ mozconfig_annotate "linker is set to gold" --enable-linker=gold |
411 |
+ else |
412 |
+ mozconfig_annotate "linker is set to bfd" --enable-linker=bfd |
413 |
+ fi |
414 |
+ |
415 |
+ # It doesn't compile on alpha without this LDFLAGS |
416 |
+ use alpha && append-ldflags "-Wl,--no-relax" |
417 |
+ |
418 |
+ # Add full relro support for hardened |
419 |
+ if use hardened; then |
420 |
+ append-ldflags "-Wl,-z,relro,-z,now" |
421 |
+ mozconfig_use_enable hardened hardening |
422 |
+ fi |
423 |
+ |
424 |
+ # Modifications to better support ARM, bug 553364 |
425 |
+ if use neon ; then |
426 |
+ mozconfig_annotate '' --with-fpu=neon |
427 |
+ |
428 |
+ if ! tc-is-clang ; then |
429 |
+ # thumb options aren't supported when using clang, bug 666966 |
430 |
+ mozconfig_annotate '' --with-thumb=yes |
431 |
+ mozconfig_annotate '' --with-thumb-interwork=no |
432 |
+ fi |
433 |
+ fi |
434 |
+ if [[ ${CHOST} == armv*h* ]] ; then |
435 |
+ mozconfig_annotate '' --with-float-abi=hard |
436 |
+ if ! use system-libvpx ; then |
437 |
+ sed -i -e "s|softfp|hard|" \ |
438 |
+ "${S}"/media/libvpx/moz.build |
439 |
+ fi |
440 |
+ fi |
441 |
+ |
442 |
+ mozconfig_use_enable !bindist official-branding |
443 |
+ # Enable position independent executables |
444 |
+ mozconfig_annotate 'enabled by Gentoo' --enable-pie |
445 |
+ |
446 |
+ mozconfig_use_enable debug |
447 |
+ mozconfig_use_enable debug tests |
448 |
+ if ! use debug ; then |
449 |
+ mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols |
450 |
+ else |
451 |
+ mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols |
452 |
+ fi |
453 |
+ # These are enabled by default in all mozilla applications |
454 |
+ mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr |
455 |
+ mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr |
456 |
+ mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include \ |
457 |
+ --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir) |
458 |
+ mozconfig_annotate '' --prefix="${EPREFIX}"/usr |
459 |
+ mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir) |
460 |
+ mozconfig_annotate 'Gentoo default' --enable-system-hunspell |
461 |
+ mozconfig_annotate '' --disable-crashreporter |
462 |
+ mozconfig_annotate 'Gentoo default' --with-system-png |
463 |
+ mozconfig_annotate '' --enable-system-ffi |
464 |
+ mozconfig_annotate '' --disable-gconf |
465 |
+ mozconfig_annotate '' --with-intl-api |
466 |
+ mozconfig_annotate '' --enable-system-pixman |
467 |
+ # Instead of the standard --build= and --host=, mozilla uses --host instead |
468 |
+ # of --build, and --target intstead of --host. |
469 |
+ # Note, mozilla also has --build but it does not do what you think it does. |
470 |
+ # Set both --target and --host as mozilla uses python to guess values otherwise |
471 |
+ mozconfig_annotate '' --target="${CHOST}" |
472 |
+ mozconfig_annotate '' --host="${CBUILD:-${CHOST}}" |
473 |
+ if use system-libevent; then |
474 |
+ mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr |
475 |
+ fi |
476 |
+ |
477 |
+ # skia has no support for big-endian platforms |
478 |
+ if [[ $(tc-endian) == "big" ]]; then |
479 |
+ mozconfig_annotate 'big endian target' --disable-skia |
480 |
+ else |
481 |
+ mozconfig_annotate '' --enable-skia |
482 |
+ fi |
483 |
+ |
484 |
+ # use the gtk3 toolkit (the only one supported at this point) |
485 |
+ mozconfig_annotate '' --enable-default-toolkit=cairo-gtk3 |
486 |
+ |
487 |
+ mozconfig_use_enable startup-notification |
488 |
+ mozconfig_use_enable system-sqlite |
489 |
+ mozconfig_use_with system-jpeg |
490 |
+ mozconfig_use_with system-icu |
491 |
+ mozconfig_use_with system-libvpx |
492 |
+ mozconfig_use_with system-harfbuzz |
493 |
+ mozconfig_use_with system-harfbuzz system-graphite2 |
494 |
+ mozconfig_use_enable pulseaudio |
495 |
+ # force the deprecated alsa sound code if pulseaudio is disabled |
496 |
+ if use kernel_linux && ! use pulseaudio ; then |
497 |
+ mozconfig_annotate '-pulseaudio' --enable-alsa |
498 |
+ fi |
499 |
+ |
500 |
+ mozconfig_use_enable dbus |
501 |
+ |
502 |
+ mozconfig_use_enable wifi necko-wifi |
503 |
+ |
504 |
+ # enable JACK, bug 600002 |
505 |
+ mozconfig_use_enable jack |
506 |
+ |
507 |
+ # Other tb-specific settings |
508 |
+ mozconfig_annotate '' --with-user-appdir=.thunderbird |
509 |
+ mozconfig_annotate '' --enable-ldap |
510 |
+ mozconfig_annotate '' --enable-calendar |
511 |
+ |
512 |
+ # Disable built-in ccache support to avoid sandbox violation, #665420 |
513 |
+ # Use FEATURES=ccache instead! |
514 |
+ mozconfig_annotate '' --without-ccache |
515 |
+ sed -i -e 's/ccache_stats = None/return None/' \ |
516 |
+ python/mozbuild/mozbuild/controller/building.py || \ |
517 |
+ die "Failed to disable ccache stats call" |
518 |
+ |
519 |
+ # Stylo is only broken on x86 builds |
520 |
+ use x86 && mozconfig_annotate 'Upstream bug 1341234' --disable-stylo |
521 |
+ |
522 |
+ # Stylo is horribly broken on arm, renders GUI unusable |
523 |
+ use arm && mozconfig_annotate 'breaks UI on arm' --disable-stylo |
524 |
+ |
525 |
+ if use clang ; then |
526 |
+ # libprldap60.so: terminate called after throwing an instance of 'std::runtime_error', bug 667186 |
527 |
+ mozconfig_annotate 'elf-hack is broken when using clang' --disable-elf-hack |
528 |
+ elif use arm ; then |
529 |
+ mozconfig_annotate 'elf-hack is broken on arm' --disable-elf-hack |
530 |
+ fi |
531 |
+ |
532 |
+ # Use an objdir to keep things organized. |
533 |
+ echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig |
534 |
+ echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig |
535 |
+ |
536 |
+ mozlinguas_mozconfig |
537 |
+ |
538 |
+ # Finalize and report settings |
539 |
+ mozconfig_final |
540 |
+ |
541 |
+ #################################### |
542 |
+ # |
543 |
+ # Configure and build |
544 |
+ # |
545 |
+ #################################### |
546 |
+ |
547 |
+ # Disable no-print-directory |
548 |
+ MAKEOPTS=${MAKEOPTS/--no-print-directory/} |
549 |
+ |
550 |
+ if [[ $(gcc-major-version) -lt 4 ]]; then |
551 |
+ append-cxxflags -fno-stack-protector |
552 |
+ fi |
553 |
+ |
554 |
+ # workaround for funky/broken upstream configure... |
555 |
+ SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \ |
556 |
+ ./mach configure || die |
557 |
+} |
558 |
+ |
559 |
+src_compile() { |
560 |
+ MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \ |
561 |
+ ./mach build --verbose || die |
562 |
+} |
563 |
+ |
564 |
+src_install() { |
565 |
+ declare emid |
566 |
+ cd "${BUILD_OBJ_DIR}" || die |
567 |
+ |
568 |
+ # Pax mark xpcshell for hardened support, only used for startupcache creation. |
569 |
+ pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell |
570 |
+ |
571 |
+ # Copy our preference before omnijar is created. |
572 |
+ cp "${FILESDIR}"/thunderbird-gentoo-default-prefs.js-2 \ |
573 |
+ "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \ |
574 |
+ || die |
575 |
+ |
576 |
+ # set dictionary path, to use system hunspell |
577 |
+ echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \ |
578 |
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die |
579 |
+ |
580 |
+ # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it |
581 |
+ if use system-harfbuzz ; then |
582 |
+ echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \ |
583 |
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die |
584 |
+ fi |
585 |
+ |
586 |
+ # force cairo as the canvas renderer on platforms without skia support |
587 |
+ if [[ $(tc-endian) == "big" ]] ; then |
588 |
+ echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \ |
589 |
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die |
590 |
+ echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \ |
591 |
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die |
592 |
+ fi |
593 |
+ |
594 |
+ cd "${S}" || die |
595 |
+ MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \ |
596 |
+ DESTDIR="${D}" ./mach install || die |
597 |
+ |
598 |
+ # Install language packs |
599 |
+ MOZ_INSTALL_L10N_XPIFILE="1" mozlinguas_src_install |
600 |
+ |
601 |
+ local size sizes icon_path icon |
602 |
+ if ! use bindist; then |
603 |
+ icon_path="${S}/comm/mail/branding/thunderbird" |
604 |
+ icon="${PN}-icon" |
605 |
+ |
606 |
+ domenu "${FILESDIR}"/icon/${PN}.desktop |
607 |
+ else |
608 |
+ icon_path="${S}/comm/mail/branding/nightly" |
609 |
+ icon="${PN}-icon-unbranded" |
610 |
+ |
611 |
+ newmenu "${FILESDIR}"/icon/${PN}-unbranded.desktop \ |
612 |
+ ${PN}.desktop |
613 |
+ |
614 |
+ sed -i -e "s:Mozilla\ Thunderbird:EarlyBird:g" \ |
615 |
+ "${ED}"/usr/share/applications/${PN}.desktop |
616 |
+ fi |
617 |
+ |
618 |
+ # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs |
619 |
+ newicon "${icon_path}"/default48.png "${icon}".png |
620 |
+ # Install icons for menu entry |
621 |
+ sizes="16 22 24 32 48 256" |
622 |
+ for size in ${sizes}; do |
623 |
+ newicon -s ${size} "${icon_path}/default${size}.png" "${icon}.png" |
624 |
+ done |
625 |
+ |
626 |
+ local emid |
627 |
+ # stage extra locales for lightning and install over existing |
628 |
+ emid='{e2fda1a4-762b-4020-b5ad-a41df1933103}' |
629 |
+ rm -f "${ED}"/${MOZILLA_FIVE_HOME}/distribution/extensions/${emid}.xpi || die |
630 |
+ mozlinguas_xpistage_langpacks "${BUILD_OBJ_DIR}"/dist/bin/distribution/extensions/${emid} \ |
631 |
+ "${WORKDIR}"/lightning-${MOZ_LIGHTNING_VER} lightning calendar |
632 |
+ |
633 |
+ mkdir -p "${T}/${emid}" || die |
634 |
+ cp -RLp -t "${T}/${emid}" "${BUILD_OBJ_DIR}"/dist/bin/distribution/extensions/${emid}/* || die |
635 |
+ insinto ${MOZILLA_FIVE_HOME}/distribution/extensions |
636 |
+ doins -r "${T}/${emid}" |
637 |
+ |
638 |
+ if use lightning; then |
639 |
+ # move lightning out of distribution/extensions and into extensions for app-global install |
640 |
+ mv "${ED}"/${MOZILLA_FIVE_HOME}/{distribution,}/extensions/${emid} || die |
641 |
+ |
642 |
+ # stage extra locales for gdata-provider and install app-global |
643 |
+ mozlinguas_xpistage_langpacks "${BUILD_OBJ_DIR}"/dist/xpi-stage/gdata-provider \ |
644 |
+ "${WORKDIR}"/gdata-provider-${MOZ_LIGHTNING_GDATA_VER} |
645 |
+ emid='{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}' |
646 |
+ mkdir -p "${T}/${emid}" || die |
647 |
+ cp -RLp -t "${T}/${emid}" "${BUILD_OBJ_DIR}"/dist/xpi-stage/gdata-provider/* || die |
648 |
+ insinto ${MOZILLA_FIVE_HOME}/extensions |
649 |
+ doins -r "${T}/${emid}" |
650 |
+ fi |
651 |
+ |
652 |
+ # thunderbird and thunderbird-bin are identical |
653 |
+ rm "${ED%/}"${MOZILLA_FIVE_HOME}/thunderbird-bin || die |
654 |
+ dosym thunderbird ${MOZILLA_FIVE_HOME}/thunderbird-bin |
655 |
+ |
656 |
+ # Required in order to use plugins and even run thunderbird on hardened. |
657 |
+ pax-mark pm "${ED%/}"${MOZILLA_FIVE_HOME}/{thunderbird,plugin-container} |
658 |
+} |
659 |
+ |
660 |
+pkg_preinst() { |
661 |
+ gnome2_icon_savelist |
662 |
+} |
663 |
+ |
664 |
+pkg_postinst() { |
665 |
+ gnome2_icon_cache_update |
666 |
+ xdg_desktop_database_update |
667 |
+} |
668 |
+ |
669 |
+pkg_postrm() { |
670 |
+ gnome2_icon_cache_update |
671 |
+ xdg_desktop_database_update |
672 |
+} |