/[gentoo-x86]/www-client/seamonkey/seamonkey-2.21.ebuild
Gentoo

Contents of /www-client/seamonkey/seamonkey-2.21.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu Sep 26 16:31:45 2013 UTC (11 months, 3 weeks ago) by axs
Branch: MAIN
Changes since 1.4: +4 -2 lines
drop -Wl,--build-id from LDFLAGS, bug #465466

(Portage version: 2.2.1/cvs/Linux x86_64, signed Manifest commit with key 2B6559ED)

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.21.ebuild,v 1.4 2013/09/25 14:15:10 polynomial-c Exp $
4
5 EAPI="3"
6 WANT_AUTOCONF="2.1"
7
8 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
9 MOZ_LANGS=(be ca cs de en en-GB en-US es-AR es-ES fi fr gl hu it ja lt nb-NO nl
10 pl pt-PT ru sk sv-SE tr uk zh-CN zh-TW)
11
12 MOZ_PV="${PV/_pre*}"
13 MOZ_PV="${MOZ_PV/_alpha/a}"
14 MOZ_PV="${MOZ_PV/_beta/b}"
15 MOZ_PV="${MOZ_PV/_rc/rc}"
16 MOZ_P="${P}"
17 MY_MOZ_P="${PN}-${MOZ_PV}"
18
19 if [[ ${PV} == *_pre* ]] ; then
20 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/candidates/${MOZ_PV}-candidates/build${PV##*_pre}"
21 MOZ_LANGPACK_PREFIX="linux-i686/xpi/"
22 # And the langpack stuff stays at eclass defaults
23 else
24 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/${MOZ_PV}"
25 MOZ_LANGPACK_PREFIX="langpack/${MY_MOZ_P}."
26 MOZ_LANGPACK_SUFFIX=".langpack.xpi"
27 fi
28
29 inherit check-reqs flag-o-matic toolchain-funcs eutils mozconfig-3 multilib pax-utils fdo-mime autotools mozextension nsplugins mozlinguas
30
31 PATCHFF="firefox-24.0-patches-0.3"
32 PATCH="${PN}-2.14-patches-01"
33 EMVER="1.5.2"
34
35 DESCRIPTION="Seamonkey Web Browser"
36 HOMEPAGE="http://www.seamonkey-project.org"
37
38 if [[ ${PV} == *_pre* ]] ; then
39 # pre-releases. No need for arch teams to change KEYWORDS here.
40
41 KEYWORDS=""
42 else
43 # This is where arch teams should change the KEYWORDS.
44
45 KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86"
46 fi
47
48 SLOT="0"
49 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
50 IUSE="+chatzilla +crypt gstreamer +ipc +jit minimal pulseaudio +roaming selinux system-cairo system-icu system-jpeg system-sqlite"
51
52 SRC_URI="${SRC_URI}
53 ${MOZ_FTP_URI}/source/${MY_MOZ_P}.source.tar.bz2 -> ${P}.source.tar.bz2
54 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCHFF}.tar.xz
55 http://dev.gentoo.org/~polynomial-c/mozilla/patchsets/${PATCH}.tar.xz
56 crypt? ( http://www.mozilla-enigmail.org/download/source/enigmail-${EMVER}.tar.gz )"
57
58 ASM_DEPEND=">=dev-lang/yasm-1.1"
59
60 # Mesa 7.10 needed for WebGL + bugfixes
61 RDEPEND=">=sys-devel/binutils-2.16.1
62 >=dev-libs/nss-3.15.1
63 >=dev-libs/nspr-4.10
64 >=dev-libs/glib-2.26:2
65 >=media-libs/mesa-7.10
66 >=media-libs/libpng-1.5.13[apng]
67 >=x11-libs/pango-1.14.0
68 >=x11-libs/gtk+-2.14:2
69 virtual/libffi
70 gstreamer? ( media-plugins/gst-plugins-meta:0.10[ffmpeg] )
71 system-cairo? ( >=x11-libs/cairo-1.12[X] )
72 system-icu? ( dev-libs/icu )
73 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
74 system-sqlite? ( >=dev-db/sqlite-3.7.16.1:3[secure-delete,debug=] )
75 >=media-libs/libvpx-1.0.0
76 crypt? ( >=app-crypt/gnupg-1.4 )
77 kernel_linux? ( media-libs/alsa-lib )
78 pulseaudio? ( media-sound/pulseaudio )
79 selinux? ( sec-policy/selinux-mozilla )"
80
81 DEPEND="${RDEPEND}
82 !elibc_glibc? ( dev-libs/libexecinfo )
83 virtual/pkgconfig
84 amd64? ( ${ASM_DEPEND}
85 virtual/opengl )
86 x86? ( ${ASM_DEPEND}
87 virtual/opengl )"
88
89 if [[ ${PV} == *beta* ]] ; then
90 S="${WORKDIR}/comm-beta"
91 else
92 S="${WORKDIR}/comm-release"
93 fi
94
95 pkg_setup() {
96 if [[ ${PV} == *_pre* ]] ; then
97 ewarn "You're using an unofficial release of ${PN}. Don't file any bug in"
98 ewarn "Gentoo's Bugtracker against this package in case it breaks for you."
99 ewarn "Those belong to upstream: https://bugzilla.mozilla.org"
100 fi
101
102 moz_pkgsetup
103
104 # Ensure we have enough disk space to compile
105 if use debug || use test ; then
106 CHECKREQS_DISK_BUILD="8G"
107 else
108 CHECKREQS_DISK_BUILD="4G"
109 fi
110 check-reqs_pkg_setup
111 }
112
113 src_unpack() {
114 unpack ${A}
115
116 # Unpack language packs
117 mozlinguas_src_unpack
118 }
119
120 src_prepare() {
121 # Apply our patches
122 EPATCH_SUFFIX="patch" \
123 EPATCH_FORCE="yes" \
124 epatch "${WORKDIR}/seamonkey"
125
126 # browser patches go here
127 pushd "${S}"/mozilla &>/dev/null || die
128 EPATCH_EXCLUDE="2000-firefox_gentoo_install_dirs.patch" \
129 EPATCH_SUFFIX="patch" \
130 EPATCH_FORCE="yes" \
131 epatch "${WORKDIR}/firefox"
132 popd &>/dev/null || die
133 # drop -Wl,--build-id from LDFLAGS, bug #465466
134 epatch "${FILESDIR}"/moz${PATCHFF:8:2}-drop-Wl-build-id.patch
135
136 # Shell scripts sometimes contain DOS line endings; bug 391889
137 grep -rlZ --include="*.sh" $'\r$' . |
138 while read -r -d $'\0' file ; do
139 einfo edos2unix "${file}"
140 edos2unix "${file}" || die
141 done
142
143 if use crypt ; then
144 mv "${WORKDIR}"/enigmail "${S}"/mailnews/extensions/enigmail
145 pushd "${S}"/mailnews/extensions/enigmail &>/dev/null || die
146 epatch "${FILESDIR}"/enigmail_mailnews_extensions_genxpi.patch
147 popd &>/dev/null || die
148 fi
149
150 # Allow user to apply any additional patches without modifing ebuild
151 epatch_user
152
153 local ms="${S}/mozilla"
154
155 # Enable gnomebreakpad
156 if use debug ; then
157 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
158 "${ms}"/build/unix/run-mozilla.sh || die "sed failed!"
159 fi
160
161 # Ensure that are plugins dir is enabled as default
162 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
163 "${ms}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
164 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
165 "${ms}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
166
167 # Don't exit with error when some libs are missing which we have in
168 # system.
169 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
170 -i "${S}"/suite/installer/Makefile.in || die
171 # Don't error out when there's no files to be removed:
172 sed 's@\(xargs rm\)$@\1 -f@' \
173 -i "${ms}"/toolkit/mozapps/installer/packager.mk || die
174
175 eautoreconf
176 cd "${S}"/mozilla || die
177 eautoconf
178 cd js/src || die
179 eautoconf
180 }
181
182 src_configure() {
183 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
184 MEXTENSIONS="default"
185
186 ####################################
187 #
188 # mozconfig, CFLAGS and CXXFLAGS setup
189 #
190 ####################################
191
192 mozconfig_init
193 mozconfig_config
194
195 # It doesn't compile on alpha without this LDFLAGS
196 use alpha && append-ldflags "-Wl,--no-relax"
197
198 if use chatzilla ; then
199 MEXTENSIONS+=",irc"
200 else
201 MEXTENSIONS+=",-irc"
202 fi
203 if ! use roaming ; then
204 MEXTENSIONS+=",-sroaming"
205 fi
206
207 # We must force enable jemalloc 3 threw .mozconfig
208 echo "export MOZ_JEMALLOC=1" >> ${S}/.mozconfig
209
210 mozconfig_annotate '' --enable-jemalloc
211 mozconfig_annotate '' --enable-replace-malloc
212 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
213 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
214 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
215 mozconfig_annotate '' --disable-gconf
216 mozconfig_annotate '' --enable-jsd
217 mozconfig_annotate '' --enable-canvas
218 mozconfig_annotate '' --with-system-png
219 mozconfig_annotate '' --enable-system-ffi
220
221 # Other sm-specific settings
222 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
223
224 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
225 mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
226 mozconfig_annotate '' --enable-safe-browsing
227
228 mozconfig_use_enable gstreamer
229 mozconfig_use_enable pulseaudio
230 mozconfig_use_enable system-cairo
231 mozconfig_use_enable system-sqlite
232 mozconfig_use_with system-jpeg
233 mozconfig_use_with system-icu
234 mozconfig_use_enable system-icu intl-api
235 # Feature is know to cause problems on hardened
236 mozconfig_use_enable jit ion
237
238 # Use an objdir to keep things organized.
239 echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/seamonk" \
240 >> "${S}"/.mozconfig
241
242 # Finalize and report settings
243 mozconfig_final
244
245 # Work around breakage in makeopts with --no-print-directory
246 MAKEOPTS="${MAKEOPTS/--no-print-directory/}"
247
248 if [[ $(gcc-major-version) -lt 4 ]] ; then
249 append-cxxflags -fno-stack-protector
250 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]] ; then
251 if use amd64 || use x86 ; then
252 append-flags -mno-avx
253 fi
254 fi
255 }
256
257 src_compile() {
258 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
259 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
260 emake -f client.mk || die
261
262 # Only build enigmail extension if conditions are met.
263 if use crypt ; then
264 cd "${S}"/mailnews/extensions/enigmail || die
265 ./makemake -r 2&> /dev/null
266 cd "${S}"/seamonk/mailnews/extensions/enigmail
267 emake || die "make enigmail failed"
268 emake xpi || die "make enigmail xpi failed"
269 fi
270 }
271
272 src_install() {
273 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
274 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
275
276 local emid obj_dir="seamonk"
277 cd "${S}/${obj_dir}"
278
279 # Pax mark xpcshell for hardened support, only used for startupcache creation.
280 pax-mark m "${S}/${obj_dir}/mozilla/dist/bin/xpcshell"
281
282 # Copy our preference before omnijar is created.
283 sed "s|SEAMONKEY_PVR|${PVR}|" "${FILESDIR}"/all-gentoo-1.js > \
284 "${S}/${obj_dir}/mozilla/dist/bin/defaults/pref/all-gentoo.js" \
285 || die
286
287 # Set default path to search for dictionaries.
288 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
289 >> "${S}/${obj_dir}/mozilla/dist/bin/defaults/pref/all-gentoo.js" \
290 || die
291
292 if ! use libnotify ; then
293 echo 'pref("browser.download.manager.showAlertOnComplete", false);' \
294 >> "${S}/${obj_dir}/mozilla/dist/bin/defaults/pref/all-gentoo.js" \
295 || die
296 fi
297
298 echo 'pref("extensions.autoDisableScopes", 3);' >> \
299 "${S}/${obj_dir}/mozilla/dist/bin/defaults/pref/all-gentoo.js" \
300 || die
301
302 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
303 emake DESTDIR="${D}" install || die "emake install failed"
304 cp -f "${FILESDIR}"/icon/${PN}.desktop "${T}" || die
305
306 if use crypt ; then
307 cd "${T}" || die
308 unzip "${S}"/${obj_dir}/mozilla/dist/bin/enigmail*.xpi install.rdf || die
309 emid=$(sed -n '/<em:id>/!d; s/.*\({.*}\).*/\1/; p; q' install.rdf)
310
311 dodir ${MOZILLA_FIVE_HOME}/extensions/${emid} || die
312 cd "${D}"${MOZILLA_FIVE_HOME}/extensions/${emid} || die
313 unzip "${S}"/${obj_dir}/mozilla/dist/bin/enigmail*.xpi || die
314
315 cd "${S}" || die
316 fi
317
318 sed 's|^\(MimeType=.*\)$|\1text/x-vcard;text/directory;application/mbox;message/rfc822;x-scheme-handler/mailto;|' \
319 -i "${T}"/${PN}.desktop || die
320 sed 's|^\(Categories=.*\)$|\1Email;|' -i "${T}"/${PN}.desktop \
321 || die
322
323 # Install language packs
324 mozlinguas_src_install
325
326 # Add StartupNotify=true bug 290401
327 if use startup-notification ; then
328 echo "StartupNotify=true" >> "${T}"/${PN}.desktop
329 fi
330
331 # Install icon and .desktop for menu entry
332 newicon "${S}"/suite/branding/nightly/content/icon64.png ${PN}.png \
333 || die
334 domenu "${T}"/${PN}.desktop || die
335
336 # Required in order to use plugins and even run seamonkey on hardened.
337 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{seamonkey,seamonkey-bin,plugin-container}
338
339 if use minimal ; then
340 rm -rf "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk}
341 fi
342
343 # Handle plugins dir through nsplugins.eclass
344 share_plugins_dir
345
346 doman "${S}"/${obj_dir}/suite/app/${PN}.1 || die
347 }
348
349 pkg_preinst() {
350 MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/${PN}"
351
352 if [ -d ${MOZILLA_FIVE_HOME}/plugins ] ; then
353 rm ${MOZILLA_FIVE_HOME}/plugins -rf
354 fi
355 }
356
357 pkg_postinst() {
358 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
359
360 # Update mimedb for the new .desktop file
361 fdo-mime_desktop_database_update
362
363 if use chatzilla ; then
364 elog "chatzilla is now an extension which can be en-/disabled and configured via"
365 elog "the Add-on manager."
366 fi
367 }

  ViewVC Help
Powered by ViewVC 1.1.20