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