1 |
# Copyright 1999-2010 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/seamonkey-1.1.18.ebuild,v 1.13 2010/07/08 21:02:22 polynomial-c Exp $ |
4 |
|
5 |
WANT_AUTOCONF="2.1" |
6 |
|
7 |
inherit flag-o-matic toolchain-funcs eutils mozcoreconf mozconfig-2 mozilla-launcher makeedit multilib autotools |
8 |
|
9 |
PATCH="${P}-patches-0.1" |
10 |
EMVER="0.96.0" |
11 |
|
12 |
DESCRIPTION="Mozilla Application Suite - web browser, email, HTML editor, IRC" |
13 |
HOMEPAGE="http://www.seamonkey-project.org/" |
14 |
SRC_URI="http://releases.mozilla.org/pub/mozilla.org/${PN}/releases/${PV}/${P}.source.tar.bz2 |
15 |
mirror://gentoo/${PATCH}.tar.bz2 |
16 |
crypt? ( !moznomail? ( http://www.mozilla-enigmail.org/download/source/enigmail-${EMVER}.tar.gz ) )" |
17 |
|
18 |
KEYWORDS="arm" |
19 |
SLOT="0" |
20 |
LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )" |
21 |
IUSE="java ldap mozdevelop moznocompose moznoirc moznomail moznoroaming postgres crypt xforms" |
22 |
|
23 |
RDEPEND="java? ( virtual/jre ) |
24 |
>=www-client/mozilla-launcher-1.56 |
25 |
>=dev-libs/nss-3.11.5 |
26 |
>=dev-libs/nspr-4.6.5-r1 |
27 |
crypt? ( !moznomail? ( >=app-crypt/gnupg-1.4 ) )" |
28 |
|
29 |
DEPEND="${RDEPEND} |
30 |
java? ( >=dev-java/java-config-0.2.0 ) |
31 |
dev-lang/perl |
32 |
postgres? ( dev-db/postgresql-server )" |
33 |
|
34 |
S="${WORKDIR}/mozilla" |
35 |
|
36 |
# Needed by src_compile() and src_install(). |
37 |
# Would do in pkg_setup but that loses the export attribute, they |
38 |
# become pure shell variables. |
39 |
export MOZ_CO_PROJECT=suite |
40 |
export BUILD_OFFICIAL=1 |
41 |
export MOZILLA_OFFICIAL=1 |
42 |
|
43 |
pkg_setup() { |
44 |
if ! built_with_use x11-libs/cairo X; then |
45 |
eerror "Cairo is not built with X useflag." |
46 |
eerror "Please add 'X' to your USE flags, and re-emerge cairo." |
47 |
die "Cairo needs X" |
48 |
fi |
49 |
|
50 |
if ! built_with_use --missing true x11-libs/pango X; then |
51 |
eerror "Pango is not built with X useflag." |
52 |
eerror "Please add 'X' to your USE flags, and re-emerge pango." |
53 |
die "Pango needs X" |
54 |
fi |
55 |
|
56 |
use moznopango && warn_mozilla_launcher_stub |
57 |
} |
58 |
|
59 |
src_unpack() { |
60 |
unpack ${P}.source.tar.bz2 ${PATCH}.tar.bz2 |
61 |
|
62 |
# Apply our patches |
63 |
cd "${S}" || die "cd failed" |
64 |
EPATCH_SUFFIX="patch" \ |
65 |
EPATCH_FORCE="yes" \ |
66 |
epatch "${WORKDIR}"/patch |
67 |
|
68 |
# Fix crash without -fno-strict-aliasing, bug 265642 |
69 |
epatch "${FILESDIR}/${PN}-1.1.17-fix-fno-strict-aliasing.patch" |
70 |
|
71 |
epatch "${FILESDIR}"/${P}-libpng14.patch |
72 |
|
73 |
# Unpack the enigmail plugin |
74 |
if use crypt && ! use moznomail; then |
75 |
cd "${S}"/mailnews/extensions || die |
76 |
unpack enigmail-${EMVER}.tar.gz |
77 |
cd "${S}"/mailnews/extensions/enigmail || die "cd failed" |
78 |
makemake2 |
79 |
fi |
80 |
|
81 |
# Fix scripts that call for /usr/local/bin/perl #51916 |
82 |
ebegin "Patching smime to call perl from /usr/bin" |
83 |
sed -i -e '1s,usr/local/bin,usr/bin,' "${S}"/security/nss/cmd/smimetools/smime |
84 |
eend $? || die "sed failed" |
85 |
|
86 |
cd "${S}" |
87 |
eautoreconf |
88 |
} |
89 |
|
90 |
src_compile() { |
91 |
declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" |
92 |
|
93 |
#################################### |
94 |
# |
95 |
# mozconfig, CFLAGS and CXXFLAGS setup |
96 |
# |
97 |
#################################### |
98 |
mozconfig_init |
99 |
mozconfig_config |
100 |
|
101 |
mozconfig_annotate 'gentoo' --enable-canvas |
102 |
mozconfig_annotate 'gentoo' --with-system-nspr |
103 |
mozconfig_annotate 'gentoo' --with-system-nss |
104 |
|
105 |
# Bug 60668: Galeon doesn't build without oji enabled, so enable it |
106 |
# regardless of java setting. |
107 |
mozconfig_annotate 'galeon' --enable-oji --enable-mathml |
108 |
|
109 |
# Other moz-specific settings |
110 |
mozconfig_use_enable mozdevelop jsd |
111 |
mozconfig_use_enable mozdevelop xpctools |
112 |
mozconfig_use_extension mozdevelop venkman |
113 |
|
114 |
if use moznoirc; then |
115 |
mozconfig_annotate '+moznocompose +moznoirc' --enable-extensions=-irc |
116 |
fi |
117 |
|
118 |
if use moznoroaming ; then |
119 |
mozconfig_annotate '+moznoroaming' --enable-extensions=-sroaming |
120 |
fi |
121 |
|
122 |
if use postgres ; then |
123 |
mozconfig_annotate '+postgres' --enable-extensions=sql |
124 |
export MOZ_ENABLE_PGSQL=1 |
125 |
export MOZ_PGSQL_INCLUDES=/usr/include |
126 |
export MOZ_PGSQL_LIBS=/usr/$(get_libdir) |
127 |
fi |
128 |
|
129 |
mozconfig_use_enable ldap |
130 |
mozconfig_use_enable ldap ldap-experimental |
131 |
mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME} |
132 |
mozconfig_annotate '' --with-user-appdir=.mozilla |
133 |
|
134 |
if use moznomail; then |
135 |
mozconfig_annotate "+moznomail" --disable-mailnews |
136 |
fi |
137 |
|
138 |
if use moznocompose; then |
139 |
if use moznoirc && use moznomail; then |
140 |
mozconfig_annotate "+moznocompose" --disable-composer |
141 |
fi |
142 |
fi |
143 |
|
144 |
if use xforms; then |
145 |
mozconfig_annotate "+xforms" --enable-extensions=xforms,schema-validation |
146 |
fi |
147 |
|
148 |
# Finalize and report settings |
149 |
mozconfig_final |
150 |
|
151 |
if [[ $(gcc-major-version) -lt 4 ]]; then |
152 |
append-cxxflags -fno-stack-protector |
153 |
fi |
154 |
|
155 |
#################################### |
156 |
# |
157 |
# Configure and build |
158 |
# |
159 |
#################################### |
160 |
|
161 |
CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \ |
162 |
CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \ |
163 |
econf || die |
164 |
|
165 |
# It would be great if we could pass these in via CPPFLAGS or CFLAGS prior |
166 |
# to econf, but the quotes cause configure to fail. |
167 |
sed -i -e \ |
168 |
's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \ |
169 |
"${S}"/config/autoconf.mk \ |
170 |
"${S}"/xpfe/global/buildconfig.html |
171 |
|
172 |
# This removes extraneous CFLAGS from the Makefiles to reduce RAM |
173 |
# requirements while compiling |
174 |
edit_makefiles |
175 |
|
176 |
emake || die |
177 |
|
178 |
#################################### |
179 |
# |
180 |
# Build Enigmail extension |
181 |
# |
182 |
#################################### |
183 |
|
184 |
if use crypt && ! use moznomail; then |
185 |
emake -C "${S}"/mailnews/extensions/enigmail || die "make enigmail failed" |
186 |
fi |
187 |
} |
188 |
|
189 |
src_install() { |
190 |
declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN} |
191 |
|
192 |
# Most of the installation happens here |
193 |
dodir "${MOZILLA_FIVE_HOME}" |
194 |
cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed" |
195 |
|
196 |
# Create directory structure to support portage-installed extensions. |
197 |
# See update_chrome() in mozilla-launcher |
198 |
keepdir ${MOZILLA_FIVE_HOME}/chrome.d |
199 |
keepdir ${MOZILLA_FIVE_HOME}/extensions.d |
200 |
cp "${D}"${MOZILLA_FIVE_HOME}/chrome/installed-chrome.txt \ |
201 |
"${D}"${MOZILLA_FIVE_HOME}/chrome.d/0_base-chrome.txt |
202 |
|
203 |
# Create /usr/bin/seamonkey |
204 |
install_mozilla_launcher_stub seamonkey ${MOZILLA_FIVE_HOME} |
205 |
|
206 |
# Install icon and .desktop for menu entry |
207 |
doicon "${FILESDIR}"/icon/${PN}.png |
208 |
domenu "${FILESDIR}"/icon/${PN}.desktop |
209 |
|
210 |
# Fix icons to look the same everywhere |
211 |
insinto ${MOZILLA_FIVE_HOME}/icons |
212 |
doins "${S}"/widget/src/gtk/mozicon16.xpm |
213 |
doins "${S}"/widget/src/gtk/mozicon50.xpm |
214 |
|
215 |
#################################### |
216 |
# |
217 |
# Install files necessary for applications to build against seamonkey |
218 |
# |
219 |
#################################### |
220 |
|
221 |
einfo "Installing includes and idl files..." |
222 |
cp -LfR "${S}"/dist/include "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed" |
223 |
cp -LfR "${S}"/dist/idl "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed" |
224 |
|
225 |
# Fix mozilla-config and install it |
226 |
exeinto ${MOZILLA_FIVE_HOME} |
227 |
doexe "${S}"/build/unix/${PN}-config |
228 |
|
229 |
# Install pkgconfig files |
230 |
insinto /usr/"$(get_libdir)"/pkgconfig |
231 |
doins "${S}"/build/unix/*.pc |
232 |
|
233 |
# Install env.d snippet, which isn't necessary for running mozilla, but |
234 |
# might be necessary for programs linked against firefox |
235 |
doenvd "${FILESDIR}"/10${PN} |
236 |
dosed "s|/usr/lib|/usr/$(get_libdir)|" /etc/env.d/10${PN} |
237 |
|
238 |
# Install rebuild script since mozilla-bin doesn't support registration yet |
239 |
exeinto ${MOZILLA_FIVE_HOME} |
240 |
doexe "${FILESDIR}"/${PN}-rebuild-databases.pl |
241 |
dosed -e 's|/lib/|/'"$(get_libdir)"'/|g' \ |
242 |
${MOZILLA_FIVE_HOME}/${PN}-rebuild-databases.pl |
243 |
|
244 |
# Install docs |
245 |
dodoc "${S}"/{LEGAL,LICENSE} |
246 |
|
247 |
# Update Google search plugin to use UTF8 charset ... |
248 |
insinto ${MOZILLA_FIVE_HOME}/searchplugins |
249 |
doins "${FILESDIR}"/google.src |
250 |
} |
251 |
|
252 |
pkg_preinst() { |
253 |
declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" |
254 |
|
255 |
# Remove entire installed instance to solve various problems, |
256 |
# for example see bug 27719 |
257 |
rm -rf "${ROOT}"${MOZILLA_FIVE_HOME} |
258 |
} |
259 |
|
260 |
pkg_postinst() { |
261 |
declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" |
262 |
|
263 |
# Update the component registry |
264 |
MOZILLA_LIBDIR=${ROOT}${MOZILLA_FIVE_HOME} MOZILLA_LAUNCHER=${PN} \ |
265 |
/usr/libexec/mozilla-launcher -register |
266 |
|
267 |
# This should be called in the postinst and postrm of all the |
268 |
# mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and |
269 |
# thunderbird-bin ebuilds. |
270 |
update_mozilla_launcher_symlinks |
271 |
} |
272 |
|
273 |
pkg_postrm() { |
274 |
declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" |
275 |
|
276 |
# Update the component registry |
277 |
if [[ -x ${MOZILLA_FIVE_HOME}/${PN}-bin ]]; then |
278 |
MOZILLA_LIBDIR=${ROOT}${MOZILLA_FIVE_HOME} MOZILLA_LAUNCHER=${PN} \ |
279 |
/usr/libexec/mozilla-launcher -register |
280 |
fi |
281 |
|
282 |
update_mozilla_launcher_symlinks |
283 |
} |