/[gentoo-x86]/mail-client/thunderbird/thunderbird-15.0.ebuild
Gentoo

Contents of /mail-client/thunderbird/thunderbird-15.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Sep 12 22:57:55 2012 UTC (8 months, 1 week ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Bumped thunderbird-15.0 to thunderbird-15.0.1. As it's a privacy relevant bug fix

(Portage version: 2.1.11.16/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/mail-client/thunderbird/thunderbird-15.0.ebuild,v 1.1 2012/09/01 23:29:58 anarchy Exp $
4
5 EAPI="3"
6 WANT_AUTOCONF="2.1"
7 MOZ_ESR=""
8
9 # This list can be updated using scripts/get_langs.sh from the mozilla overlay
10 MOZ_LANGS=(ar ast be bg bn-BD br ca cs da de el en en-GB en-US es-AR
11 es-ES et eu fi fr fy-NL ga-IE gd gl he hr hu hy-AM id is it ja ko lt nb-NO
12 nl nn-NO pa-IN pl pt-BR pt-PT rm ro ru si sk sl sq sr sv-SE ta-LK tr uk vi
13 zh-CN zh-TW )
14
15 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
16 MOZ_PV="${PV/_beta/b}"
17 # ESR releases have slightly version numbers
18 if [[ ${MOZ_ESR} == 1 ]]; then
19 MOZ_PV="${MOZ_PV}esr"
20 fi
21 MOZ_P="${PN}-${MOZ_PV}"
22
23 # Enigmail version
24 EMVER="1.4.4"
25 # Upstream ftp release URI that's used by mozlinguas.eclass
26 # We don't use the http mirror because it deletes old tarballs.
27 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
28
29 inherit flag-o-matic toolchain-funcs mozconfig-3 makeedit multilib autotools pax-utils python check-reqs nsplugins mozlinguas
30
31 DESCRIPTION="Thunderbird Mail Client"
32 HOMEPAGE="http://www.mozilla.com/en-US/thunderbird/"
33
34 KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
35 SLOT="0"
36 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
37 IUSE="bindist gconf +crypt +ipc +jit +lightning +minimal mozdom +webm selinux"
38
39 PATCH="thunderbird-13.0-patches-0.1"
40 PATCHFF="firefox-15.0-patches-0.2"
41
42 SRC_URI="${SRC_URI}
43 ${MOZ_FTP_URI}${MOZ_PV}/source/${MOZ_P}.source.tar.bz2
44 crypt? ( http://www.mozilla-enigmail.org/download/source/enigmail-${EMVER}.tar.gz )
45 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
46 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCHFF}.tar.xz
47 http://dev.gentoo.org/~nirbheek/mozilla/patchsets/${PATCHFF}.tar.xz"
48
49 ASM_DEPEND=">=dev-lang/yasm-1.1"
50
51 RDEPEND=">=sys-devel/binutils-2.16.1
52 >=dev-libs/nss-3.13.6
53 >=dev-libs/nspr-4.9.2
54 >=dev-libs/glib-2.26
55 gconf? ( >=gnome-base/gconf-1.2.1:2 )
56 >=media-libs/libpng-1.5.9[apng]
57 >=x11-libs/cairo-1.10
58 >=x11-libs/pango-1.14.0
59 >=x11-libs/gtk+-2.14
60 webm? ( >=media-libs/libvpx-1.0.0
61 kernel_linux? ( media-libs/alsa-lib ) )
62 virtual/libffi
63 !x11-plugins/enigmail
64 system-sqlite? ( >=dev-db/sqlite-3.7.10[fts3,secure-delete,threadsafe,unlock-notify,debug=] )
65 selinux? ( sec-policy/selinux-thunderbird )
66 crypt? ( || (
67 ( >=app-crypt/gnupg-2.0
68 || (
69 app-crypt/pinentry[gtk]
70 app-crypt/pinentry[qt4]
71 )
72 )
73 =app-crypt/gnupg-1.4*
74 ) )"
75
76 DEPEND="${RDEPEND}
77 !elibc_glibc? ( dev-libs/libexecinfo )
78 virtual/pkgconfig
79 webm? ( x86? ( ${ASM_DEPEND} )
80 amd64? ( ${ASM_DEPEND} )
81 virtual/opengl )"
82
83 if [[ ${PV} =~ beta ]]; then
84 S="${WORKDIR}/comm-beta"
85 elif [[ ${MOZ_ESR} == 1 ]]; then
86 S="${WORKDIR}/comm-esr${PV%%.*}"
87 else
88 S="${WORKDIR}/comm-release"
89 fi
90
91 pkg_setup() {
92 moz_pkgsetup
93
94 export MOZILLA_DIR="${S}/mozilla"
95
96 if ! use bindist ; then
97 elog "You are enabling official branding. You may not redistribute this build"
98 elog "to any users on your network or the internet. Doing so puts yourself into"
99 elog "a legal problem with Mozilla Foundation"
100 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
101 elog
102 fi
103
104 # Ensure we have enough disk space to compile
105 CHECKREQS_DISK_BUILD="4G"
106 check-reqs_pkg_setup
107 }
108
109 src_unpack() {
110 unpack ${A}
111
112 # Unpack language packs
113 mozlinguas_src_unpack
114 }
115
116 src_prepare() {
117 # Apply our Thunderbird patchset
118 EPATCH_SUFFIX="patch" \
119 EPATCH_FORCE="yes" \
120 epatch "${WORKDIR}/thunderbird"
121
122 # Apply our patchset from firefox to thunderbird as well
123 pushd "${S}"/mozilla &>/dev/null || die
124 EPATCH_SUFFIX="patch" \
125 EPATCH_FORCE="yes" \
126 epatch "${WORKDIR}/firefox"
127 popd &>/dev/null || die
128
129 if use crypt ; then
130 mv "${WORKDIR}"/enigmail "${S}"/mailnews/extensions/enigmail
131 cd "${S}"
132 fi
133
134 # Disable gnomevfs extension
135 sed -i -e "s:gnomevfs::" "${S}/"mozilla/browser/confvars.sh \
136 -e "s:gnomevfs::" "${S}/"mozilla/xulrunner/confvars.sh \
137 || die "Failed to remove gnomevfs extension"
138
139 #Fix compilation with curl-7.21.7 bug 376027
140 sed -e '/#include <curl\/types.h>/d' \
141 -i "${S}"/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc \
142 -i "${S}"/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc \
143 -i "${S}"/mozilla/config/system-headers \
144 -i "${S}"/mozilla/js/src/config/system-headers || die "Sed failed"
145
146 # Don't error out when there's no files to be removed:
147 sed 's@\(xargs rm\)$@\1 -f@' \
148 -i "${S}"/mozilla/toolkit/mozapps/installer/packager.mk || die
149
150 # Shell scripts sometimes contain DOS line endings; bug 391889
151 grep -rlZ --include="*.sh" $'\r$' . |
152 while read -r -d $'\0' file ; do
153 einfo edos2unix "${file}"
154 edos2unix "${file}"
155 done
156
157 # Allow user to apply any additional patches without modifing ebuild
158 epatch_user
159
160 eautoreconf
161 # Ensure we run eautoreconf in mozilla to regenerate configure
162 cd "${S}"/mozilla
163 eautoconf
164 }
165
166 src_configure() {
167 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
168 MEXTENSIONS="default"
169
170 ####################################
171 #
172 # mozconfig, CFLAGS and CXXFLAGS setup
173 #
174 ####################################
175
176 mozconfig_init
177 mozconfig_config
178
179 # It doesn't compile on alpha without this LDFLAGS
180 use alpha && append-ldflags "-Wl,--no-relax"
181
182 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
183 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
184 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
185 mozconfig_annotate '' --with-default-mozilla-five-home="${EPREFIX}${MOZILLA_FIVE_HOME}"
186 mozconfig_annotate '' --with-user-appdir=.thunderbird
187 mozconfig_annotate '' --with-system-png
188 mozconfig_annotate '' --enable-system-ffi
189 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
190
191 # Use enable features
192 mozconfig_use_enable lightning calendar
193 mozconfig_use_enable gconf
194 # Both methodjit and tracejit conflict with PaX
195 mozconfig_use_enable jit methodjit
196 mozconfig_use_enable jit tracejit
197
198 # Bug #72667
199 if use mozdom; then
200 MEXTENSIONS="${MEXTENSIONS},inspector"
201 fi
202
203 # Use an objdir to keep things organized.
204 echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/tbird" >> "${S}"/.mozconfig
205
206 # Finalize and report settings
207 mozconfig_final
208
209 ####################################
210 #
211 # Configure and build
212 #
213 ####################################
214
215 # Disable no-print-directory
216 MAKEOPTS=${MAKEOPTS/--no-print-directory/}
217
218 if [[ $(gcc-major-version) -lt 4 ]]; then
219 append-cxxflags -fno-stack-protector
220 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
221 if use amd64 || use x86; then
222 append-flags -mno-avx
223 fi
224 fi
225 }
226
227 src_compile() {
228 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
229 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
230 emake -f client.mk || die
231
232 # Only build enigmail extension if crypt enabled.
233 if use crypt ; then
234 cd "${S}"/mailnews/extensions/enigmail || die
235 ./makemake -r 2&> /dev/null
236 cd "${S}"/tbird/mailnews/extensions/enigmail
237 emake || die "make enigmail failed"
238 emake xpi || die "make enigmail xpi failed"
239 fi
240 }
241
242 src_install() {
243 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
244 declare emid
245 local obj_dir="tbird"
246 cd "${S}/${obj_dir}"
247
248 # Copy our preference before omnijar is created.
249 cp "${FILESDIR}"/thunderbird-gentoo-default-prefs-1.js-1 \
250 "${S}/${obj_dir}/mozilla/dist/bin/defaults/pref/all-gentoo.js" || die
251
252 # Without methodjit and tracejit there's no conflict with PaX
253 if use jit; then
254 # Pax mark xpcshell for hardened support, only used for startupcache creation.
255 pax-mark m "${S}"/${obj_dir}/mozilla/dist/bin/xpcshell
256 fi
257
258 emake DESTDIR="${D}" install || die "emake install failed"
259
260 # Install language packs
261 mozlinguas_src_install
262
263 if ! use bindist; then
264 newicon "${S}"/other-licenses/branding/thunderbird/content/icon48.png thunderbird-icon.png
265 domenu "${FILESDIR}"/icon/${PN}.desktop
266 else
267 newicon "${S}"/mail/branding/aurora/content/icon48.png thunderbird-icon-unbranded.png
268 newmenu "${FILESDIR}"/icon/${PN}-unbranded.desktop \
269 ${PN}.desktop
270
271 sed -i -e "s:Mozilla\ Thunderbird:EarlyBird:g" \
272 "${ED}"/usr/share/applications/${PN}.desktop
273 fi
274
275 if use crypt ; then
276 cd "${T}" || die
277 unzip "${S}"/${obj_dir}/mozilla/dist/bin/enigmail*.xpi install.rdf || die
278 emid=$(sed -n '/<em:id>/!d; s/.*\({.*}\).*/\1/; p; q' install.rdf)
279
280 dodir ${MOZILLA_FIVE_HOME}/extensions/${emid} || die
281 cd "${D}"${MOZILLA_FIVE_HOME}/extensions/${emid} || die
282 unzip "${S}"/${obj_dir}/mozilla/dist/bin/enigmail*.xpi || die
283 fi
284
285 if use lightning ; then
286 emid="{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}"
287 dodir ${MOZILLA_FIVE_HOME}/extensions/${emid}
288 cd "${ED}"${MOZILLA_FIVE_HOME}/extensions/${emid}
289 unzip "${S}"/${obj_dir}/mozilla/dist/xpi-stage/gdata-provider.xpi
290
291 emid="calendar-timezones@mozilla.org"
292 dodir ${MOZILLA_FIVE_HOME}/extensions/${emid}
293 cd "${ED}"${MOZILLA_FIVE_HOME}/extensions/${emid}
294 unzip "${S}"/${obj_dir}/mozilla/dist/xpi-stage/calendar-timezones.xpi
295
296 emid="{e2fda1a4-762b-4020-b5ad-a41df1933103}"
297 dodir ${MOZILLA_FIVE_HOME}/extensions/${emid}
298 cd "${ED}"${MOZILLA_FIVE_HOME}/extensions/${emid}
299 unzip "${S}"/${obj_dir}/mozilla/dist/xpi-stage/lightning.xpi
300
301 # Fix mimetype so it shows up as a calendar application in GNOME 3
302 # This requires that the .desktop file was already installed earlier
303 sed -e "s:^\(MimeType=\):\1text/calendar;:" \
304 -e "s:^\(Categories=\):\1Calendar;:" \
305 -i "${ED}"/usr/share/applications/${PN}.desktop
306 fi
307
308 if use jit ; then
309 pax-mark m "${ED}"/${MOZILLA_FIVE_HOME}/thunderbird-bin
310 fi
311
312 # Plugin-container needs to be pax-marked for hardened to ensure plugins such as flash
313 # continue to work as expected.
314 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
315
316 # Plugins dir
317 share_plugins_dir
318
319 if use minimal; then
320 rm -rf "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} || \
321 die "Failed to remove sdk and headers"
322 fi
323 }
324
325 pkg_postinst() {
326 elog
327 elog "If you are experience problems with plugins please issue the"
328 elog "following command : rm \${HOME}/.thunderbird/*/extensions.sqlite ,"
329 elog "then restart thunderbird"
330 }

  ViewVC Help
Powered by ViewVC 1.1.13