1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
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)
13 MOZ_PV="${MOZ_PV/_alpha/a}"
14 MOZ_PV="${MOZ_PV/_beta/b}"
15 MOZ_PV="${MOZ_PV/_rc/rc}"
17 MY_MOZ_P="${PN}-${MOZ_PV}"
19 if [[ ${PV} == *_pre* ]] ; then
20 MOZ_HTTP_URI="http://archive.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
24 MOZ_HTTP_URI="http://archive.mozilla.org/pub/${PN}/releases/${MOZ_PV}"
25 MOZ_LANGPACK_PREFIX="langpack/${MY_MOZ_P}."
26 MOZ_LANGPACK_SUFFIX=".langpack.xpi"
29 MOZCONFIG_OPTIONAL_WIFI=1
30 #MOZCONFIG_OPTIONAL_JIT="enabled"
31 inherit check-reqs flag-o-matic toolchain-funcs eutils mozconfig-v5.36 multilib pax-utils fdo-mime autotools mozextension nsplugins mozlinguas
33 PATCHFF="firefox-36.0-patches-01"
34 PATCH="${PN}-2.33-patches-01"
37 DESCRIPTION="Seamonkey Web Browser"
38 HOMEPAGE="http://www.seamonkey-project.org"
40 if [[ ${PV} == *_pre* ]] ; then
41 # pre-releases. No need for arch teams to change KEYWORDS here.
45 # This is where arch teams should change the KEYWORDS.
47 KEYWORDS="~alpha amd64 ~arm ~ppc ~ppc64 x86"
51 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
52 IUSE="+chatzilla +crypt +gmp-autoupdate +ipc minimal pulseaudio +roaming selinux test"
55 ${MOZ_HTTP_URI}/source/${MY_MOZ_P}.source.tar.bz2 -> ${P}.source.tar.bz2
56 https://dev.gentoo.org/~axs/mozilla/patchsets/${PATCHFF}.tar.xz
57 https://dev.gentoo.org/~polynomial-c/mozilla/patchsets/${PATCH}.tar.xz
58 https://dev.gentoo.org/~polynomial-c/mozilla/patchsets/${PATCHFF}.tar.xz
59 crypt? ( http://www.enigmail.net/download/source/enigmail-${EMVER}.tar.gz )"
61 ASM_DEPEND=">=dev-lang/yasm-1.1"
63 RDEPEND=">=dev-libs/nss-3.17.4
64 >=dev-libs/nspr-4.10.8
66 ( >=app-crypt/gnupg-2.0
68 app-crypt/pinentry[gtk]
69 app-crypt/pinentry[qt4]
72 =app-crypt/gnupg-1.4* ) )
73 system-sqlite? ( >=dev-db/sqlite-3.8.7.4:3[secure-delete,debug=] )"
76 !elibc_glibc? ( !elibc_uclibc? ( dev-libs/libexecinfo ) )
77 crypt? ( dev-lang/perl )
78 amd64? ( ${ASM_DEPEND}
83 if [[ ${PV} == *beta* ]] ; then
84 S="${WORKDIR}/comm-beta"
86 S="${WORKDIR}/comm-release"
89 BUILD_OBJ_DIR="${S}/seamonk"
92 if [[ ${PV} == *_pre* ]] ; then
93 ewarn "You're using an unofficial release of ${PN}. Don't file any bug in"
94 ewarn "Gentoo's Bugtracker against this package in case it breaks for you."
95 ewarn "Those belong to upstream: https://bugzilla.mozilla.org"
102 # Ensure we have enough disk space to compile
103 if use debug || use test ; then
104 CHECKREQS_DISK_BUILD="8G"
106 CHECKREQS_DISK_BUILD="4G"
114 # Unpack language packs
115 mozlinguas_src_unpack
120 EPATCH_SUFFIX="patch" \
122 epatch "${WORKDIR}/seamonkey"
124 epatch "${FILESDIR}"/${PN}-2.30-jemalloc-configure.patch
126 # browser patches go here
127 pushd "${S}"/mozilla &>/dev/null || die
128 EPATCH_EXCLUDE="2000-firefox_gentoo_install_dirs.patch
129 8002_jemalloc_configure_unbashify.patch" \
130 EPATCH_SUFFIX="patch" \
132 epatch "${WORKDIR}/firefox"
133 popd &>/dev/null || die
134 # drop -Wl,--build-id from LDFLAGS, bug #465466
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}"
143 # Allow user to apply any additional patches without modifing ebuild
146 local ms="${S}/mozilla"
148 # Enable gnomebreakpad
150 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
151 "${ms}"/build/unix/run-mozilla.sh || die "sed failed!"
154 # Ensure that are plugins dir is enabled as default
155 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
156 "${ms}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
157 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
158 "${ms}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
160 # Don't exit with error when some libs are missing which we have in
162 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
163 -i "${S}"/suite/installer/Makefile.in || die
164 # Don't error out when there's no files to be removed:
165 sed 's@\(xargs rm\)$@\1 -f@' \
166 -i "${ms}"/toolkit/mozapps/installer/packager.mk || die
168 if has_version '>=media-libs/freetype-2.6' ; then
169 sed '/ftcache\.h/aftfntfmt.h' \
170 -i "${S}/mozilla/config/system-headers" || die
174 cd "${S}"/mozilla || die
176 cd "${S}"/mozilla/js/src || die
178 cd "${S}"/mozilla/memory/jemalloc/src || die
179 WANT_AUTOCONF= eautoconf
183 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
184 MEXTENSIONS="default"
185 # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
186 # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
187 # get your own set of keys.
188 _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
190 ####################################
192 # mozconfig, CFLAGS and CXXFLAGS setup
194 ####################################
199 # It doesn't compile on alpha without this LDFLAGS
200 use alpha && append-ldflags "-Wl,--no-relax"
202 if use chatzilla ; then
207 if ! use roaming ; then
208 MEXTENSIONS+=",-sroaming"
211 # Setup api key for location services
212 echo -n "${_google_api_key}" > "${S}"/google-api-key
213 mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
215 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
216 mozconfig_annotate '' --enable-jsd
217 mozconfig_annotate '' --enable-canvas
219 # Other sm-specific settings
220 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
222 mozconfig_annotate '' --enable-safe-browsing
224 # jit needs to be enabled unconditionally (bug #544436)
225 mozconfig_annotate '' --enable-ion
226 mozconfig_annotate '' --enable-yarr-jit
228 # Use an objdir to keep things organized.
229 echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" \
232 # Finalize and report settings
236 pushd "${WORKDIR}"/enigmail &>/dev/null || die
238 popd &>/dev/null || die
241 # Work around breakage in makeopts with --no-print-directory
242 MAKEOPTS="${MAKEOPTS/--no-print-directory/}"
244 if [[ $(gcc-major-version) -lt 4 ]] ; then
245 append-cxxflags -fno-stack-protector
246 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]] ; then
247 if use amd64 || use x86 ; then
248 append-flags -mno-avx
252 emake V=1 -f client.mk configure
256 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
257 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
258 emake V=1 -f client.mk
260 # Only build enigmail extension if conditions are met.
262 einfo "Building enigmail"
263 pushd "${WORKDIR}"/enigmail &>/dev/null || die
266 popd &>/dev/null || die
271 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
272 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
275 cd "${BUILD_OBJ_DIR}" || die
277 # Pax mark xpcshell for hardened support, only used for startupcache creation.
278 pax-mark m "${BUILD_OBJ_DIR}/dist/bin/xpcshell"
280 # Copy our preference before omnijar is created.
281 sed "s|SEAMONKEY_PVR|${PVR}|" "${FILESDIR}"/all-gentoo-1.js > \
282 "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \
285 # Set default path to search for dictionaries.
286 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
287 >> "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \
290 echo 'pref("extensions.autoDisableScopes", 3);' >> \
291 "${BUILD_OBJ_DIR}/dist/bin/defaults/pref/all-gentoo.js" \
295 if ! use gmp-autoupdate ; then
296 for plugin in gmp-gmpopenh264 ; do
297 echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
298 "${S}/${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
303 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
304 emake DESTDIR="${D}" install
305 cp "${FILESDIR}"/${PN}.desktop "${T}" || die
308 local em_dir="${WORKDIR}/enigmail/build"
309 pushd "${T}" &>/dev/null || die
310 unzip "${em_dir}"/enigmail*.xpi install.rdf || die
311 emid=$(sed -n '/<em:id>/!d; s/.*\({.*}\).*/\1/; p; q' install.rdf)
313 dodir ${MOZILLA_FIVE_HOME}/extensions/${emid}
314 cd "${D}"${MOZILLA_FIVE_HOME}/extensions/${emid} || die
315 unzip "${em_dir}"/enigmail*.xpi || die
317 popd &>/dev/null || die
320 sed 's|^\(MimeType=.*\)$|\1text/x-vcard;text/directory;application/mbox;message/rfc822;x-scheme-handler/mailto;|' \
321 -i "${T}"/${PN}.desktop || die
322 sed 's|^\(Categories=.*\)$|\1Email;|' -i "${T}"/${PN}.desktop \
325 # Install language packs
326 mozlinguas_src_install
328 # Add StartupNotify=true bug 290401
329 if use startup-notification ; then
330 echo "StartupNotify=true" >> "${T}"/${PN}.desktop || die
333 # Install icon and .desktop for menu entry
334 newicon "${S}"/suite/branding/nightly/content/icon64.png ${PN}.png
335 domenu "${T}"/${PN}.desktop
337 # Required in order to use plugins and even run seamonkey on hardened.
338 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{seamonkey,seamonkey-bin,plugin-container}
340 if use minimal ; then
341 rm -rf "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk}
344 # Handle plugins dir through nsplugins.eclass
347 #doman "${BUILD_OBJ_DIR}/suite/app/${PN}.1"
349 # revdep-rebuild entry
350 insinto /etc/revdep-rebuild
351 echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}*" >> ${T}/11${PN}
356 MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/${PN}"
358 if [ -d ${MOZILLA_FIVE_HOME}/plugins ] ; then
359 rm ${MOZILLA_FIVE_HOME}/plugins -rf
364 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
366 # Update mimedb for the new .desktop file
367 fdo-mime_desktop_database_update
369 if use chatzilla ; then
370 elog "chatzilla is now an extension which can be en-/disabled and configured via"
371 elog "the Add-on manager."