summaryrefslogtreecommitdiff
path: root/mail-client/thunderbird
diff options
context:
space:
mode:
Diffstat (limited to 'mail-client/thunderbird')
-rw-r--r--mail-client/thunderbird/Manifest7
-rw-r--r--mail-client/thunderbird/files/thunderbird-60.0-blessings-TERM.patch70
-rw-r--r--mail-client/thunderbird/files/thunderbird-60.0-rust-1.29-comp.patch37
-rw-r--r--mail-client/thunderbird/metadata.xml1
-rw-r--r--mail-client/thunderbird/thunderbird-60.0-r2.ebuild5
-rw-r--r--mail-client/thunderbird/thunderbird-60.0-r3.ebuild567
6 files changed, 684 insertions, 3 deletions
diff --git a/mail-client/thunderbird/Manifest b/mail-client/thunderbird/Manifest
index 7b4128e85954..03f79bdb57e9 100644
--- a/mail-client/thunderbird/Manifest
+++ b/mail-client/thunderbird/Manifest
@@ -1,6 +1,8 @@
AUX 1000_fix_gentoo_preferences.patch 866 BLAKE2B 836e42f394db6233ec4ad8550fd68b427f12474a7dbbe6671da4b60ebccbb762bb8e4096838569e58b2860bc3ad49dae7e66fa03a3a994228f043c7b17a6de95 SHA512 60693c96667dc6bf34bf0b58e4e06a50041b69656c1ea3b945521866a1ae86887169d7afb1afbe54e6b5b6ebb87eb6138fcba716509627966374a933b8a00016
AUX icon/thunderbird-unbranded.desktop 228 BLAKE2B bde0c9dab7c25115f65f08149abbae88f404ac3b4559664e1f6d07ade609e8e15fa91c8054c98adac0794458c2614f5f518c2cd41b97faaaa3dbd8a382d9f767 SHA512 c118873cd701f3582d18ebf5c9622b4c593bd9bae51079ec3daf9fd54aceb4b1406f2de20cc08499ced752cc7b4b2183de6777693c5e6853e47714a4df2a6e4a
AUX icon/thunderbird.desktop 218 BLAKE2B a9c32523f4a4066c02b7971d073ecc9a033c0ed62088691b5cf3003fee7483e80d290a286a8602e113ff89f38d55380869b569f6c7535b51b17c4917ccc3f031 SHA512 0cbe132759012c0da6f81f37d4ede62d2f4138f0d95e590da6259d7593ad858de28467b393e5d6129a6d37d61afa9b078df0f5a8b6a259189860653c44350a72
+AUX thunderbird-60.0-blessings-TERM.patch 2731 BLAKE2B a11e30f107654dc9cc958f76d362e9129c08993a82d96bd148c8a0e6d0f28a07377e0ea5c32dae6bd9c0b4c2292dd9a342a8ccd4c3fb81cde3eaa84aa090d7ee SHA512 e0c474cc2c3f083a944bbed696c8c07ff03fd90180a5fa16cac2b2c8d55ea633391d93882bb58f1126e1f26f90b04f5f10d3e33eea471177fe5beb4ce1bdc93a
+AUX thunderbird-60.0-rust-1.29-comp.patch 1541 BLAKE2B bb50527b8bb07311d6e40900c45fa628b276475bcd1cc137fda2d5c621baf8939c5c9c5ae27b9ab7e63a0a0aff925ea28424ce4363c81fd7c68fe476544b834b SHA512 022a26844e35aa9881022b8ba9f8686627983f490d67d5d9bcb54e53d2f0a9384d3885fd43fcafc59dd8172e5a990aaa994f53888a27a63e93b16e65ced879dc
AUX thunderbird-gentoo-default-prefs-1.js-1 426 BLAKE2B 2cade86c23902fe439018a79847ffef69f82041c35b4a473dbf62b59b17bfe3422abdae604026f8ed14dd1fddc525cb2c49516d2d003bfd3edc075021f24576d SHA512 b40e7b4789b7f43c382589f7d0eaa6043072bce86ab79fb3dda4800e9ab6a43af11f43b0cb3b6ab1c71d887aa1cf9356ac858f0a81dad013cef5b8a4b2107983
AUX thunderbird-gentoo-default-prefs.js-2 461 BLAKE2B a18e1fdbab7ad81feb41af75e60f48adb960800849630a6f9253b7bebcd3e7db33b2517ad0be6302609545a5464b84bd5c5fc67a07fb2ceab0ca1ad98539bee0 SHA512 db115d89a094c395636e5c008307c7864cb084a0a4ebd024d4ce33cac12963cd4a9ff6833227adc6a098430dc3f7ca9e386e26b87400d46920f4ef15741aefa5
DIST firefox-45.0-patches-12.tar.xz 22040 BLAKE2B d2d82ad6255b1a7d1d56e3a3e5c5c8f248f0b62328508c324f72cd6e2ea46132c20c95009dc647e8335bede36266b49a6162f29b746abaffdc9ebcb20af23eb0 SHA512 be9981818e549d79f8557427dd506b9c473922c0043384563c1fd92e4c6c96c91afb8bb01d4499a3a61b463ecf2875bc776fef0f279c0f2fc3625602cb47880b
@@ -243,5 +245,6 @@ DIST thunderbird-60.0.source.tar.xz 282494428 BLAKE2B cd021d819f62c79c7486eaede3
EBUILD thunderbird-45.8.0.ebuild 11907 BLAKE2B 9c59384a0af373242f9c0178ce2d9ecfa47d462d35b937ba6f7822db31ab1f7ac0f6c74039f8ac616d10461e7d6a343ecb1e3c17e1f8648b45200d4b6d04a9ee SHA512 fdd92606748e698b21b6f8c3a37aad0e107de5326a5e20cb53b48878b153e7a77c01e30aea3a9e60a187da3265efc36bbbc2783d5edcda921ca3d172b801f1e3
EBUILD thunderbird-52.5.2.ebuild 10421 BLAKE2B eae5e5b0aa7a10289518343dfc8471a185fcf8bbdd789eca86615be2263fb6e300aee27c82f54133518893060dec53f5488f32c61dde6f585f2e018a9cc2580c SHA512 e1f50c390c7c889c546fbcbe18f1aedf976a3d79ce9531aad20389e736df1b7ca0e7cdd11c9bb140c160e2db537e707b4ba272c9d4b7235eb1cfc2ecfa634930
EBUILD thunderbird-52.9.1.ebuild 10477 BLAKE2B afcc8251288a25fab08a79fa124a4160885c1f0649c5288c170a87de543144c89086aa1c1299cc7bf73edc2c8ff445d9f4805f7c85e698c307181956017398fe SHA512 0e5ec531150c4803e9fdbed0065ecba4817c5fce5c61cc5c5b89e0cf1e7e66cf77b5d10c441fa8da44242261c42b843a0613bfb119db997163f26e87cb27ef90
-EBUILD thunderbird-60.0-r2.ebuild 11219 BLAKE2B 098b5faf32e9ac86e97440bfd856de35c8256cbea6f3656c2f94e3a2b1128c27cff5516faa02403b3fc8fffdbd750876e86cc6ee1aa18d822bfe13bec43b15eb SHA512 4be68fb36b36a6f980375b896fc96c03a20bed4fee962282c2b11a629975cc490603dd907eba9db224fc647a5dbce4d895f31508518905e75aa6c3998a5ac27e
-MISC metadata.xml 2018 BLAKE2B 992a35d8bcd4492c85a2ab2566c63b070f46ddbb7adb4a87ffabcfd64dda0a183337a60bf9fb23b0513972f50e4214af2ee0316f53c9eb18705f83d9843f9fda SHA512 274dd1f5aeb1db04a5a0d0414ee35cb3b656d7864f78f349de9e535150d34b42d950d67e9029de5648725a1ab53b51e5d6054f0b5325bdfcae5f1171689df7d7
+EBUILD thunderbird-60.0-r2.ebuild 11298 BLAKE2B 6d6220ea518a1e295412ab74a08fbe2aff799d2b527bd0e04deea446af5b218e695cfed7e8c4441fe57cc57a2438416ec772045d11c5a484a98005c15271dc9b SHA512 c8f1f840321f889454fbb7e2e6984263749818f4fd7bb30a96e41aa41cca6a822d280cd1dd6289e9787c511a79073b9b21914993a43631ee55fc7fcec0c887e3
+EBUILD thunderbird-60.0-r3.ebuild 17535 BLAKE2B fa4ee07bd1081ce46fb233822eaf3aa4b512f975e266378ce1b36048e832fc8b38e33f073e4efd89e7da05514f76968397905ada4cf90440074ee8ed6c03562f SHA512 98eb42f685d53fdf00b5303486af777ffb1309c81f78bd2aff1821e7280601e880887ab6439ce9ea94ee597c422180511574f3c3dc5fc3228c697d263bdf8c72
+MISC metadata.xml 2079 BLAKE2B ed410923adba7e1f7bc974ea97276ed922c3afdf39aa14c30d83b989fa827527da4360c7e57694c60728a12c3a2be37a5ee3c6a4e0aa9de397077ec6ed70fa04 SHA512 32557048cd4954a940dd22491566d507f23fe8004224b27c951527934c659141aa80552b771b8c8e5e19cda6a72c30e6255e13413764debb3644518b2a2b0fbf
diff --git a/mail-client/thunderbird/files/thunderbird-60.0-blessings-TERM.patch b/mail-client/thunderbird/files/thunderbird-60.0-blessings-TERM.patch
new file mode 100644
index 000000000000..975e0cf6fe7b
--- /dev/null
+++ b/mail-client/thunderbird/files/thunderbird-60.0-blessings-TERM.patch
@@ -0,0 +1,70 @@
+https://github.com/erikrose/blessings/pull/137
+
+Fixes: https://bugs.gentoo.org/654316
+
+From 5fefc65c306cf9ec492e7b422d6bb4842385afbc Mon Sep 17 00:00:00 2001
+From: Jay Kamat <jaygkamat@gmail.com>
+Date: Fri, 24 Aug 2018 11:11:57 -0700
+Subject: [PATCH 1/2] Fix error when TERM is unset or improperly set
+
+---
+ blessings/__init__.py | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/blessings/__init__.py b/blessings/__init__.py
+index 98b75c3..3872b5f 100644
+--- a/third_party/python/blessings/blessings/__init__.py
++++ b/third_party/python/blessings/blessings/__init__.py
+@@ -94,8 +94,13 @@ def __init__(self, kind=None, stream=None, force_styling=False):
+ # init sequences to the stream if it has a file descriptor, and
+ # send them to stdout as a fallback, since they have to go
+ # somewhere.
+- setupterm(kind or environ.get('TERM', 'unknown'),
+- self._init_descriptor)
++ try:
++ setupterm(kind or environ.get('TERM', 'dumb') or 'dumb',
++ self._init_descriptor)
++ except:
++ # There was an error setting up the terminal, either curses is
++ # not supported or TERM is incorrectly set. Fall back to dumb.
++ self._does_styling = False
+
+ self.stream = stream
+
+
+From d885df78c6f931abf3259343aaaa897e16c8cba1 Mon Sep 17 00:00:00 2001
+From: Jay Kamat <jaygkamat@gmail.com>
+Date: Sat, 1 Sep 2018 13:20:32 -0700
+Subject: [PATCH 2/2] Explicitly catch curses.error
+
+---
+ blessings/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/blessings/__init__.py b/blessings/__init__.py
+index 3872b5f..fdceb09 100644
+--- a/third_party/python/blessings/blessings/__init__.py
++++ b/third_party/python/blessings/blessings/__init__.py
+@@ -97,7 +97,7 @@ def __init__(self, kind=None, stream=None, force_styling=False):
+ try:
+ setupterm(kind or environ.get('TERM', 'dumb'),
+ self._init_descriptor)
+- except:
++ except curses.error:
+ # There was an error setting up the terminal, either curses is
+ # not supported or TERM is incorrectly set. Fall back to dumb.
+ self._does_styling = False
+
+
+--- a/python/mach/mach/logging.py
++++ b/python/mach/mach/logging.py
+@@ -93,7 +93,7 @@
+
+ def set_terminal(self, terminal):
+ self.terminal = terminal
+- self._sgr0 = blessings.tigetstr('sgr0') or '' if terminal and blessings else ''
++ self._sgr0 = terminal.normal if terminal and blessings else ''
+
+ def format(self, record):
+ f = record.msg.format(**record.params)
+
diff --git a/mail-client/thunderbird/files/thunderbird-60.0-rust-1.29-comp.patch b/mail-client/thunderbird/files/thunderbird-60.0-rust-1.29-comp.patch
new file mode 100644
index 000000000000..6fbd13fe639a
--- /dev/null
+++ b/mail-client/thunderbird/files/thunderbird-60.0-rust-1.29-comp.patch
@@ -0,0 +1,37 @@
+https://bugs.gentoo.org/666898
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1479540
+--- a/build/moz.configure/init.configure
++++ b/build/moz.configure/init.configure
+@@ -572,17 +572,26 @@ option('--target', nargs=1,
+ @imports(_from='__builtin__', _import='KeyError')
+ @imports(_from='__builtin__', _import='ValueError')
+ def split_triplet(triplet, allow_unknown=False):
+ # The standard triplet is defined as
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+ # There is also a quartet form:
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # But we can consider the "KERNEL-OPERATING_SYSTEM" as one.
+- cpu, manufacturer, os = triplet.split('-', 2)
++ # Additionally, some may omit "unknown" when the manufacturer
++ # is not specified and emit
++ # CPU_TYPE-OPERATING_SYSTEM
++ parts = triplet.split('-', 2)
++ if len(parts) == 3:
++ cpu, _, os = parts
++ elif len(parts) == 2:
++ cpu, os = parts
++ else:
++ die("Unexpected triplet string: %s" % triplet)
+
+ # Autoconf uses config.sub to validate and canonicalize those triplets,
+ # but the granularity of its results has never been satisfying to our
+ # use, so we've had our own, different, canonicalization. We've also
+ # historically not been very consistent with how we use the canonicalized
+ # values. Hopefully, this will help us make things better.
+ # The tests are inherited from our decades-old autoconf-based configure,
+ # which can probably be improved/cleaned up because they are based on a
+
+
+
+
diff --git a/mail-client/thunderbird/metadata.xml b/mail-client/thunderbird/metadata.xml
index 9b3685ecc048..26c62acdb14b 100644
--- a/mail-client/thunderbird/metadata.xml
+++ b/mail-client/thunderbird/metadata.xml
@@ -8,6 +8,7 @@
<use>
<flag name="bindist">Disable official Thunderbird branding (icons, name) which
are not binary-redistributable according to upstream.</flag>
+ <flag name="clang">Use Clang compiler instead of GCC</flag>
<flag name="crypt"> Enable encryption support with enigmail</flag>
<flag name="mozdom">Enable Mozilla's DOM inspector</flag>
<flag name="lightning">Enable app-global calendar support
diff --git a/mail-client/thunderbird/thunderbird-60.0-r2.ebuild b/mail-client/thunderbird/thunderbird-60.0-r2.ebuild
index f8526ec3845e..093c38a9f2db 100644
--- a/mail-client/thunderbird/thunderbird-60.0-r2.ebuild
+++ b/mail-client/thunderbird/thunderbird-60.0-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -7,6 +7,9 @@ MOZ_ESR=""
MOZ_LIGHTNING_VER="6.2"
MOZ_LIGHTNING_GDATA_VER="4.4.1"
+PYTHON_COMPAT=( python3_{5,6,7} )
+PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)'
+
# This list can be updated using scripts/get_langs.sh from the mozilla overlay
MOZ_LANGS=(ar ast be bg br ca cs cy da de el en en-GB en-US es-AR
es-ES et eu fi fr fy-NL ga-IE gd gl he hr hsb hu hy-AM id is it ja ko lt
diff --git a/mail-client/thunderbird/thunderbird-60.0-r3.ebuild b/mail-client/thunderbird/thunderbird-60.0-r3.ebuild
new file mode 100644
index 000000000000..256c7511bb70
--- /dev/null
+++ b/mail-client/thunderbird/thunderbird-60.0-r3.ebuild
@@ -0,0 +1,567 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+VIRTUALX_REQUIRED="pgo"
+WANT_AUTOCONF="2.1"
+MOZ_ESR=""
+MOZ_LIGHTNING_VER="6.2"
+MOZ_LIGHTNING_GDATA_VER="4.4.1"
+
+PYTHON_COMPAT=( python3_{5,6,7} )
+PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)'
+
+# This list can be updated using scripts/get_langs.sh from the mozilla overlay
+MOZ_LANGS=(ar ast be bg br ca cs cy da de el en en-GB en-US es-AR
+es-ES et eu fi fr fy-NL ga-IE gd gl he hr hsb hu hy-AM id is it ja ko lt
+nb-NO nl nn-NO pl pt-BR pt-PT rm ro ru si sk sl sq sr sv-SE tr
+uk vi zh-CN zh-TW )
+
+# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
+MOZ_PV="${PV/_beta/b}"
+
+# Patches
+PATCHTB="thunderbird-60.0-patches-0"
+PATCHFF="firefox-60.0-patches-02"
+
+MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases"
+
+# ESR releases have slightly version numbers
+if [[ ${MOZ_ESR} == 1 ]]; then
+ MOZ_PV="${MOZ_PV}esr"
+fi
+MOZ_P="${PN}-${MOZ_PV}"
+
+inherit check-reqs flag-o-matic toolchain-funcs gnome2-utils llvm mozcoreconf-v6 pax-utils xdg-utils autotools mozlinguas-v2
+
+DESCRIPTION="Thunderbird Mail Client"
+HOMEPAGE="https://www.mozilla.org/thunderbird"
+
+KEYWORDS="~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+SLOT="0"
+LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
+IUSE="bindist clang dbus debug hardened jack lightning mozdom neon pulseaudio
+ selinux startup-notification system-harfbuzz system-icu system-jpeg
+ system-libevent system-libvpx system-sqlite wifi"
+RESTRICT="!bindist? ( bindist )"
+
+PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/{${PATCHTB},${PATCHFF}}.tar.xz )
+SRC_URI="${SRC_URI}
+ ${MOZ_HTTP_URI}/${MOZ_PV}/source/${MOZ_P}.source.tar.xz
+ https://dev.gentoo.org/~axs/distfiles/lightning-${MOZ_LIGHTNING_VER}.tar.xz
+ lightning? ( https://dev.gentoo.org/~axs/distfiles/gdata-provider-${MOZ_LIGHTNING_GDATA_VER}.tar.xz )
+ ${PATCH_URIS[@]}"
+
+ASM_DEPEND=">=dev-lang/yasm-1.1"
+
+CDEPEND="
+ >=dev-libs/nss-3.36.4
+ >=dev-libs/nspr-4.19
+ >=app-text/hunspell-1.5.4:=
+ dev-libs/atk
+ dev-libs/expat
+ >=x11-libs/cairo-1.10[X]
+ >=x11-libs/gtk+-2.18:2
+ >=x11-libs/gtk+-3.4.0:3
+ x11-libs/gdk-pixbuf
+ >=x11-libs/pango-1.22.0
+ >=media-libs/libpng-1.6.34:0=[apng]
+ >=media-libs/mesa-10.2:*
+ media-libs/fontconfig
+ >=media-libs/freetype-2.4.10
+ kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
+ virtual/freedesktop-icon-theme
+ dbus? (
+ >=sys-apps/dbus-0.60
+ >=dev-libs/dbus-glib-0.72
+ )
+ startup-notification? ( >=x11-libs/startup-notification-0.8 )
+ >=x11-libs/pixman-0.19.2
+ >=dev-libs/glib-2.26:2
+ >=sys-libs/zlib-1.2.3
+ >=virtual/libffi-3.0.10
+ virtual/ffmpeg
+ x11-libs/libX11
+ x11-libs/libXcomposite
+ x11-libs/libXdamage
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXrender
+ x11-libs/libXt
+ system-harfbuzz? (
+ >=media-libs/harfbuzz-1.4.2:0=
+ >=media-gfx/graphite2-1.3.9-r1
+ )
+ system-icu? ( >=dev-libs/icu-59.1:= )
+ system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1:= )
+ system-libevent? ( >=dev-libs/libevent-2.0:0= )
+ system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
+ system-sqlite? ( >=dev-db/sqlite-3.23.1:3[secure-delete,debug=] )
+ wifi? (
+ kernel_linux? (
+ >=sys-apps/dbus-0.60
+ >=dev-libs/dbus-glib-0.72
+ net-misc/networkmanager
+ )
+ )
+ jack? ( virtual/jack )"
+
+DEPEND="${CDEPEND}
+ app-arch/zip
+ app-arch/unzip
+ >=sys-devel/binutils-2.30
+ sys-apps/findutils
+ >=sys-devel/llvm-4.0.1
+ >=sys-devel/clang-4.0.1
+ clang? (
+ >=sys-devel/llvm-4.0.1[gold]
+ >=sys-devel/lld-4.0.1
+ )
+ pulseaudio? ( media-sound/pulseaudio )
+ elibc_glibc? (
+ virtual/cargo
+ virtual/rust
+ )
+ elibc_musl? (
+ virtual/cargo
+ virtual/rust
+ )
+ amd64? (
+ ${ASM_DEPEND}
+ virtual/opengl
+ )
+ x86? (
+ ${ASM_DEPEND}
+ virtual/opengl
+ )"
+
+RDEPEND="${CDEPEND}
+ pulseaudio? (
+ || (
+ media-sound/pulseaudio
+ >=media-sound/apulse-0.1.9
+ )
+ )
+ selinux? (
+ sec-policy/selinux-mozilla
+ sec-policy/selinux-thunderbird
+ )"
+
+REQUIRED_USE="wifi? ( dbus )"
+
+S="${WORKDIR}/${MOZ_P%b[0-9]*}"
+
+BUILD_OBJ_DIR="${S}/tbird"
+
+pkg_setup() {
+ moz_pkgsetup
+
+ # Avoid PGO profiling problems due to enviroment leakage
+ # These should *always* be cleaned up anyway
+ unset DBUS_SESSION_BUS_ADDRESS \
+ DISPLAY \
+ ORBIT_SOCKETDIR \
+ SESSION_MANAGER \
+ XDG_SESSION_COOKIE \
+ XAUTHORITY
+
+ if ! use bindist ; then
+ elog "You are enabling official branding. You may not redistribute this build"
+ elog "to any users on your network or the internet. Doing so puts yourself into"
+ elog "a legal problem with Mozilla Foundation"
+ elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
+ elog
+ fi
+
+ addpredict /proc/self/oom_score_adj
+
+ llvm_pkg_setup
+}
+
+pkg_pretend() {
+ # Ensure we have enough disk space to compile
+ CHECKREQS_DISK_BUILD="4G"
+ check-reqs_pkg_setup
+}
+
+src_unpack() {
+ unpack ${A}
+
+ # Unpack language packs
+ mozlinguas_src_unpack
+}
+
+src_prepare() {
+ # Apply our patchset from firefox to thunderbird as well
+ rm -f "${WORKDIR}"/firefox/2007_fix_nvidia_latest.patch \
+ "${WORKDIR}"/firefox/2005_ffmpeg4.patch \
+ || die
+ eapply "${WORKDIR}/firefox"
+ eapply "${FILESDIR}"/${PN}-60.0-blessings-TERM.patch # 654316
+ eapply "${FILESDIR}"/${PN}-60.0-rust-1.29-comp.patch
+
+ # Ensure that are plugins dir is enabled as default
+ sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
+ sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
+
+ # Don't error out when there's no files to be removed:
+ sed 's@\(xargs rm\)$@\1 -f@' \
+ -i "${S}"/toolkit/mozapps/installer/packager.mk || die
+
+ # Don't exit with error when some libs are missing which we have in
+ # system.
+ sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
+ -i "${S}"/comm/mail/installer/Makefile.in || die
+
+ # Apply our Thunderbird patchset
+ pushd "${S}"/comm &>/dev/null || die
+ eapply "${WORKDIR}"/thunderbird
+
+ # Confirm the version of lightning being grabbed for langpacks is the same
+ # as that used in thunderbird
+ local THIS_MOZ_LIGHTNING_VER=$(${PYTHON} calendar/lightning/build/makeversion.py ${PV})
+ if [[ ${MOZ_LIGHTNING_VER} != ${THIS_MOZ_LIGHTNING_VER} ]]; then
+ eqawarn "The version of lightning used for localization differs from the version"
+ eqawarn "in thunderbird. Please update MOZ_LIGHTNING_VER in the ebuild from ${MOZ_LIGHTNING_VER}"
+ eqawarn "to ${THIS_MOZ_LIGHTNING_VER}"
+ fi
+
+ popd &>/dev/null || die
+
+ # Allow user to apply any additional patches without modifing ebuild
+ eapply_user
+
+ # Autotools configure is now called old-configure.in
+ # This works because there is still a configure.in that happens to be for the
+ # shell wrapper configure script
+ eautoreconf old-configure.in
+
+ # Must run autoconf in js/src
+ cd "${S}"/js/src || die
+ eautoconf old-configure.in
+}
+
+src_configure() {
+ MEXTENSIONS="default"
+
+ # Add information about TERM to output (build.log) to aid debugging
+ # blessings problems
+ if [[ -n "${TERM}" ]] ; then
+ einfo "TERM is set to: \"${TERM}\""
+ else
+ einfo "TERM is unset."
+ fi
+
+ if use clang && ! tc-is-clang ; then
+ # Force clang
+ einfo "Enforcing the use of clang due to USE=clang ..."
+ CC=${CHOST}-clang
+ CXX=${CHOST}-clang++
+ strip-unsupported-flags
+ elif ! use clang && ! tc-is-gcc ; then
+ # Force gcc
+ einfo "Enforcing the use of gcc due to USE=-clang ..."
+ CC=${CHOST}-gcc
+ CXX=${CHOST}-gcc++
+ strip-unsupported-flags
+ fi
+
+ ####################################
+ #
+ # mozconfig, CFLAGS and CXXFLAGS setup
+ #
+ ####################################
+
+ mozconfig_init
+ # common config components
+ mozconfig_annotate 'system_libs' \
+ --with-system-zlib \
+ --with-system-bz2
+
+ # Must pass release in order to properly select linker
+ mozconfig_annotate 'Enable by Gentoo' --enable-release
+
+ # Avoid auto-magic on linker
+ if use clang ; then
+ # This is upstream's default
+ mozconfig_annotate "forcing ld=lld due to USE=clang" --enable-linker=lld
+ elif tc-ld-is-gold ; then
+ mozconfig_annotate "linker is set to gold" --enable-linker=gold
+ else
+ mozconfig_annotate "linker is set to bfd" --enable-linker=bfd
+ fi
+
+ # It doesn't compile on alpha without this LDFLAGS
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ # Add full relro support for hardened
+ if use hardened; then
+ append-ldflags "-Wl,-z,relro,-z,now"
+ mozconfig_use_enable hardened hardening
+ fi
+
+ # Modifications to better support ARM, bug 553364
+ if use neon ; then
+ mozconfig_annotate '' --with-fpu=neon
+
+ if ! tc-is-clang ; then
+ # thumb options aren't supported when using clang, bug 666966
+ mozconfig_annotate '' --with-thumb=yes
+ mozconfig_annotate '' --with-thumb-interwork=no
+ fi
+ fi
+ if [[ ${CHOST} == armv*h* ]] ; then
+ mozconfig_annotate '' --with-float-abi=hard
+ if ! use system-libvpx ; then
+ sed -i -e "s|softfp|hard|" \
+ "${S}"/media/libvpx/moz.build
+ fi
+ fi
+
+ mozconfig_use_enable !bindist official-branding
+ # Enable position independent executables
+ mozconfig_annotate 'enabled by Gentoo' --enable-pie
+
+ mozconfig_use_enable debug
+ mozconfig_use_enable debug tests
+ if ! use debug ; then
+ mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
+ else
+ mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
+ fi
+ # These are enabled by default in all mozilla applications
+ mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
+ mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
+ mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include \
+ --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
+ mozconfig_annotate '' --prefix="${EPREFIX}"/usr
+ mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
+ mozconfig_annotate 'Gentoo default' --enable-system-hunspell
+ mozconfig_annotate '' --disable-crashreporter
+ mozconfig_annotate 'Gentoo default' --with-system-png
+ mozconfig_annotate '' --enable-system-ffi
+ mozconfig_annotate '' --disable-gconf
+ mozconfig_annotate '' --with-intl-api
+ mozconfig_annotate '' --enable-system-pixman
+ # Instead of the standard --build= and --host=, mozilla uses --host instead
+ # of --build, and --target intstead of --host.
+ # Note, mozilla also has --build but it does not do what you think it does.
+ # Set both --target and --host as mozilla uses python to guess values otherwise
+ mozconfig_annotate '' --target="${CHOST}"
+ mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
+ if use system-libevent; then
+ mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
+ fi
+
+ # skia has no support for big-endian platforms
+ if [[ $(tc-endian) == "big" ]]; then
+ mozconfig_annotate 'big endian target' --disable-skia
+ else
+ mozconfig_annotate '' --enable-skia
+ fi
+
+ # use the gtk3 toolkit (the only one supported at this point)
+ mozconfig_annotate '' --enable-default-toolkit=cairo-gtk3
+
+ mozconfig_use_enable startup-notification
+ mozconfig_use_enable system-sqlite
+ mozconfig_use_with system-jpeg
+ mozconfig_use_with system-icu
+ mozconfig_use_with system-libvpx
+ mozconfig_use_with system-harfbuzz
+ mozconfig_use_with system-harfbuzz system-graphite2
+ mozconfig_use_enable pulseaudio
+ # force the deprecated alsa sound code if pulseaudio is disabled
+ if use kernel_linux && ! use pulseaudio ; then
+ mozconfig_annotate '-pulseaudio' --enable-alsa
+ fi
+
+ mozconfig_use_enable dbus
+
+ mozconfig_use_enable wifi necko-wifi
+
+ # enable JACK, bug 600002
+ mozconfig_use_enable jack
+
+ # Other tb-specific settings
+ mozconfig_annotate '' --with-user-appdir=.thunderbird
+
+ mozconfig_annotate '' --enable-ldap
+
+ # Bug #72667
+ if use mozdom; then
+ MEXTENSIONS="${MEXTENSIONS},inspector"
+ fi
+
+ mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
+
+ mozconfig_annotate '' --enable-calendar
+
+ # Disable built-in ccache support to avoid sandbox violation, #665420
+ # Use FEATURES=ccache instead!
+ mozconfig_annotate '' --without-ccache
+ sed -i -e 's/ccache_stats = None/return None/' \
+ python/mozbuild/mozbuild/controller/building.py || \
+ die "Failed to disable ccache stats call"
+
+ # Stylo is only broken on x86 builds
+ use x86 && mozconfig_annotate 'Upstream bug 1341234' --disable-stylo
+
+ # Stylo is horribly broken on arm, renders GUI unusable
+ use arm && mozconfig_annotate 'breaks UI on arm' --disable-stylo
+
+ if use clang ; then
+ # libprldap60.so: terminate called after throwing an instance of 'std::runtime_error', bug 667186
+ mozconfig_annotate 'elf-hack is broken when using clang' --disable-elf-hack
+ elif use arm ; then
+ mozconfig_annotate 'elf-hack is broken on arm' --disable-elf-hack
+ fi
+
+ # Use an objdir to keep things organized.
+ echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
+ echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig
+
+ # Finalize and report settings
+ mozconfig_final
+
+ ####################################
+ #
+ # Configure and build
+ #
+ ####################################
+
+ # Disable no-print-directory
+ MAKEOPTS=${MAKEOPTS/--no-print-directory/}
+
+ if [[ $(gcc-major-version) -lt 4 ]]; then
+ append-cxxflags -fno-stack-protector
+ fi
+
+ # workaround for funky/broken upstream configure...
+ SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
+ ./mach configure || die
+}
+
+src_compile() {
+ MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
+ ./mach build --verbose || die
+}
+
+src_install() {
+ declare emid
+ cd "${BUILD_OBJ_DIR}" || die
+
+ # Pax mark xpcshell for hardened support, only used for startupcache creation.
+ pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
+
+ # Copy our preference before omnijar is created.
+ cp "${FILESDIR}"/thunderbird-gentoo-default-prefs.js-2 \
+ "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \
+ || die
+
+ # set dictionary path, to use system hunspell
+ echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
+
+ # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
+ if use system-harfbuzz ; then
+ echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
+ fi
+
+ # force cairo as the canvas renderer on platforms without skia support
+ if [[ $(tc-endian) == "big" ]] ; then
+ echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
+ echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
+ fi
+
+ # dev-db/sqlite does not have FTS3_TOKENIZER support.
+ # gloda needs it to function, and bad crashes happen when its enabled and doesn't work
+ if use system-sqlite ; then
+ echo "sticky_pref(\"mailnews.database.global.indexer.enabled\", false);" \
+ >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
+ fi
+
+ cd "${S}" || die
+ MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
+ DESTDIR="${D}" ./mach install || die
+
+ # Install language packs
+ MOZ_INSTALL_L10N_XPIFILE="1" mozlinguas_src_install
+
+ local size sizes icon_path icon
+ if ! use bindist; then
+ icon_path="${S}/comm/mail/branding/thunderbird"
+ icon="${PN}-icon"
+
+ domenu "${FILESDIR}"/icon/${PN}.desktop
+ else
+ icon_path="${S}/comm/mail/branding/nightly"
+ icon="${PN}-icon-unbranded"
+
+ newmenu "${FILESDIR}"/icon/${PN}-unbranded.desktop \
+ ${PN}.desktop
+
+ sed -i -e "s:Mozilla\ Thunderbird:EarlyBird:g" \
+ "${ED}"/usr/share/applications/${PN}.desktop
+ fi
+
+ # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
+ newicon "${icon_path}"/default48.png "${icon}".png
+ # Install icons for menu entry
+ sizes="16 22 24 32 48 256"
+ for size in ${sizes}; do
+ newicon -s ${size} "${icon_path}/default${size}.png" "${icon}.png"
+ done
+
+ local emid
+ # stage extra locales for lightning and install over existing
+ rm -f "${ED}"/${MOZILLA_FIVE_HOME}/distribution/extensions/${emid}.xpi || die
+ mozlinguas_xpistage_langpacks "${BUILD_OBJ_DIR}"/dist/bin/distribution/extensions/${emid} \
+ "${WORKDIR}"/lightning-${MOZ_LIGHTNING_VER} lightning calendar
+
+ emid='{e2fda1a4-762b-4020-b5ad-a41df1933103}'
+ mkdir -p "${T}/${emid}" || die
+ cp -RLp -t "${T}/${emid}" "${BUILD_OBJ_DIR}"/dist/bin/distribution/extensions/${emid}/* || die
+ insinto ${MOZILLA_FIVE_HOME}/distribution/extensions
+ doins -r "${T}/${emid}"
+
+ if use lightning; then
+ # move lightning out of distribution/extensions and into extensions for app-global install
+ mv "${ED}"/${MOZILLA_FIVE_HOME}/{distribution,}/extensions/${emid} || die
+
+ # stage extra locales for gdata-provider and install app-global
+ mozlinguas_xpistage_langpacks "${BUILD_OBJ_DIR}"/dist/xpi-stage/gdata-provider \
+ "${WORKDIR}"/gdata-provider-${MOZ_LIGHTNING_GDATA_VER}
+ emid='{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}'
+ mkdir -p "${T}/${emid}" || die
+ cp -RLp -t "${T}/${emid}" "${BUILD_OBJ_DIR}"/dist/xpi-stage/gdata-provider/* || die
+ insinto ${MOZILLA_FIVE_HOME}/extensions
+ doins -r "${T}/${emid}"
+ fi
+
+ # thunderbird and thunderbird-bin are identical
+ rm "${ED%/}"${MOZILLA_FIVE_HOME}/thunderbird-bin || die
+ dosym thunderbird ${MOZILLA_FIVE_HOME}/thunderbird-bin
+
+ # Required in order to use plugins and even run thunderbird on hardened.
+ pax-mark pm "${ED%/}"${MOZILLA_FIVE_HOME}/{thunderbird,plugin-container}
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}