# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 WANT_AUTOCONF="2.1" PYTHON_COMPAT=( python3_{7..9} ) PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)' # This list can be updated with scripts/get_langs.sh from the mozilla overlay # note - could not roll langpacks for: ca fi #MOZ_LANGS=(ca cs de en-GB es-AR es-ES fi fr gl hu it ja lt nb-NO nl pl pt-PT # ru sk sv-SE tr uk zh-CN zh-TW) MOZ_LANGS=(cs de en-GB es-AR es-ES fr hu it ja lt nl pl pt-PT ru sk sv-SE zh-CN zh-TW) MOZ_PV="${PV/_pre*}" MOZ_PV="${MOZ_PV/_alpha/a}" MOZ_PV="${MOZ_PV/_beta/b}" MOZ_PV="${MOZ_PV/_rc/rc}" MOZ_P="${P}" MY_MOZ_P="${PN}-${MOZ_PV}" if [[ ${PV} == *_pre* ]] ; then MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/candidates/${MOZ_PV}-candidates/build${PV##*_pre}" else MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases/${MOZ_PV}" fi SRC_URI="${MOZ_HTTP_URI}/source/${MY_MOZ_P}.source.tar.xz -> ${P}.source.tar.xz ${MOZ_HTTP_URI}/source/${MY_MOZ_P}.source-l10n.tar.xz -> ${P}.source-l10n.tar.xz" S="${WORKDIR}/${MY_MOZ_P}" MOZ_GENERATE_LANGPACKS=1 MOZ_L10N_SOURCEDIR="${S}/${P}-l10n" inherit autotools check-reqs desktop flag-o-matic mozcoreconf-v6 mozextension mozlinguas-v2 pax-utils toolchain-funcs xdg-utils DESCRIPTION="Seamonkey Web Browser" HOMEPAGE="https://www.seamonkey-project.org/" PATCH="${PN}-2.53.9_beta1-patches-01" SRC_URI+=" https://dev.gentoo.org/~polynomial-c/mozilla/patchsets/${PATCH}.tar.xz system-libvpx? ( https://dev.gentoo.org/~polynomial-c/mozilla/${PN}-2.53.3-system_libvpx-1.8.patch.xz ) " LICENSE="MPL-2.0 GPL-2 LGPL-2.1" SLOT="0" SYSTEM_IUSE=( +system-{av1,harfbuzz,icu,jpeg,libevent,libvpx,png,sqlite} ) IUSE="+chatzilla cpu_flags_arm_neon +crypt dbus debug +gmp-autoupdate +ipc jack lto pulseaudio +roaming selinux startup-notification test wifi" IUSE+=" ${SYSTEM_IUSE[@]}" KEYWORDS="~amd64 ~ppc64 ~x86" RESTRICT="!test? ( test )" ASM_DEPEND=">=dev-lang/yasm-1.1" BDEPEND=" app-arch/unzip app-arch/zip >=dev-lang/nasm-2.13 dev-lang/perl >=sys-devel/binutils-2.16.1 virtual/pkgconfig "${S}"/google-api-key mozconfig_annotate '' --with-google-location-service-api-keyfile="${S}/google-api-key" mozconfig_annotate '' --with-google-safebrowsing-api-keyfile="${S}/google-api-key" mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}" mozconfig_use_enable chatzilla irc mozconfig_annotate '' --enable-dominspector # use startup-cache for faster startup time mozconfig_annotate '' --enable-startupcache # Broken on some arches mozconfig_annotate '' --disable-elf-hack # Use an objdir to keep things organized. echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig mozlinguas_mozconfig # Finalize and report settings mozconfig_final # Work around breakage in makeopts with --no-print-directory MAKEOPTS="${MAKEOPTS/--no-print-directory/}" if [[ $(gcc-major-version) -lt 4 ]] ; then append-cxxflags -fno-stack-protector elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]] ; then if use amd64 || use x86 ; then append-flags -mno-avx fi fi # Pass $MAKEOPTS to build system export MOZ_MAKE_FLAGS="${MAKEOPTS}" # Use system's Python environment export MACH_USE_SYSTEM_PYTHON=1 # Disable notification when build system has finished export MOZ_NOSPAM=1 # workaround for funky/broken upstream configure... export SHELL="${SHELL:-${EPREFIX}/bin/bash}" #emake V=1 -f client.mk configure ./mach configure || die } src_compile() { #MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \ #emake V=1 -f client.mk ./mach build --verbose || die mozlinguas_src_compile } src_install() { MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" DICTPATH="\"${EPREFIX}/usr/share/myspell\"" local emid pushd "${BUILD_OBJ_DIR}" &>/dev/null || die # Pax mark xpcshell for hardened support, only used for startupcache creation. pax-mark m dist/bin/xpcshell # Copy our preference before omnijar is created. sed "s|SEAMONKEY_PVR|${PVR}|" "${FILESDIR}"/all-gentoo-1.js > \ dist/bin/defaults/pref/all-gentoo.js \ || die # Set default path to search for dictionaries. echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \ >> dist/bin/defaults/pref/all-gentoo.js \ || die echo 'pref("extensions.autoDisableScopes", 3);' >> \ dist/bin/defaults/pref/all-gentoo.js \ || die local plugin if ! use gmp-autoupdate ; then for plugin in "${GMP_PLUGIN_LIST[@]}" ; do echo "pref(\"media.${plugin}.autoupdate\", false);" >> \ dist/bin/defaults/pref/all-gentoo.js || die done fi popd &>/dev/null || die #MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" \ #emake DESTDIR="${D}" install DESTDIR="${D}" ./mach install || die MOZ_P="${MY_MOZ_P}" mozlinguas_src_install cp "${FILESDIR}"/${PN}.desktop "${T}" || die sed 's|^\(MimeType=.*\)$|\1text/x-vcard;text/directory;application/mbox;message/rfc822;x-scheme-handler/mailto;|' \ -i "${T}"/${PN}.desktop || die sed 's|^\(Categories=.*\)$|\1Email;|' -i "${T}"/${PN}.desktop \ || die # Install icon and .desktop for menu entry newicon "${S}"/comm/suite/branding/${PN}/default64.png ${PN}.png domenu "${T}"/${PN}.desktop # Required in order to use plugins and even run seamonkey on hardened. pax-mark m "${ED}"/${MOZILLA_FIVE_HOME}/{seamonkey,seamonkey-bin,plugin-container} if use chatzilla ; then emid='{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}' # remove the en_US-only xpi file so a version with all requested locales can be installed if [[ -e "${ED}"/${MOZILLA_FIVE_HOME}/extensions/${emid}.xpi ]] ; then rm -f "${ED}"/${MOZILLA_FIVE_HOME}/extensions/${emid}.xpi || die fi # merge the extra locales into the main extension mozlinguas_xpistage_langpacks dist/xpi-stage/chatzilla # install the merged extension mkdir -p "${T}/${emid}" || die cp -RLp -t "${T}/${emid}" dist/xpi-stage/chatzilla/* || die insinto ${MOZILLA_FIVE_HOME}/extensions doins -r "${T}/${emid}" fi # Provide a place for plugins keepdir "${MOZILLA_FIVE_HOME}/plugins" # revdep-rebuild entry insinto /etc/revdep-rebuild echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}*" >> ${T}/11${PN} doins "${T}"/11${PN} } pkg_preinst() { SEAMONKEY_PLUGINS_DIR="${ROOT}/usr/$(get_libdir)/${PN}/plugins" if [[ -L "${SEAMONKEY_PLUGINS_DIR}" ]] ; then rm "${SEAMONKEY_PLUGINS_DIR}" || die fi } pkg_postinst() { # Update mimedb for the new .desktop file xdg_desktop_database_update if ! use gmp-autoupdate ; then elog "USE='-gmp-autoupdate' has disabled the following plugins from updating or" elog "installing into new profiles:" local plugin for plugin in "${GMP_PLUGIN_LIST[@]}"; do elog "\t ${plugin}" ; done fi if use chatzilla ; then elog "chatzilla is now an extension which can be en-/disabled and configured via" elog "the Add-on manager." fi } pkg_postrm() { xdg_desktop_database_update }