1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 VIRTUALX_REQUIRED="pgo"
8 MOZ_LIGHTNING_VER="6.2.5"
9 MOZ_LIGHTNING_GDATA_VER="4.4.1"
11 PYTHON_COMPAT=( python3_{6,7} )
12 PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)'
14 # This list can be updated using scripts/get_langs.sh from the mozilla overlay
15 MOZ_LANGS=(ar ast be bg br ca cs cy da de el en en-GB en-US es-AR
16 es-ES et eu fi fr fy-NL ga-IE gd gl he hr hsb hu hy-AM id is it
17 ja ko lt nb-NO nl nn-NO pl pt-BR pt-PT rm ro ru si sk sl sq sr
18 sv-SE tr uk vi zh-CN zh-TW )
20 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
21 MOZ_PV="${PV/_beta/b}"
24 PATCHFF="firefox-68.0-patches-12"
26 MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases"
28 # ESR releases have slightly version numbers
29 if [[ ${MOZ_ESR} == 1 ]]; then
32 MOZ_P="${PN}-${MOZ_PV}"
36 DESCRIPTION="Thunderbird Mail Client"
37 HOMEPAGE="https://www.mozilla.org/thunderbird"
39 KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
41 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
42 IUSE="bindist clang cpu_flags_x86_avx2 dbus debug eme-free
43 +gmp-autoupdate hardened jack lightning lto cpu_flags_arm_neon pgo
44 pulseaudio selinux startup-notification +system-av1 +system-harfbuzz
45 +system-icu +system-jpeg +system-libevent +system-sqlite
46 +system-libvpx +system-webp test wayland wifi"
47 RESTRICT="!bindist? ( bindist )
50 PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c,whissi}/mozilla/patchsets/${PATCHFF}.tar.xz )
52 ${MOZ_HTTP_URI}/${MOZ_PV}/source/${MOZ_P}.source.tar.xz
53 https://dev.gentoo.org/~axs/distfiles/lightning-${MOZ_LIGHTNING_VER}.tar.xz
54 lightning? ( https://dev.gentoo.org/~axs/distfiles/gdata-provider-${MOZ_LIGHTNING_GDATA_VER}.tar.xz )
57 inherit check-reqs eapi7-ver flag-o-matic toolchain-funcs eutils \
58 gnome2-utils llvm mozcoreconf-v6 pax-utils xdg-utils \
59 autotools mozlinguas-v2 virtualx multiprocessing
66 >=x11-libs/cairo-1.10[X]
67 >=x11-libs/gtk+-2.18:2
68 >=x11-libs/gtk+-3.4.0:3[X]
70 >=x11-libs/pango-1.22.0
71 >=media-libs/libpng-1.6.35:0=[apng]
72 >=media-libs/mesa-10.2:*
74 >=media-libs/freetype-2.4.10
75 kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
76 virtual/freedesktop-icon-theme
77 dbus? ( >=sys-apps/dbus-0.60
78 >=dev-libs/dbus-glib-0.72 )
79 startup-notification? ( >=x11-libs/startup-notification-0.8 )
80 >=x11-libs/pixman-0.19.2
81 >=dev-libs/glib-2.26:2
83 >=virtual/libffi-3.0.10:=
86 x11-libs/libXcomposite
93 >=media-libs/dav1d-0.3.0:=
94 >=media-libs/libaom-1.0.0:=
96 system-harfbuzz? ( >=media-libs/harfbuzz-2.4.0:0= >=media-gfx/graphite2-1.3.13 )
97 system-icu? ( >=dev-libs/icu-63.1:= )
98 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
99 system-libevent? ( >=dev-libs/libevent-2.0:0=[threads] )
100 system-libvpx? ( =media-libs/libvpx-1.7*:0=[postproc] )
101 system-sqlite? ( >=dev-db/sqlite-3.28.0:3[secure-delete,debug=] )
102 system-webp? ( >=media-libs/libwebp-1.0.2:0= )
103 wifi? ( kernel_linux? ( >=sys-apps/dbus-0.60
104 >=dev-libs/dbus-glib-0.72
105 net-misc/networkmanager ) )
106 jack? ( virtual/jack )
107 selinux? ( sec-policy/selinux-mozilla )"
110 jack? ( virtual/jack )
111 pulseaudio? ( || ( media-sound/pulseaudio
112 >=media-sound/apulse-0.1.9 ) )
113 selinux? ( sec-policy/selinux-mozilla )"
118 >=dev-util/cbindgen-0.8.7
119 >=net-libs/nodejs-8.11.0
120 >=sys-devel/binutils-2.30
125 !clang? ( sys-devel/llvm:9 )
128 sys-devel/llvm:9[gold]
129 pgo? ( =sys-libs/compiler-rt-sanitizers-9*[profile] )
134 !clang? ( sys-devel/llvm:8 )
137 sys-devel/llvm:8[gold]
138 pgo? ( =sys-libs/compiler-rt-sanitizers-8*[profile] )
143 !clang? ( sys-devel/llvm:7 )
146 sys-devel/llvm:7[gold]
147 pgo? ( =sys-libs/compiler-rt-sanitizers-7*[profile] )
152 !clang? ( sys-devel/llvm:6 )
155 sys-devel/llvm:6[gold]
156 pgo? ( =sys-libs/compiler-rt-sanitizers-6*[profile] )
160 pulseaudio? ( media-sound/pulseaudio )
161 >=virtual/rust-1.34.0
162 wayland? ( >=x11-libs/gtk+-3.11:3[wayland] )
163 amd64? ( >=dev-lang/yasm-1.1 virtual/opengl )
164 x86? ( >=dev-lang/yasm-1.1 virtual/opengl )
166 amd64? ( >=dev-lang/nasm-2.13 )
167 x86? ( >=dev-lang/nasm-2.13 )
170 REQUIRED_USE="wifi? ( dbus )
173 S="${WORKDIR}/${MOZ_P%b[0-9]*}"
175 BUILD_OBJ_DIR="${S}/tbird"
177 # allow GMP_PLUGIN_LIST to be set in an eclass or
178 # overridden in the enviromnent (advanced hackers only)
179 if [[ -z $GMP_PLUGIN_LIST ]] ; then
180 GMP_PLUGIN_LIST=( gmp-gmpopenh264 gmp-widevinecdm )
184 if ! has_version --host-root "sys-devel/clang:${LLVM_SLOT}" ; then
185 ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
190 if ! has_version --host-root "=sys-devel/lld-${LLVM_SLOT}*" ; then
191 ewarn "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
196 if ! has_version --host-root "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}*" ; then
197 ewarn "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
203 einfo "Will use LLVM slot ${LLVM_SLOT}!" >&2
210 if ! has usersandbox $FEATURES ; then
211 die "You must enable usersandbox as X server can not run as root!"
215 # Avoid PGO profiling problems due to enviroment leakage
216 # These should *always* be cleaned up anyway
217 unset DBUS_SESSION_BUS_ADDRESS \
224 if ! use bindist ; then
226 elog "You are enabling official branding. You may not redistribute this build"
227 elog "to any users on your network or the internet. Doing so puts yourself into"
228 elog "a legal problem with Mozilla Foundation."
229 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag."
232 addpredict /proc/self/oom_score_adj
238 # Ensure we have enough disk space to compile
239 if use pgo || use lto || use debug || use test ; then
240 CHECKREQS_DISK_BUILD="8G"
242 CHECKREQS_DISK_BUILD="4G"
251 # Unpack language packs
252 mozlinguas_src_unpack
256 # Apply firefox patchset then apply thunderbird patches
257 rm "${WORKDIR}"/firefox/2013_avoid_noinline_on_GCC_with_skcms.patch || die
258 rm "${WORKDIR}"/firefox/2015_fix_cssparser.patch || die
259 eapply "${WORKDIR}/firefox"
260 pushd "${S}"/comm &>/dev/null || die
261 eapply "${FILESDIR}/1000_fix_gentoo_preferences.patch"
262 popd &>/dev/null || die
264 # Allow user to apply any additional patches without modifing ebuild
267 local n_jobs=$(makeopts_jobs)
268 if [[ ${n_jobs} == 1 ]]; then
269 einfo "Building with MAKEOPTS=-j1 is known to fail (bug #687028); Forcing MAKEOPTS=-j2 ..."
273 # Enable gnomebreakpad
275 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
276 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
279 # Drop -Wl,--as-needed related manipulation for ia64 as it causes ld sefgaults, bug #582432
282 -e '/^OS_LIBS += no_as_needed/d' \
283 -e '/^OS_LIBS += as_needed/d' \
284 "${S}"/widget/gtk/mozgtk/gtk2/moz.build \
285 "${S}"/widget/gtk/mozgtk/gtk3/moz.build \
286 || die "sed failed to drop --as-needed for ia64"
289 # Fix sandbox violations during make clean, bug 372817
290 sed -e "s:\(/no-such-file\):${T}\1:g" \
291 -i "${S}"/config/rules.mk \
292 -i "${S}"/nsprpub/configure{.in,} \
295 # Don't exit with error when some libs are missing which we have in
297 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
298 -i "${S}"/comm/mail/installer/Makefile.in || die
300 # Don't error out when there's no files to be removed:
301 sed 's@\(xargs rm\)$@\1 -f@' \
302 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
304 # Keep codebase the same even if not using official branding
305 sed '/^MOZ_DEV_EDITION=1/d' \
306 -i "${S}"/browser/branding/aurora/configure.sh || die
308 # rustfmt, a tool to format Rust code, is optional and not required to build Firefox.
309 # However, when available, an unsupported version can cause problems, bug #669548
310 sed -i -e "s@check_prog('RUSTFMT', add_rustup_path('rustfmt')@check_prog('RUSTFMT', add_rustup_path('rustfmt_do_not_use')@" \
311 "${S}"/build/moz.configure/rust.configure || die
313 # Autotools configure is now called old-configure.in
314 # This works because there is still a configure.in that happens to be for the
315 # shell wrapper configure script
316 eautoreconf old-configure.in
318 # Must run autoconf in js/src
319 cd "${S}"/js/src || die
320 eautoconf old-configure.in
324 MEXTENSIONS="default"
325 # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
326 # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
327 # get your own set of keys.
328 _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
330 # Add information about TERM to output (build.log) to aid debugging
332 if [[ -n "${TERM}" ]] ; then
333 einfo "TERM is set to: \"${TERM}\""
335 einfo "TERM is unset."
338 if use clang && ! tc-is-clang ; then
340 einfo "Enforcing the use of clang due to USE=clang ..."
343 strip-unsupported-flags
344 elif ! use clang && ! tc-is-gcc ; then
346 einfo "Enforcing the use of gcc due to USE=-clang ..."
349 strip-unsupported-flags
352 ####################################
354 # mozconfig, CFLAGS and CXXFLAGS setup
356 ####################################
359 # common config components
360 mozconfig_annotate 'system_libs' \
364 # Must pass release in order to properly select linker
365 mozconfig_annotate 'Enable by Gentoo' --enable-release
368 if ! has userpriv $FEATURES ; then
369 eerror "Building firefox with USE=pgo and FEATURES=-userpriv is not supported!"
373 # Don't let user's LTO flags clash with upstream's flags
377 local show_old_compiler_warning=
380 # At this stage CC is adjusted and the following check will
382 if [[ $(clang-major-version) -lt 7 ]] ; then
383 show_old_compiler_warning=1
386 # Upstream only supports lld when using clang
387 mozconfig_annotate "forcing ld=lld due to USE=clang and USE=lto" --enable-linker=lld
389 if [[ $(gcc-major-version) -lt 8 ]] ; then
390 show_old_compiler_warning=1
394 append-cxxflags -flto
396 if ! use cpu_flags_x86_avx2 ; then
397 local _gcc_version_with_ipa_cdtor_fix="8.3"
398 local _current_gcc_version="$(gcc-major-version).$(gcc-minor-version)"
400 if ver_test "${_current_gcc_version}" -lt "${_gcc_version_with_ipa_cdtor_fix}" ; then
401 # due to a GCC bug, GCC will produce AVX2 instructions
402 # even if the CPU doesn't support AVX2, https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01142.html
403 einfo "Disable IPA cdtor due to bug in GCC and missing AVX2 support -- triggered by USE=lto"
404 append-ldflags -fdisable-ipa-cdtor
406 einfo "No GCC workaround required, GCC version is already patched!"
409 einfo "No GCC workaround required, system supports AVX2"
412 # Linking only works when using ld.gold when LTO is enabled
413 mozconfig_annotate "forcing ld=gold due to USE=lto" --enable-linker=gold
416 if [[ -n "${show_old_compiler_warning}" ]] ; then
417 # Checking compiler's major version uses CC variable. Because we allow
418 # user to control used compiler via USE=clang flag, we cannot use
419 # initial value. So this is the earliest stage where we can do this check
420 # because pkg_pretend is not called in the main phase function sequence
421 # environment saving is not guaranteed so we don't know if we will have
422 # correct compiler until now.
424 ewarn "USE=lto requires up-to-date compiler (>=gcc-8 or >=clang-7)."
425 ewarn "You are on your own -- expect build failures. Don't file bugs using that unsupported configuration!"
430 mozconfig_annotate '+lto' --enable-lto=thin
433 mozconfig_annotate '+pgo' MOZ_PGO=1
436 # Avoid auto-magic on linker
438 # This is upstream's default
439 mozconfig_annotate "forcing ld=lld due to USE=clang" --enable-linker=lld
440 elif tc-ld-is-gold ; then
441 mozconfig_annotate "linker is set to gold" --enable-linker=gold
443 mozconfig_annotate "linker is set to bfd" --enable-linker=bfd
447 # It doesn't compile on alpha without this LDFLAGS
448 use alpha && append-ldflags "-Wl,--no-relax"
450 # Add full relro support for hardened
451 if use hardened ; then
452 append-ldflags "-Wl,-z,relro,-z,now"
453 mozconfig_use_enable hardened hardening
456 # Modifications to better support ARM, bug 553364
457 if use cpu_flags_arm_neon ; then
458 mozconfig_annotate '' --with-fpu=neon
460 if ! tc-is-clang ; then
461 # thumb options aren't supported when using clang, bug 666966
462 mozconfig_annotate '' --with-thumb=yes
463 mozconfig_annotate '' --with-thumb-interwork=no
467 if [[ ${CHOST} == armv*h* ]] ; then
468 mozconfig_annotate '' --with-float-abi=hard
469 if ! use system-libvpx ; then
470 sed -i -e "s|softfp|hard|" \
471 "${S}"/media/libvpx/moz.build
475 mozconfig_use_enable !bindist official-branding
477 mozconfig_use_enable debug
478 mozconfig_use_enable debug tests
479 if ! use debug ; then
480 mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
482 mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
484 # These are enabled by default in all mozilla applications
485 mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
486 mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
487 mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include \
488 --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
489 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
490 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
491 mozconfig_annotate '' --disable-crashreporter
492 mozconfig_annotate 'Gentoo default' --with-system-png
493 mozconfig_annotate '' --enable-system-ffi
494 mozconfig_annotate '' --disable-gconf
495 mozconfig_annotate '' --with-intl-api
496 mozconfig_annotate '' --enable-system-pixman
497 # Instead of the standard --build= and --host=, mozilla uses --host instead
498 # of --build, and --target intstead of --host.
499 # Note, mozilla also has --build but it does not do what you think it does.
500 # Set both --target and --host as mozilla uses python to guess values otherwise
501 mozconfig_annotate '' --target="${CHOST}"
502 mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
503 if use system-libevent ; then
504 mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
507 if ! use x86 && [[ ${CHOST} != armv*h* ]] ; then
508 mozconfig_annotate '' --enable-rust-simd
511 # use the gtk3 toolkit (the only one supported at this point)
512 # TODO: Will this result in automagic dependency on x11-libs/gtk+[wayland]?
513 if use wayland ; then
514 mozconfig_annotate '' --enable-default-toolkit=cairo-gtk3-wayland
516 mozconfig_annotate '' --enable-default-toolkit=cairo-gtk3
519 mozconfig_use_enable startup-notification
520 mozconfig_use_enable system-sqlite
521 mozconfig_use_with system-av1
522 mozconfig_use_with system-harfbuzz
523 mozconfig_use_with system-harfbuzz system-graphite2
524 mozconfig_use_with system-icu
525 mozconfig_use_with system-jpeg
526 mozconfig_use_with system-libvpx
527 mozconfig_use_with system-webp
528 mozconfig_use_enable pulseaudio
529 # force the deprecated alsa sound code if pulseaudio is disabled
530 if use kernel_linux && ! use pulseaudio ; then
531 mozconfig_annotate '-pulseaudio' --enable-alsa
534 # Disable built-in ccache support to avoid sandbox violation, #665420
535 # Use FEATURES=ccache instead!
536 mozconfig_annotate '' --without-ccache
537 sed -i -e 's/ccache_stats = None/return None/' \
538 python/mozbuild/mozbuild/controller/building.py || \
539 die "Failed to disable ccache stats call"
541 mozconfig_use_enable dbus
543 mozconfig_use_enable wifi necko-wifi
545 # enable JACK, bug 600002
546 mozconfig_use_enable jack
548 # Other tb-specific settings
549 mozconfig_annotate '' --with-user-appdir=.thunderbird
550 mozconfig_annotate '' --enable-ldap
551 mozconfig_annotate '' --enable-calendar
553 # Enable/Disable eme support
554 use eme-free && mozconfig_annotate '+eme-free' --disable-eme
556 # Setup api key for location services and safebrowsing, https://bugzilla.mozilla.org/show_bug.cgi?id=1531176#c34
557 echo -n "${_google_api_key}" > "${S}"/google-api-key
558 mozconfig_annotate '' --with-google-location-service-api-keyfile="${S}/google-api-key"
559 mozconfig_annotate '' --with-google-safebrowsing-api-keyfile="${S}/google-api-key"
561 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
563 # allow elfhack to work in combination with unstripped binaries
564 # when they would normally be larger than 2GiB.
565 append-ldflags "-Wl,--compress-debug-sections=zlib"
568 # https://bugzilla.mozilla.org/show_bug.cgi?id=1482204
569 # https://bugzilla.mozilla.org/show_bug.cgi?id=1483822
570 mozconfig_annotate 'elf-hack is broken when using Clang' --disable-elf-hack
573 echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
574 echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig
576 # Finalize and report settings
579 mkdir -p "${S}"/third_party/rust/libloading/.deps
581 # workaround for funky/broken upstream configure...
582 SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
583 ./mach configure || die
591 # Reset and cleanup environment variables used by GNOME/XDG
592 gnome2_environment_reset
595 addpredict /etc/gconf
599 MOZ_MAKE_FLAGS="${MAKEOPTS} -O" \
600 SHELL="${SHELL:-${EPREFIX}/bin/bash}" \
603 ./mach build --verbose \
608 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
609 cd "${BUILD_OBJ_DIR}" || die
611 # Pax mark xpcshell for hardened support, only used for startupcache creation.
612 pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
614 # Copy our preference before omnijar is created.
615 cp "${FILESDIR}"/thunderbird-gentoo-default-prefs.js-2 \
616 "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \
619 # set dictionary path, to use system hunspell
620 echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
621 >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
623 # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
624 if use system-harfbuzz ; then
625 echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
626 >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
629 # force cairo as the canvas renderer on platforms without skia support
630 if [[ $(tc-endian) == "big" ]] ; then
631 echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \
632 >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
633 echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \
634 >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
637 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
638 "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \
642 use gmp-autoupdate || use eme-free || for plugin in "${GMP_PLUGIN_LIST[@]}" ; do
643 echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
644 "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \
649 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
650 DESTDIR="${D}" ./mach install || die
652 # Install language packs
653 MOZ_INSTALL_L10N_XPIFILE="1" mozlinguas_src_install
655 local size sizes icon_path icon
656 if ! use bindist; then
657 icon_path="${S}/comm/mail/branding/thunderbird"
660 domenu "${FILESDIR}"/icon/${PN}.desktop
662 icon_path="${S}/comm/mail/branding/nightly"
663 icon="${PN}-icon-unbranded"
665 newmenu "${FILESDIR}"/icon/${PN}-unbranded.desktop \
668 sed -i -e "s:Mozilla\ Thunderbird:EarlyBird:g" \
669 "${ED}"/usr/share/applications/${PN}.desktop
672 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
673 newicon "${icon_path}"/default48.png "${icon}".png
674 # Install icons for menu entry
675 sizes="16 22 24 32 48 256"
676 for size in ${sizes}; do
677 newicon -s ${size} "${icon_path}/default${size}.png" "${icon}.png"
680 # Disable built-in auto-update because we update firefox through package manager
681 insinto ${MOZILLA_FIVE_HOME}/distribution/
682 newins "${FILESDIR}"/disable-auto-update.policy.json policies.json
684 # Add StartupNotify=true bug 237317
685 if use startup-notification ; then
686 echo "StartupNotify=true"\
687 >> "${ED}/usr/share/applications/${PN}.desktop" \
691 # Don't install llvm-symbolizer from sys-devel/llvm package
692 [[ -f "${ED%/}${MOZILLA_FIVE_HOME}/llvm-symbolizer" ]] && \
693 rm "${ED%/}${MOZILLA_FIVE_HOME}/llvm-symbolizer"
696 # stage extra locales for lightning and install over existing
697 emid='{e2fda1a4-762b-4020-b5ad-a41df1933103}'
698 rm -f "${ED}"/${MOZILLA_FIVE_HOME}/distribution/extensions/${emid}.xpi || die
699 mozlinguas_xpistage_langpacks "${BUILD_OBJ_DIR}"/dist/bin/distribution/extensions/${emid} \
700 "${WORKDIR}"/lightning-${MOZ_LIGHTNING_VER} lightning calendar
702 mkdir -p "${T}/${emid}" || die
703 cp -RLp -t "${T}/${emid}" "${BUILD_OBJ_DIR}"/dist/bin/distribution/extensions/${emid}/* || die
704 insinto ${MOZILLA_FIVE_HOME}/distribution/extensions
705 doins -r "${T}/${emid}"
707 if use lightning; then
708 # move lightning out of distribution/extensions and into extensions for app-global install
709 mkdir -p "${ED}"/${MOZILLA_FIVE_HOME}/extensions
710 mv "${ED}"/${MOZILLA_FIVE_HOME}/{distribution,}/extensions/${emid} || die
712 # stage extra locales for gdata-provider and install app-global
713 mozlinguas_xpistage_langpacks "${BUILD_OBJ_DIR}"/dist/xpi-stage/gdata-provider \
714 "${WORKDIR}"/gdata-provider-${MOZ_LIGHTNING_GDATA_VER}
715 emid='{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}'
716 mkdir -p "${T}/${emid}" || die
717 cp -RLp -t "${T}/${emid}" "${BUILD_OBJ_DIR}"/dist/xpi-stage/gdata-provider/* || die
719 # manifest.json does not allow the addon to load, put install.rdf in place
720 # note, version number needs to be set properly
721 cp -RLp -t "${T}/${emid}" "${WORKDIR}"/gdata-provider-${MOZ_LIGHTNING_GDATA_VER}/install.rdf
722 sed -i -e '/em:version/ s/>[^<]*</>4.1</' "${T}/${emid}"/install.rdf
724 insinto ${MOZILLA_FIVE_HOME}/extensions
725 doins -r "${T}/${emid}"
728 # thunderbird and thunderbird-bin are identical
729 rm "${ED%/}"${MOZILLA_FIVE_HOME}/thunderbird-bin || die
730 dosym thunderbird ${MOZILLA_FIVE_HOME}/thunderbird-bin
732 # Required in order to use plugins and even run thunderbird on hardened.
733 pax-mark pm "${ED%/}"${MOZILLA_FIVE_HOME}/{thunderbird,plugin-container}
737 # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
738 # doesn't need to be forced into the LD_LIBRARY_PATH
739 if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
740 einfo "APULSE found - Generating library symlinks for sound support"
742 pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
743 for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
744 # a quickpkg rolled by hand will grab symlinks as part of the package,
745 # so we need to avoid creating them if they already exist.
746 if [[ ! -L ${lib##*/} ]] ; then
747 ln -s "${lib}" ${lib##*/} || die
750 popd &>/dev/null || die
755 xdg_desktop_database_update
756 xdg_icon_cache_update
758 if ! use gmp-autoupdate && ! use eme-free ; then
759 elog "USE='-gmp-autoupdate' has disabled the following plugins from updating or"
760 elog "installing into new profiles:"
762 for plugin in "${GMP_PLUGIN_LIST[@]}"; do elog "\t ${plugin}" ; done
766 if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
767 elog "Apulse was detected at merge time on this system and so it will always be"
768 elog "used for sound. If you wish to use pulseaudio instead please unmerge"
769 elog "media-sound/apulse."
775 xdg_desktop_database_update
776 xdg_icon_cache_update