| 1 |
# Copyright 1999-2013 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/seamonkey-2.0.14-r1.ebuild,v 1.8 2013/01/16 19:02:13 mgorny Exp $ |
| 4 |
|
| 5 |
EAPI="2" |
| 6 |
WANT_AUTOCONF="2.1" |
| 7 |
|
| 8 |
inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib fdo-mime autotools mozextension java-pkg-opt-2 |
| 9 |
|
| 10 |
PATCH="${PN}-2.0.11-patches-01" |
| 11 |
EMVER="1.0.1" |
| 12 |
|
| 13 |
LANGS="be ca cs de en-GB en-US es-AR es-ES fi fr gl hu it ja ka lt nb-NO nl pl pt-PT ru sk sv-SE tr zh-CN" |
| 14 |
NOSHORTLANGS="en-GB es-AR" |
| 15 |
|
| 16 |
MY_PV="${PV/_pre*}" |
| 17 |
MY_PV="${MY_PV/_alpha/a}" |
| 18 |
MY_PV="${MY_PV/_beta/b}" |
| 19 |
MY_PV="${MY_PV/_rc/rc}" |
| 20 |
MY_P="${PN}-${MY_PV}" |
| 21 |
|
| 22 |
# release versions usually have language packs. So be careful with changing this. |
| 23 |
HAS_LANGS="true" |
| 24 |
if [[ ${PV} == *_pre* ]] ; then |
| 25 |
# pre-releases. No need for arch teams to change KEYWORDS here. |
| 26 |
|
| 27 |
REL_URI="ftp://ftp.mozilla.org/pub/mozilla.org/${PN}/nightly/${MY_PV}-candidates/build${PV##*_pre}" |
| 28 |
KEYWORDS="" |
| 29 |
#HAS_LANGS="false" |
| 30 |
else |
| 31 |
# This is where arch teams should change the KEYWORDS. |
| 32 |
|
| 33 |
REL_URI="http://releases.mozilla.org/pub/mozilla.org/${PN}/releases/${MY_PV}" |
| 34 |
KEYWORDS="alpha arm ia64 ppc64 sparc" |
| 35 |
[[ ${PV} == *alpha* ]] && HAS_LANGS="false" |
| 36 |
fi |
| 37 |
|
| 38 |
DESCRIPTION="Seamonkey Web Browser" |
| 39 |
HOMEPAGE="http://www.seamonkey-project.org" |
| 40 |
|
| 41 |
SLOT="0" |
| 42 |
LICENSE="MPL-1.1 GPL-2 LGPL-2.1" |
| 43 |
IUSE="+alsa +chatzilla +composer +crypt gnome java ldap +mailclient +roaming system-sqlite" |
| 44 |
|
| 45 |
SRC_URI="${REL_URI}/source/${MY_P}.source.tar.bz2 |
| 46 |
http://dev.gentoo.org/~polynomial-c/mozilla/patchsets/${PATCH}.tar.bz2 |
| 47 |
crypt? ( mailclient? ( http://www.mozilla-enigmail.org/download/source/enigmail-${EMVER}.tar.gz ) )" |
| 48 |
|
| 49 |
if ${HAS_LANGS} ; then |
| 50 |
for X in ${LANGS} ; do |
| 51 |
if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then |
| 52 |
SRC_URI="${SRC_URI} |
| 53 |
linguas_${X/-/_}? ( ${REL_URI}/langpack/${MY_P}.${X}.langpack.xpi -> ${MY_P}-${X}.xpi )" |
| 54 |
fi |
| 55 |
IUSE="${IUSE} linguas_${X/-/_}" |
| 56 |
# english is handled internally |
| 57 |
if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then |
| 58 |
if [ "${X}" != "en-US" ]; then |
| 59 |
SRC_URI="${SRC_URI} |
| 60 |
linguas_${X%%-*}? ( ${REL_URI}/langpack/${MY_P}.${X}.langpack.xpi -> ${MY_P}-${X}.xpi )" |
| 61 |
fi |
| 62 |
IUSE="${IUSE} linguas_${X%%-*}" |
| 63 |
fi |
| 64 |
done |
| 65 |
fi |
| 66 |
|
| 67 |
RDEPEND="java? ( virtual/jre ) |
| 68 |
>=sys-devel/binutils-2.16.1 |
| 69 |
>=dev-libs/nss-3.12.8 |
| 70 |
>=dev-libs/nspr-4.8.6 |
| 71 |
alsa? ( media-libs/alsa-lib ) |
| 72 |
system-sqlite? ( >=dev-db/sqlite-3.6.22-r2[fts3,secure-delete] ) |
| 73 |
>=app-text/hunspell-1.2 |
| 74 |
>=x11-libs/gtk+-2.10.0:2 |
| 75 |
>=x11-libs/pango-1.14.0[X] |
| 76 |
crypt? ( mailclient? ( >=app-crypt/gnupg-1.4 ) ) |
| 77 |
gnome? ( >=gnome-base/gnome-vfs-2.16.3 |
| 78 |
>=gnome-base/libgnomeui-2.16.1 |
| 79 |
>=gnome-base/gconf-2.16.0 |
| 80 |
>=gnome-base/libgnome-2.16.0 )" |
| 81 |
|
| 82 |
DEPEND="${RDEPEND} |
| 83 |
virtual/pkgconfig |
| 84 |
java? ( >=virtual/jdk-1.4 )" |
| 85 |
|
| 86 |
S="${WORKDIR}/comm-1.9.1" |
| 87 |
|
| 88 |
linguas() { |
| 89 |
local LANG SLANG |
| 90 |
for LANG in ${LINGUAS}; do |
| 91 |
if has ${LANG} en en_US; then |
| 92 |
has en ${linguas} || linguas="${linguas:+"${linguas} "}en" |
| 93 |
continue |
| 94 |
elif has ${LANG} ${LANGS//-/_}; then |
| 95 |
has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}" |
| 96 |
continue |
| 97 |
elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then |
| 98 |
for X in ${LANGS}; do |
| 99 |
if [[ "${X}" == "${LANG}-"* ]] && \ |
| 100 |
[[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then |
| 101 |
has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}" |
| 102 |
continue 2 |
| 103 |
fi |
| 104 |
done |
| 105 |
fi |
| 106 |
ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA" |
| 107 |
done |
| 108 |
} |
| 109 |
|
| 110 |
src_unpack() { |
| 111 |
unpack ${A} |
| 112 |
|
| 113 |
if ${HAS_LANGS} ; then |
| 114 |
linguas |
| 115 |
for X in ${linguas}; do |
| 116 |
# FIXME: Add support for unpacking xpis to portage |
| 117 |
[[ ${X} != "en" ]] && xpi_unpack "${MY_P}-${X}.xpi" |
| 118 |
done |
| 119 |
if [[ ${linguas} != "" && ${linguas} != "en" ]]; then |
| 120 |
einfo "Selected language packs (first will be default): ${linguas}" |
| 121 |
fi |
| 122 |
fi |
| 123 |
} |
| 124 |
|
| 125 |
pkg_setup() { |
| 126 |
if [[ ${PV} == *_pre* ]] ; then |
| 127 |
ewarn "You're using an unofficial release of ${PN}. Don't file any bug in" |
| 128 |
ewarn "Gentoo's Bugtracker against this package in case it breaks for you." |
| 129 |
ewarn "Those belong to upstream: https://bugzilla.mozilla.org" |
| 130 |
fi |
| 131 |
|
| 132 |
# Ensure we always build with C locale. |
| 133 |
export LANG="C" |
| 134 |
export LC_ALL="C" |
| 135 |
export LC_MESSAGES="C" |
| 136 |
export LC_CTYPE="C" |
| 137 |
|
| 138 |
export BUILD_OFFICIAL=1 |
| 139 |
export MOZILLA_OFFICIAL=1 |
| 140 |
|
| 141 |
java-pkg-opt-2_pkg_setup |
| 142 |
|
| 143 |
# why not moz_pkgsetup? |
| 144 |
python-any-r1_pkg_setup |
| 145 |
} |
| 146 |
|
| 147 |
src_prepare() { |
| 148 |
java-pkg-opt-2_src_prepare |
| 149 |
|
| 150 |
# Apply our patches |
| 151 |
EPATCH_EXCLUDE="1008-seamonkey-cups-1.4.4-fixup.patch" \ |
| 152 |
EPATCH_SUFFIX="patch" \ |
| 153 |
EPATCH_FORCE="yes" \ |
| 154 |
epatch "${WORKDIR}/patch" |
| 155 |
|
| 156 |
epatch "${FILESDIR}"/${PN}-2.0.14-curl7217-includes-fix.patch |
| 157 |
|
| 158 |
if use crypt && use mailclient ; then |
| 159 |
mv "${WORKDIR}"/enigmail "${S}"/mailnews/extensions/enigmail |
| 160 |
cd "${S}"/mailnews/extensions/enigmail || die |
| 161 |
epatch "${FILESDIR}"/enigmail/70_enigmail-fix.patch |
| 162 |
makemake2 |
| 163 |
cd "${S}" |
| 164 |
fi |
| 165 |
|
| 166 |
eautoreconf |
| 167 |
} |
| 168 |
|
| 169 |
src_configure() { |
| 170 |
declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" |
| 171 |
MEXTENSIONS="" |
| 172 |
|
| 173 |
#################################### |
| 174 |
# |
| 175 |
# mozconfig, CFLAGS and CXXFLAGS setup |
| 176 |
# |
| 177 |
#################################### |
| 178 |
|
| 179 |
mozconfig_init |
| 180 |
mozconfig_config |
| 181 |
|
| 182 |
# seamonkey has issues with >=x11-libs/cairo-1.10.0 (bug #337813). |
| 183 |
# If you don't like this blame upstream as they don't care about |
| 184 |
# anything than their damned bundled shit!!! |
| 185 |
sed '/--enable-system-cairo/s:enable:disable:' -i "${S}"/.mozconfig \ |
| 186 |
|| die |
| 187 |
|
| 188 |
# It doesn't compile on alpha without this LDFLAGS |
| 189 |
use alpha && append-ldflags "-Wl,--no-relax" |
| 190 |
|
| 191 |
if ! use chatzilla ; then |
| 192 |
MEXTENSIONS="${MEXTENSIONS},-irc" |
| 193 |
fi |
| 194 |
if ! use roaming ; then |
| 195 |
MEXTENSIONS="${MEXTENSIONS},-sroaming" |
| 196 |
fi |
| 197 |
|
| 198 |
if ! use gnome ; then |
| 199 |
MEXTENSIONS="${MEXTENSIONS},-gnomevfs" |
| 200 |
fi |
| 201 |
|
| 202 |
if ! use composer ; then |
| 203 |
if ! use chatzilla && ! use mailclient ; then |
| 204 |
mozconfig_annotate '-composer' --disable-composer |
| 205 |
fi |
| 206 |
fi |
| 207 |
|
| 208 |
mozconfig_annotate '' --enable-crypto |
| 209 |
mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}" |
| 210 |
mozconfig_annotate '' --enable-application=suite |
| 211 |
mozconfig_annotate 'broken' --disable-mochitest |
| 212 |
mozconfig_annotate 'broken' --disable-crashreporter |
| 213 |
mozconfig_annotate '' --enable-system-hunspell |
| 214 |
mozconfig_annotate '' --enable-jsd |
| 215 |
mozconfig_annotate '' --enable-image-encoder=all |
| 216 |
mozconfig_annotate '' --enable-canvas |
| 217 |
mozconfig_annotate '' --with-system-nspr |
| 218 |
mozconfig_annotate '' --with-system-nss |
| 219 |
mozconfig_annotate '' --with-system-bz2 |
| 220 |
mozconfig_annotate '' --enable-oji --enable-mathml |
| 221 |
mozconfig_annotate 'places' --enable-storage --enable-places --enable-places_bookmarks |
| 222 |
mozconfig_annotate '' --disable-installer |
| 223 |
mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME} |
| 224 |
mozconfig_annotate '' --enable-printing |
| 225 |
|
| 226 |
# Enable/Disable based on USE flags |
| 227 |
mozconfig_use_enable alsa ogg |
| 228 |
mozconfig_use_enable alsa wave |
| 229 |
mozconfig_use_enable gnome gnomevfs |
| 230 |
mozconfig_use_enable gnome gnomeui |
| 231 |
mozconfig_use_enable java javaxpcom |
| 232 |
mozconfig_use_enable ldap |
| 233 |
mozconfig_use_enable ldap ldap-experimental |
| 234 |
mozconfig_use_enable mailclient mailnews |
| 235 |
mozconfig_use_enable system-sqlite |
| 236 |
|
| 237 |
# Finalize and report settings |
| 238 |
mozconfig_final |
| 239 |
|
| 240 |
if [[ $(gcc-major-version) -lt 4 ]]; then |
| 241 |
append-cxxflags -fno-stack-protector |
| 242 |
fi |
| 243 |
|
| 244 |
#################################### |
| 245 |
# |
| 246 |
# Configure and build |
| 247 |
# |
| 248 |
#################################### |
| 249 |
|
| 250 |
# Work around breakage in makeopts with --no-print-directory |
| 251 |
MAKEOPTS="${MAKEOPTS/--no-print-directory/}" |
| 252 |
|
| 253 |
CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" econf |
| 254 |
} |
| 255 |
|
| 256 |
src_compile() { |
| 257 |
# Should the build use multiprocessing? Not enabled by default, as it tends to break. |
| 258 |
[ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1" |
| 259 |
emake ${jobs} || die |
| 260 |
|
| 261 |
# Only build enigmail extension if conditions are met. |
| 262 |
if use crypt && use mailclient ; then |
| 263 |
emake -C "${S}"/mailnews/extensions/enigmail || die "make enigmail failed" |
| 264 |
emake -j1 -C "${S}"/mailnews/extensions/enigmail xpi || die "make enigmail xpi failed" |
| 265 |
fi |
| 266 |
} |
| 267 |
|
| 268 |
src_install() { |
| 269 |
declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" |
| 270 |
declare emid |
| 271 |
|
| 272 |
emake DESTDIR="${D}" install || die "emake install failed" |
| 273 |
cp -f "${FILESDIR}"/icon/seamonkey.desktop "${T}" || die |
| 274 |
|
| 275 |
if use crypt && use mailclient ; then |
| 276 |
cd "${T}" || die |
| 277 |
unzip "${S}"/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}"/mozilla/dist/bin/enigmail*.xpi || die |
| 283 |
fi |
| 284 |
|
| 285 |
if use mailclient ; then |
| 286 |
sed 's|^\(MimeType=.*\)$|\1text/x-vcard;text/directory;application/mbox;message/rfc822;x-scheme-handler/mailto;|' \ |
| 287 |
-i "${T}"/${PN}.desktop || die |
| 288 |
sed 's|^\(Categories=.*\)$|\1Email;|' -i "${T}"/${PN}.desktop \ |
| 289 |
|| die |
| 290 |
fi |
| 291 |
|
| 292 |
if ${HAS_LANGS} ; then |
| 293 |
linguas |
| 294 |
for X in ${linguas}; do |
| 295 |
[[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${MY_P}-${X}" |
| 296 |
done |
| 297 |
fi |
| 298 |
|
| 299 |
# Add StartupNotify=true bug 290401 |
| 300 |
if use startup-notification ; then |
| 301 |
echo "StartupNotify=true" >> "${T}"/${PN}.desktop |
| 302 |
fi |
| 303 |
|
| 304 |
# Install icon and .desktop for menu entry |
| 305 |
newicon "${S}"/suite/branding/content/icon64.png seamonkey.png || die |
| 306 |
domenu "${T}"/${PN}.desktop || die |
| 307 |
|
| 308 |
# Add our default prefs |
| 309 |
sed "s|SEAMONKEY_PVR|${PVR}|" "${FILESDIR}"/all-gentoo.js \ |
| 310 |
> "${D}"${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js |
| 311 |
|
| 312 |
# Plugins dir |
| 313 |
rm -rf "${D}"${MOZILLA_FIVE_HOME}/plugins || die "failed to remove existing plugins dir" |
| 314 |
dosym ../nsbrowser/plugins "${MOZILLA_FIVE_HOME}"/plugins || die |
| 315 |
|
| 316 |
# shiny new man page |
| 317 |
doman "${S}"/suite/app/${PN}.1 || die |
| 318 |
} |
| 319 |
|
| 320 |
pkg_preinst() { |
| 321 |
declare MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/${PN}" |
| 322 |
|
| 323 |
if [ -d ${MOZILLA_FIVE_HOME}/plugins ] ; then |
| 324 |
rm ${MOZILLA_FIVE_HOME}/plugins -rf |
| 325 |
fi |
| 326 |
} |
| 327 |
|
| 328 |
pkg_postinst() { |
| 329 |
declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" |
| 330 |
|
| 331 |
# Update mimedb for the new .desktop file |
| 332 |
fdo-mime_desktop_database_update |
| 333 |
|
| 334 |
if use chatzilla ; then |
| 335 |
elog "chatzilla is now an extension which can be en-/disabled and configured via" |
| 336 |
elog "the Add-on manager." |
| 337 |
fi |
| 338 |
} |