Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-client/thunderbird/
Date: Mon, 05 Sep 2016 19:23:39
Message-Id: 1473102973.38e3dd28440f87b936d312e4508eb1790e31f061.anarchy@gentoo
1 commit: 38e3dd28440f87b936d312e4508eb1790e31f061
2 Author: Chris Mayo <aklhfex <AT> gmail <DOT> com>
3 AuthorDate: Mon Sep 5 18:35:55 2016 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 5 19:16:13 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38e3dd28
7
8 mail-client/thunderbird: Install icons into hicolor theme
9
10 Based on www-client/firefox ebuild.
11
12 Gentoo-Bug: https://bugs.gentoo.org/464010
13 Closes: https://github.com/gentoo/gentoo/pull/1928
14
15 Signed-off-by: Jory A. Pratt <anarchy <AT> gentoo.org>
16
17 .../thunderbird/thunderbird-45.3.0-r1.ebuild | 390 +++++++++++++++++++++
18 1 file changed, 390 insertions(+)
19
20 diff --git a/mail-client/thunderbird/thunderbird-45.3.0-r1.ebuild b/mail-client/thunderbird/thunderbird-45.3.0-r1.ebuild
21 new file mode 100644
22 index 00000000..6c529cb
23 --- /dev/null
24 +++ b/mail-client/thunderbird/thunderbird-45.3.0-r1.ebuild
25 @@ -0,0 +1,390 @@
26 +# Copyright 1999-2016 Gentoo Foundation
27 +# Distributed under the terms of the GNU General Public License v2
28 +# $Id$
29 +
30 +EAPI=6
31 +WANT_AUTOCONF="2.1"
32 +MOZ_ESR=""
33 +MOZ_LIGHTNING_VER="4.7.3"
34 +MOZ_LIGHTNING_GDATA_VER="2.6"
35 +
36 +# This list can be updated using scripts/get_langs.sh from the mozilla overlay
37 +MOZ_LANGS=(ar ast be bg bn-BD br ca cs cy da de el en en-GB en-US es-AR
38 +es-ES et eu fi fr fy-NL ga-IE gd gl he hr hsb hu hy-AM id is it ja ko lt
39 +nb-NO nl nn-NO pa-IN pl pt-BR pt-PT rm ro ru si sk sl sq sr sv-SE ta-LK tr
40 +uk vi zh-CN zh-TW )
41 +
42 +# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
43 +MOZ_PV="${PV/_beta/b}"
44 +# ESR releases have slightly version numbers
45 +if [[ ${MOZ_ESR} == 1 ]]; then
46 + MOZ_PV="${MOZ_PV}esr"
47 +fi
48 +MOZ_P="${PN}-${MOZ_PV}"
49 +
50 +# Enigmail version
51 +EMVER="1.9.1"
52 +
53 +# Patches
54 +PATCH="thunderbird-38.0-patches-0.1"
55 +PATCHFF="firefox-45.0-patches-04"
56 +
57 +MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases"
58 +
59 +MOZCONFIG_OPTIONAL_JIT="enabled"
60 +inherit flag-o-matic toolchain-funcs mozconfig-v6.45 makeedit autotools pax-utils check-reqs nsplugins mozlinguas-v2 fdo-mime gnome2-utils
61 +
62 +DESCRIPTION="Thunderbird Mail Client"
63 +HOMEPAGE="http://www.mozilla.com/en-US/thunderbird/"
64 +
65 +KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
66 +SLOT="0"
67 +LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
68 +IUSE="bindist crypt hardened ldap lightning +minimal mozdom selinux"
69 +RESTRICT="!bindist? ( bindist )"
70 +
71 +PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/{${PATCH},${PATCHFF}}.tar.xz )
72 +SRC_URI="${SRC_URI}
73 + ${MOZ_HTTP_URI}/${MOZ_PV}/source/${MOZ_P}.source.tar.xz
74 + https://dev.gentoo.org/~axs/distfiles/lightning-${MOZ_LIGHTNING_VER}.tar.xz
75 + lightning? ( https://dev.gentoo.org/~axs/distfiles/gdata-provider-${MOZ_LIGHTNING_GDATA_VER}-r1.tar.xz )
76 + crypt? ( http://www.enigmail.net/download/source/enigmail-${EMVER}.tar.gz )
77 + ${PATCH_URIS[@]}"
78 +
79 +ASM_DEPEND=">=dev-lang/yasm-1.1"
80 +
81 +CDEPEND="
82 + >=dev-libs/nss-3.21.1
83 + >=dev-libs/nspr-4.12
84 + !x11-plugins/enigmail
85 + crypt? ( || (
86 + ( >=app-crypt/gnupg-2.0
87 + || (
88 + app-crypt/pinentry[gtk(-)]
89 + app-crypt/pinentry[qt4(-)]
90 + app-crypt/pinentry[qt5(-)]
91 + )
92 + )
93 + =app-crypt/gnupg-1.4*
94 + ) )"
95 +
96 +DEPEND="${CDEPEND}
97 + amd64? ( ${ASM_DEPEND}
98 + virtual/opengl )
99 + x86? ( ${ASM_DEPEND}
100 + virtual/opengl )"
101 +
102 +RDEPEND="${CDEPEND}
103 + selinux? ( sec-policy/selinux-thunderbird )
104 +"
105 +
106 +S="${WORKDIR}/${MOZ_P}"
107 +
108 +BUILD_OBJ_DIR="${S}/tbird"
109 +
110 +pkg_setup() {
111 + moz_pkgsetup
112 +
113 + export MOZILLA_DIR="${S}/mozilla"
114 +
115 + if ! use bindist ; then
116 + elog "You are enabling official branding. You may not redistribute this build"
117 + elog "to any users on your network or the internet. Doing so puts yourself into"
118 + elog "a legal problem with Mozilla Foundation"
119 + elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
120 + elog
121 + fi
122 +}
123 +
124 +pkg_pretend() {
125 + # Ensure we have enough disk space to compile
126 + CHECKREQS_DISK_BUILD="4G"
127 + check-reqs_pkg_setup
128 +
129 + if use jit && [[ -n ${PROFILE_IS_HARDENED} ]]; then
130 + ewarn "You are emerging this package on a hardened profile with USE=jit enabled."
131 + ewarn "This is horribly insecure as it disables all PAGEEXEC restrictions."
132 + ewarn "Please ensure you know what you are doing. If you don't, please consider"
133 + ewarn "emerging the package with USE=-jit"
134 + fi
135 +}
136 +
137 +src_unpack() {
138 + unpack ${A}
139 +
140 + # Unpack language packs
141 + mozlinguas_src_unpack
142 +
143 + # this version of lightning is a .tar.xz, no xpi needed
144 + #xpi_unpack lightning-${MOZ_LIGHTNING_VER}.xpi
145 +
146 + # this version of gdata-provider is a .tar.xz , no xpi needed
147 + #use lightning && xpi_unpack gdata-provider-${MOZ_LIGHTNING_GDATA_VER}.xpi
148 +}
149 +
150 +src_prepare() {
151 + # Apply our Thunderbird patchset
152 + rm -f "${WORKDIR}"/thunderbird/2001_ldap_respect_cflags.patch
153 + eapply "${WORKDIR}/thunderbird"
154 +
155 + # Apply our patchset from firefox to thunderbird as well
156 + pushd "${S}"/mozilla &>/dev/null || die
157 + eapply "${WORKDIR}/firefox"
158 + popd &>/dev/null || die
159 +
160 + # Ensure that are plugins dir is enabled as default
161 + sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
162 + "${S}"/mozilla/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
163 + sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
164 + "${S}"/mozilla/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
165 +
166 + # Don't exit with error when some libs are missing which we have in
167 + # system.
168 + sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
169 + -i "${S}"/mail/installer/Makefile.in || die
170 +
171 + # Don't error out when there's no files to be removed:
172 + sed 's@\(xargs rm\)$@\1 -f@' \
173 + -i "${S}"/mozilla/toolkit/mozapps/installer/packager.mk || die
174 +
175 + # Shell scripts sometimes contain DOS line endings; bug 391889
176 + grep -rlZ --include="*.sh" $'\r$' . |
177 + while read -r -d $'\0' file ; do
178 + einfo edos2unix "${file}"
179 + edos2unix "${file}"
180 + done
181 +
182 + # Allow user to apply any additional patches without modifing ebuild
183 + eapply_user
184 +
185 + # Confirm the version of lightning being grabbed for langpacks is the same
186 + # as that used in thunderbird
187 + local THIS_MOZ_LIGHTNING_VER=$(python "${S}"/calendar/lightning/build/makeversion.py ${PV})
188 + if [[ ${MOZ_LIGHTNING_VER} != ${THIS_MOZ_LIGHTNING_VER} ]]; then
189 + eqawarn "The version of lightning used for localization differs from the version"
190 + eqawarn "in thunderbird. Please update MOZ_LIGHTNING_VER in the ebuild from ${MOZ_LIGHTNING_VER}"
191 + eqawarn "to ${THIS_MOZ_LIGHTNING_VER}"
192 + fi
193 +
194 + eautoreconf
195 + # Ensure we run eautoreconf in mozilla to regenerate configure
196 + cd "${S}"/mozilla || die
197 + eautoconf
198 + cd "${S}"/mozilla/js/src || die
199 + eautoconf
200 +}
201 +
202 +src_configure() {
203 + MEXTENSIONS="default"
204 +
205 + ####################################
206 + #
207 + # mozconfig, CFLAGS and CXXFLAGS setup
208 + #
209 + ####################################
210 +
211 + mozconfig_init
212 + mozconfig_config
213 +
214 + # It doesn't compile on alpha without this LDFLAGS
215 + use alpha && append-ldflags "-Wl,--no-relax"
216 +
217 + # Add full relro support for hardened
218 + use hardened && append-ldflags "-Wl,-z,relro,-z,now"
219 +
220 + mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
221 + mozconfig_annotate '' --disable-mailnews
222 + mozconfig_annotate '' --enable-calendar
223 +
224 + # Other tb-specific settings
225 + mozconfig_annotate '' --with-user-appdir=.thunderbird
226 +
227 + mozconfig_use_enable ldap
228 +
229 + mozlinguas_mozconfig
230 +
231 + # Bug #72667
232 + if use mozdom; then
233 + MEXTENSIONS="${MEXTENSIONS},inspector"
234 + fi
235 +
236 + # Use an objdir to keep things organized.
237 + echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
238 +
239 + # Finalize and report settings
240 + mozconfig_final
241 +
242 + ####################################
243 + #
244 + # Configure and build
245 + #
246 + ####################################
247 +
248 + # Disable no-print-directory
249 + MAKEOPTS=${MAKEOPTS/--no-print-directory/}
250 +
251 + if [[ $(gcc-major-version) -lt 4 ]]; then
252 + append-cxxflags -fno-stack-protector
253 + fi
254 +
255 + if use crypt; then
256 + pushd "${WORKDIR}"/enigmail &>/dev/null ||die
257 + econf
258 + popd &>/dev/null ||die
259 + fi
260 +}
261 +
262 +src_compile() {
263 + mkdir -p "${BUILD_OBJ_DIR}" && cd "${BUILD_OBJ_DIR}" || die
264 +
265 + CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
266 + MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
267 + emake -f "${S}"/client.mk
268 +
269 + # Only build enigmail extension if crypt enabled.
270 + if use crypt ; then
271 + einfo "Building enigmail"
272 + pushd "${WORKDIR}"/enigmail &>/dev/null || die
273 + emake -j1
274 + emake -j1 xpi
275 + popd &>/dev/null || die
276 + fi
277 +}
278 +
279 +src_install() {
280 + declare emid
281 + cd "${BUILD_OBJ_DIR}" || die
282 +
283 + # Copy our preference before omnijar is created.
284 + cp "${FILESDIR}"/thunderbird-gentoo-default-prefs-1.js-1 \
285 + "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \
286 + || die
287 +
288 + mozconfig_install_prefs \
289 + "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js"
290 +
291 + # dev-db/sqlite does not have FTS3_TOKENIZER support.
292 + # gloda needs it to function, and bad crashes happen when its enabled and doesn't work
293 + if in_iuse system-sqlite && use system-sqlite ; then
294 + echo "lockPref(\"mailnews.database.global.indexer.enabled\", false);" \
295 + >>"${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" || die
296 + fi
297 +
298 + # Pax mark xpcshell for hardened support, only used for startupcache creation.
299 + pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
300 +
301 + MOZ_MAKE_FLAGS="${MAKEOPTS}" \
302 + emake DESTDIR="${D}" install
303 +
304 + # Install language packs
305 + mozlinguas_src_install
306 +
307 + local size sizes icon_path icon
308 + if ! use bindist; then
309 + icon_path="${S}/other-licenses/branding/thunderbird"
310 + icon="${PN}-icon"
311 +
312 + domenu "${FILESDIR}"/icon/${PN}.desktop
313 + else
314 + icon_path="${S}/mail/branding/aurora"
315 + icon="${PN}-icon-unbranded"
316 +
317 + newmenu "${FILESDIR}"/icon/${PN}-unbranded.desktop \
318 + ${PN}.desktop
319 +
320 + sed -i -e "s:Mozilla\ Thunderbird:EarlyBird:g" \
321 + "${ED}"/usr/share/applications/${PN}.desktop
322 + fi
323 +
324 + # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
325 + newicon "${icon_path}"/mailicon48.png "${icon}".png
326 + # Install icons for menu entry
327 + sizes="16 22 24 32 48 256"
328 + for size in ${sizes}; do
329 + newicon -s ${size} "${icon_path}/mailicon${size}.png" "${icon}.png"
330 + done
331 +
332 + local emid
333 + # stage extra locales for lightning and install over existing
334 + mozlinguas_xpistage_langpacks "${BUILD_OBJ_DIR}"/dist/xpi-stage/lightning \
335 + "${WORKDIR}"/lightning-${MOZ_LIGHTNING_VER} lightning calendar
336 +
337 + emid='{e2fda1a4-762b-4020-b5ad-a41df1933103}'
338 + mkdir -p "${T}/${emid}" || die
339 + cp -RLp -t "${T}/${emid}" "${BUILD_OBJ_DIR}"/dist/xpi-stage/lightning/* || die
340 + insinto ${MOZILLA_FIVE_HOME}/distribution/extensions
341 + doins -r "${T}/${emid}"
342 +
343 + if use lightning; then
344 + # move lightning out of distribution/extensions and into extensions for app-global install
345 + mv "${ED}"/${MOZILLA_FIVE_HOME}/{distribution,}/extensions/${emid} || die
346 +
347 + # stage extra locales for gdata-provider and install app-global
348 + mozlinguas_xpistage_langpacks "${BUILD_OBJ_DIR}"/dist/xpi-stage/gdata-provider \
349 + "${WORKDIR}"/gdata-provider-${MOZ_LIGHTNING_GDATA_VER}
350 + emid='{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}'
351 + mkdir -p "${T}/${emid}" || die
352 + cp -RLp -t "${T}/${emid}" "${BUILD_OBJ_DIR}"/dist/xpi-stage/gdata-provider/* || die
353 + insinto ${MOZILLA_FIVE_HOME}/extensions
354 + doins -r "${T}/${emid}"
355 + fi
356 +
357 + if use crypt ; then
358 + local enigmail_xpipath="${WORKDIR}/enigmail/build"
359 + cd "${T}" || die
360 + unzip "${enigmail_xpipath}"/enigmail*.xpi install.rdf || die
361 + emid=$(sed -n '/<em:id>/!d; s/.*\({.*}\).*/\1/; p; q' install.rdf)
362 +
363 + dodir ${MOZILLA_FIVE_HOME}/extensions/${emid} || die
364 + cd "${ED}"${MOZILLA_FIVE_HOME}/extensions/${emid} || die
365 + unzip "${enigmail_xpipath}"/enigmail*.xpi || die
366 + fi
367 +
368 + # Required in order for jit to work on hardened, for mozilla-31 and above
369 + use jit && pax-mark pm "${ED}"${MOZILLA_FIVE_HOME}/{thunderbird,thunderbird-bin}
370 +
371 + # Plugin-container needs to be pax-marked for hardened to ensure plugins such as flash
372 + # continue to work as expected.
373 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
374 +
375 + if use minimal; then
376 + rm -r "${ED}"/usr/include "${ED}"${MOZILLA_FIVE_HOME}/{idl,include,lib,sdk} || \
377 + die "Failed to remove sdk and headers"
378 + fi
379 +}
380 +
381 +pkg_preinst() {
382 + gnome2_icon_savelist
383 +}
384 +
385 +pkg_postinst() {
386 + fdo-mime_desktop_database_update
387 + gnome2_icon_cache_update
388 +
389 + if use crypt; then
390 + local peimpl=$(eselect --brief --colour=no pinentry show)
391 + case "${peimpl}" in
392 + *gtk*|*qt*) ;;
393 + *) ewarn "The pinentry front-end currently selected is not one supported by thunderbird."
394 + ewarn "You may be prompted for your password in an inaccessible shell!!"
395 + ewarn "Please use 'eselect pinentry' to select either the gtk or qt front-end"
396 + ;;
397 + esac
398 + fi
399 + elog
400 + elog "If you experience problems with plugins please issue the"
401 + elog "following command : rm \${HOME}/.thunderbird/*/extensions.sqlite ,"
402 + elog "then restart thunderbird"
403 + if ! use lightning; then
404 + elog
405 + elog "If calendar fails to show up in extensions please open config editor"
406 + elog "and set extensions.lastAppVersion to 38.0.0 to force a reload. If this"
407 + elog "fails to show the calendar extension after restarting with above change"
408 + elog "please file a bug report."
409 + fi
410 +}
411 +
412 +pkg_postrm() {
413 + fdo-mime_desktop_database_update
414 + gnome2_icon_cache_update
415 +}