From 40a480a83a10d1718e26a6f4fc54d271c1f13a95 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 20 Oct 2022 14:00:29 +0100 Subject: gentoo auto-resync : 20:10:2022 - 14:00:29 --- www-client/firefox-bin/Manifest | 2 +- .../firefox-bin/firefox-bin-106.0.1-r1.ebuild | 380 +++++++++++++++++++++ www-client/firefox-bin/firefox-bin-106.0.1.ebuild | 377 -------------------- 3 files changed, 381 insertions(+), 378 deletions(-) create mode 100644 www-client/firefox-bin/firefox-bin-106.0.1-r1.ebuild delete mode 100644 www-client/firefox-bin/firefox-bin-106.0.1.ebuild (limited to 'www-client/firefox-bin') diff --git a/www-client/firefox-bin/Manifest b/www-client/firefox-bin/Manifest index f1a34904a1d2..76d0461bb2b1 100644 --- a/www-client/firefox-bin/Manifest +++ b/www-client/firefox-bin/Manifest @@ -201,5 +201,5 @@ DIST firefox-bin_i686-106.0.1.tar.bz2 82275229 BLAKE2B 1ce753166375b26fd08cf9a93 DIST firefox-bin_x86_64-102.4.0.tar.bz2 77406868 BLAKE2B 82a3d844a5e7a67475afd6267c8267ec6a74233913828b92732918dd56500dc5e0c8f5dabbe75e0c4c14dbde2632eea4cabfabd5deb5a17713a5c6ff02074280 SHA512 4a58efb207e71b910fd386b9b16217ba25cc81f19a17e067044864f07a420667a234d0aa93356c93041dd826159ad3a8dcafab970513b6c4df6a77ddcb00ae66 DIST firefox-bin_x86_64-106.0.1.tar.bz2 78781758 BLAKE2B ba04cdf921bc254146cfcdab83c1c202c7d768c6f890a3fc7b76f7652020d595ed7436eac99a9e5afeaca55d383ad5babfceeb3d5568e458f8d3818983ecb76c SHA512 8c2fef8750e7d258674cde3055343752af5d8be2e226db142d0f212713a8865dbf5167fc9a924fe73bcafb1df7df6721d371402da993e7334c07c2945ba8bc5f EBUILD firefox-bin-102.4.0.ebuild 10886 BLAKE2B 29f40e5569d9585637fa0e0d35536a3f21bc34b8ce3d165eafbf868bc96e7b783dba76b6513dc123e3edbac70ae528a71e2f635edd6c71a746de711bd41ad167 SHA512 039968c261f73dc639a2d222996ed92a5a558603da88f1eccb24f14983efc249d0e03a2dfd0d3b47d577fa9f63a1e6e8e44f76342d5e0b09dae7a05e7cb21d46 -EBUILD firefox-bin-106.0.1.ebuild 10615 BLAKE2B f602b7d85b70171b9e555decedd2da1068c1ae809571a6579d0ced8342cd3ad1d301075d7a9e4b2f61887ec2e19639379259d9d7c8167f3379e0315a05640063 SHA512 ada88275ba21bb4ce8c2fb118f085a58e010ed61d394556bbafeaffcb7c04004ba2838a33f865940e25b1122d5f752bc5ab747703b161204d2d4b00c17069601 +EBUILD firefox-bin-106.0.1-r1.ebuild 10669 BLAKE2B 8d1175e67f90185ec8e7629dbb39d4e7eb8abebf027fe629a6700653f924a8e007873fe002c9646ee10a3d862cd1cc70e747506e298583c6b9669dad2410cd0e SHA512 dd033eaba679ec92afd1ca16a54c5cc0f23ade936694470c206469e15aa9ed8dd96132af16f37ea124c626c49a35da8346c4ec27fa54eabf67b21693055a273a MISC metadata.xml 520 BLAKE2B 4b540dd2d9ac3840061de8a73117f2859db156944826d22c1f74cbc0c35f6d305aa10ff45708eab016df725cfc741c99dec46f0078a29162982431892e86e477 SHA512 0c7183e35a4b0ca2ddd092786ebdeb5b41a431adf918f0c2e541a5ef1c235066586a46a50fa29c25e5a522930824f8662fa2fa7eed8c3895f74d85bef93cecb4 diff --git a/www-client/firefox-bin/firefox-bin-106.0.1-r1.ebuild b/www-client/firefox-bin/firefox-bin-106.0.1-r1.ebuild new file mode 100644 index 000000000000..700da6ce60a4 --- /dev/null +++ b/www-client/firefox-bin/firefox-bin-106.0.1-r1.ebuild @@ -0,0 +1,380 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MOZ_ESR= + +MOZ_PV=${PV} +MOZ_PV_SUFFIX= +if [[ ${PV} =~ (_(alpha|beta|rc).*)$ ]] ; then + MOZ_PV_SUFFIX=${BASH_REMATCH[1]} + + # Convert the ebuild version to the upstream Mozilla version + MOZ_PV="${MOZ_PV/_alpha/a}" # Handle alpha for SRC_URI + MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI + MOZ_PV="${MOZ_PV%%_rc*}" # Handle rc for SRC_URI +fi + +if [[ -n ${MOZ_ESR} ]] ; then + # ESR releases have slightly different version numbers + MOZ_PV="${MOZ_PV}esr" +fi + +MOZ_PN="${PN%-bin}" +MOZ_P="${MOZ_PN}-${MOZ_PV}" +MOZ_PV_DISTFILES="${MOZ_PV}${MOZ_PV_SUFFIX}" +MOZ_P_DISTFILES="${MOZ_PN}-${MOZ_PV_DISTFILES}" + +inherit desktop linux-info pax-utils xdg + +MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/releases/${MOZ_PV}" + +SRC_URI="amd64? ( ${MOZ_SRC_BASE_URI}/linux-x86_64/en-US/${MOZ_P}.tar.bz2 -> ${PN}_x86_64-${PV}.tar.bz2 ) + x86? ( ${MOZ_SRC_BASE_URI}/linux-i686/en-US/${MOZ_P}.tar.bz2 -> ${PN}_i686-${PV}.tar.bz2 )" + +DESCRIPTION="Firefox Web Browser" +HOMEPAGE="https://www.mozilla.com/firefox" + +KEYWORDS="-* amd64 x86" +SLOT="rapid" +LICENSE="MPL-2.0 GPL-2 LGPL-2.1" +IUSE="+alsa +ffmpeg +gmp-autoupdate +pulseaudio selinux wayland" + +RESTRICT="strip" + +BDEPEND="app-arch/unzip + alsa? ( + !pulseaudio? ( + dev-util/patchelf + ) + )" + +COMMON_DEPEND="alsa? ( + !pulseaudio? ( + media-sound/apulse + ) + )" + +DEPEND="${COMMON_DEPEND}" + +RDEPEND="${COMMON_DEPEND} + !www-client/firefox-bin:0 + !www-client/firefox-bin:esr + || ( + >=app-accessibility/at-spi2-core-2.46.0:2 + dev-libs/atk + ) + dev-libs/dbus-glib + >=dev-libs/glib-2.26:2 + media-libs/alsa-lib + media-libs/fontconfig + >=media-libs/freetype-2.4.10 + sys-apps/dbus + virtual/freedesktop-icon-theme + >=x11-libs/cairo-1.10[X] + x11-libs/gdk-pixbuf:2 + >=x11-libs/gtk+-3.11:3[wayland?] + x11-libs/libX11 + x11-libs/libXcomposite + x11-libs/libXcursor + x11-libs/libXdamage + x11-libs/libXext + x11-libs/libXfixes + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXtst + x11-libs/libxcb + >=x11-libs/pango-1.22.0 + alsa? ( + !pulseaudio? ( media-sound/apulse ) + ) + ffmpeg? ( media-video/ffmpeg ) + pulseaudio? ( media-sound/pulseaudio ) + selinux? ( sec-policy/selinux-mozilla ) +" + +QA_PREBUILT="opt/${MOZ_PN}/*" + +# Allow MOZ_GMP_PLUGIN_LIST to be set in an eclass or +# overridden in the enviromnent (advanced hackers only) +if [[ -z "${MOZ_GMP_PLUGIN_LIST+set}" ]] ; then + MOZ_GMP_PLUGIN_LIST=( gmp-gmpopenh264 gmp-widevinecdm ) +fi + +MOZ_LANGS=( + ach af an ar ast az be bg bn br bs ca-valencia ca cak cs cy + da de dsb el en-CA en-GB en-US eo es-AR es-CL es-ES es-MX et eu + fa ff fi fr fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb hu hy-AM + ia id is it ja ka kab kk km kn ko lij lt lv mk mr ms my + nb-NO ne-NP nl nn-NO oc pa-IN pl pt-BR pt-PT rm ro ru sco + si sk sl son sq sr sv-SE ta te th tl tr trs uk ur uz vi + xh zh-CN zh-TW +) + +mozilla_set_globals() { + # https://bugs.gentoo.org/587334 + local MOZ_TOO_REGIONALIZED_FOR_L10N=( + fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE + ) + + local lang xflag + for lang in "${MOZ_LANGS[@]}" ; do + # en and en_US are handled internally + if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then + continue + fi + + # strip region subtag if $lang is in the list + if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then + xflag=${lang%%-*} + else + xflag=${lang} + fi + + SRC_URI+=" l10n_${xflag/[_@]/-}? (" + SRC_URI+=" ${MOZ_SRC_BASE_URI}/linux-x86_64/xpi/${lang}.xpi -> ${MOZ_P_DISTFILES}-${lang}.xpi" + SRC_URI+=" )" + IUSE+=" l10n_${xflag/[_@]/-}" + done +} +mozilla_set_globals + +moz_install_xpi() { + debug-print-function ${FUNCNAME} "$@" + + if [[ ${#} -lt 2 ]] ; then + die "${FUNCNAME} requires at least two arguments" + fi + + local DESTDIR=${1} + shift + + insinto "${DESTDIR}" + + local emid xpi_file xpi_tmp_dir + for xpi_file in "${@}" ; do + emid= + xpi_tmp_dir=$(mktemp -d --tmpdir="${T}") + + # Unpack XPI + unzip -qq "${xpi_file}" -d "${xpi_tmp_dir}" || die + + # Determine extension ID + if [[ -f "${xpi_tmp_dir}/install.rdf" ]] ; then + emid=$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${xpi_tmp_dir}/install.rdf") + [[ -z "${emid}" ]] && die "failed to determine extension id from install.rdf" + elif [[ -f "${xpi_tmp_dir}/manifest.json" ]] ; then + emid=$(sed -n -e 's/.*"id": "\([^"]*\)".*/\1/p' "${xpi_tmp_dir}/manifest.json") + [[ -z "${emid}" ]] && die "failed to determine extension id from manifest.json" + else + die "failed to determine extension id" + fi + + einfo "Installing ${emid}.xpi into ${ED}${DESTDIR} ..." + newins "${xpi_file}" "${emid}.xpi" + done +} + +pkg_setup() { + CONFIG_CHECK="~SECCOMP" + WARNING_SECCOMP="CONFIG_SECCOMP not set! This system will be unable to play DRM-protected content." + + linux-info_pkg_setup +} + +src_unpack() { + local _lp_dir="${WORKDIR}/language_packs" + local _src_file + + mkdir "${S}" || die + + if [[ ! -d "${_lp_dir}" ]] ; then + mkdir "${_lp_dir}" || die + fi + + for _src_file in ${A} ; do + if [[ ${_src_file} == *.xpi ]]; then + cp "${DISTDIR}/${_src_file}" "${_lp_dir}" || die "Failed to copy '${_src_file}' to '${_lp_dir}'!" + else + MY_SRC_FILE=${_src_file} + fi + done +} + +src_install() { + # Set MOZILLA_FIVE_HOME + local MOZILLA_FIVE_HOME="/opt/${MOZ_PN}" + + dodir /opt + pushd "${ED}"/opt &>/dev/null || die + unpack "${MY_SRC_FILE}" + popd &>/dev/null || die + + pax-mark m \ + "${ED}${MOZILLA_FIVE_HOME}"/${MOZ_PN} \ + "${ED}${MOZILLA_FIVE_HOME}"/${MOZ_PN}-bin \ + "${ED}${MOZILLA_FIVE_HOME}"/plugin-container + + # Patch alsa support + local apulselib= + if use alsa && ! use pulseaudio ; then + apulselib="${EPREFIX}/usr/$(get_libdir)/apulse" + patchelf --set-rpath "${apulselib}" "${ED}${MOZILLA_FIVE_HOME}/libxul.so" || die + fi + + # Install policy (currently only used to disable application updates) + insinto "${MOZILLA_FIVE_HOME}/distribution" + newins "${FILESDIR}"/disable-auto-update.policy.json policies.json + + # Install system-wide preferences + local PREFS_DIR="${MOZILLA_FIVE_HOME}/browser/defaults/preferences" + insinto "${PREFS_DIR}" + newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js + + local GENTOO_PREFS="${ED}${PREFS_DIR}/all-gentoo.js" + + if ! use gmp-autoupdate ; then + local plugin + for plugin in "${MOZ_GMP_PLUGIN_LIST[@]}" ; do + einfo "Disabling auto-update for ${plugin} plugin ..." + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to disable autoupdate for ${plugin} media plugin" + pref("media.${plugin}.autoupdate", false); + EOF + done + fi + + # Install language packs + local langpacks=( $(find "${WORKDIR}/language_packs" -type f -name '*.xpi') ) + if [[ -n "${langpacks}" ]] ; then + moz_install_xpi "${MOZILLA_FIVE_HOME}/distribution/extensions" "${langpacks[@]}" + fi + + # Install icons + local icon_srcdir="${ED}/${MOZILLA_FIVE_HOME}/browser/chrome/icons/default" + local icon_symbolic_file="${FILESDIR}/firefox-symbolic.svg" + + insinto /usr/share/icons/hicolor/symbolic/apps + newins "${icon_symbolic_file}" ${PN}-symbolic.svg + + local icon size + for icon in "${icon_srcdir}"/default*.png ; do + size=${icon%.png} + size=${size##*/default} + + if [[ ${size} -eq 48 ]] ; then + newicon "${icon}" ${PN}.png + fi + + newicon -s ${size} "${icon}" ${PN}.png + done + + # Install menu + local app_name="Mozilla ${MOZ_PN^} (bin)" + local desktop_file="${FILESDIR}/${PN}-r3.desktop" + local desktop_filename="${PN}.desktop" + local exec_command="${PN}" + local icon="${PN}" + local use_wayland="false" + + if use wayland ; then + use_wayland="true" + fi + + cp "${desktop_file}" "${WORKDIR}/${PN}.desktop-template" || die + + sed -i \ + -e "s:@NAME@:${app_name}:" \ + -e "s:@EXEC@:${exec_command}:" \ + -e "s:@ICON@:${icon}:" \ + "${WORKDIR}/${PN}.desktop-template" \ + || die + + newmenu "${WORKDIR}/${PN}.desktop-template" "${desktop_filename}" + + rm "${WORKDIR}/${PN}.desktop-template" || die + + # Install wrapper script + [[ -f "${ED}/usr/bin/${PN}" ]] && rm "${ED}/usr/bin/${PN}" + newbin "${FILESDIR}/${PN}-r1.sh" ${PN} + + # Update wrapper + sed -i \ + -e "s:@PREFIX@:${EPREFIX}/usr:" \ + -e "s:@MOZ_FIVE_HOME@:${MOZILLA_FIVE_HOME}:" \ + -e "s:@APULSELIB_DIR@:${apulselib}:" \ + -e "s:@DEFAULT_WAYLAND@:${use_wayland}:" \ + "${ED}/usr/bin/${PN}" \ + || die +} + +pkg_postinst() { + xdg_pkg_postinst + + 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 "${MOZ_GMP_PLUGIN_LIST[@]}" ; do + elog "\t ${plugin}" + done + elog + fi + + use ffmpeg || ewarn "USE=-ffmpeg : HTML5 video will not render without media-video/ffmpeg installed" + + local show_doh_information show_normandy_information show_shortcut_information + + if [[ -z "${REPLACING_VERSIONS}" ]] ; then + # New install; Tell user that DoH is disabled by default + show_doh_information=yes + show_normandy_information=yes + show_shortcut_information=no + else + local replacing_version + for replacing_version in ${REPLACING_VERSIONS} ; do + if ver_test "${replacing_version}" -lt 91.0 ; then + # Tell user that we no longer install a shortcut + # per supported display protocol + show_shortcut_information=yes + fi + done + fi + + if [[ -n "${show_doh_information}" ]] ; then + elog + elog "Note regarding Trusted Recursive Resolver aka DNS-over-HTTPS (DoH):" + elog "Due to privacy concerns (encrypting DNS might be a good thing, sending all" + elog "DNS traffic to Cloudflare by default is not a good idea and applications" + elog "should respect OS configured settings), \"network.trr.mode\" was set to 5" + elog "(\"Off by choice\") by default." + elog "You can enable DNS-over-HTTPS in ${PN^}'s preferences." + fi + + # bug 713782 + if [[ -n "${show_normandy_information}" ]] ; then + elog + elog "Upstream operates a service named Normandy which allows Mozilla to" + elog "push changes for default settings or even install new add-ons remotely." + elog "While this can be useful to address problems like 'Armagadd-on 2.0' or" + elog "revert previous decisions to disable TLS 1.0/1.1, privacy and security" + elog "concerns prevail, which is why we have switched off the use of this" + elog "service by default." + elog + elog "To re-enable this service set" + elog + elog " app.normandy.enabled=true" + elog + elog "in about:config." + fi + + if [[ -n "${show_shortcut_information}" ]] ; then + elog + elog "Since firefox-91.0 we no longer install multiple shortcuts for" + elog "each supported display protocol. Instead we will only install" + elog "one generic Mozilla Firefox shortcut." + elog "If you still want to be able to select between running Mozilla Firefox" + elog "on X11 or Wayland, you have to re-create these shortcuts on your own." + fi +} diff --git a/www-client/firefox-bin/firefox-bin-106.0.1.ebuild b/www-client/firefox-bin/firefox-bin-106.0.1.ebuild deleted file mode 100644 index c4bcab437463..000000000000 --- a/www-client/firefox-bin/firefox-bin-106.0.1.ebuild +++ /dev/null @@ -1,377 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -MOZ_ESR= - -MOZ_PV=${PV} -MOZ_PV_SUFFIX= -if [[ ${PV} =~ (_(alpha|beta|rc).*)$ ]] ; then - MOZ_PV_SUFFIX=${BASH_REMATCH[1]} - - # Convert the ebuild version to the upstream Mozilla version - MOZ_PV="${MOZ_PV/_alpha/a}" # Handle alpha for SRC_URI - MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI - MOZ_PV="${MOZ_PV%%_rc*}" # Handle rc for SRC_URI -fi - -if [[ -n ${MOZ_ESR} ]] ; then - # ESR releases have slightly different version numbers - MOZ_PV="${MOZ_PV}esr" -fi - -MOZ_PN="${PN%-bin}" -MOZ_P="${MOZ_PN}-${MOZ_PV}" -MOZ_PV_DISTFILES="${MOZ_PV}${MOZ_PV_SUFFIX}" -MOZ_P_DISTFILES="${MOZ_PN}-${MOZ_PV_DISTFILES}" - -inherit desktop linux-info pax-utils xdg - -MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/releases/${MOZ_PV}" - -SRC_URI="amd64? ( ${MOZ_SRC_BASE_URI}/linux-x86_64/en-US/${MOZ_P}.tar.bz2 -> ${PN}_x86_64-${PV}.tar.bz2 ) - x86? ( ${MOZ_SRC_BASE_URI}/linux-i686/en-US/${MOZ_P}.tar.bz2 -> ${PN}_i686-${PV}.tar.bz2 )" - -DESCRIPTION="Firefox Web Browser" -HOMEPAGE="https://www.mozilla.com/firefox" - -KEYWORDS="-* amd64 x86" -SLOT="rapid" -LICENSE="MPL-2.0 GPL-2 LGPL-2.1" -IUSE="+alsa +ffmpeg +gmp-autoupdate +pulseaudio selinux wayland" - -RESTRICT="strip" - -BDEPEND="app-arch/unzip - alsa? ( - !pulseaudio? ( - dev-util/patchelf - ) - )" - -COMMON_DEPEND="alsa? ( - !pulseaudio? ( - media-sound/apulse - ) - )" - -DEPEND="${COMMON_DEPEND}" - -RDEPEND="${COMMON_DEPEND} - !www-client/firefox-bin:0 - !www-client/firefox-bin:esr - dev-libs/atk - dev-libs/dbus-glib - >=dev-libs/glib-2.26:2 - media-libs/alsa-lib - media-libs/fontconfig - >=media-libs/freetype-2.4.10 - sys-apps/dbus - virtual/freedesktop-icon-theme - >=x11-libs/cairo-1.10[X] - x11-libs/gdk-pixbuf:2 - >=x11-libs/gtk+-3.11:3[wayland?] - x11-libs/libX11 - x11-libs/libXcomposite - x11-libs/libXcursor - x11-libs/libXdamage - x11-libs/libXext - x11-libs/libXfixes - x11-libs/libXi - x11-libs/libXrandr - x11-libs/libXrender - x11-libs/libXtst - x11-libs/libxcb - >=x11-libs/pango-1.22.0 - alsa? ( - !pulseaudio? ( media-sound/apulse ) - ) - ffmpeg? ( media-video/ffmpeg ) - pulseaudio? ( media-sound/pulseaudio ) - selinux? ( sec-policy/selinux-mozilla ) -" - -QA_PREBUILT="opt/${MOZ_PN}/*" - -# Allow MOZ_GMP_PLUGIN_LIST to be set in an eclass or -# overridden in the enviromnent (advanced hackers only) -if [[ -z "${MOZ_GMP_PLUGIN_LIST+set}" ]] ; then - MOZ_GMP_PLUGIN_LIST=( gmp-gmpopenh264 gmp-widevinecdm ) -fi - -MOZ_LANGS=( - ach af an ar ast az be bg bn br bs ca-valencia ca cak cs cy - da de dsb el en-CA en-GB en-US eo es-AR es-CL es-ES es-MX et eu - fa ff fi fr fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb hu hy-AM - ia id is it ja ka kab kk km kn ko lij lt lv mk mr ms my - nb-NO ne-NP nl nn-NO oc pa-IN pl pt-BR pt-PT rm ro ru sco - si sk sl son sq sr sv-SE ta te th tl tr trs uk ur uz vi - xh zh-CN zh-TW -) - -mozilla_set_globals() { - # https://bugs.gentoo.org/587334 - local MOZ_TOO_REGIONALIZED_FOR_L10N=( - fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE - ) - - local lang xflag - for lang in "${MOZ_LANGS[@]}" ; do - # en and en_US are handled internally - if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then - continue - fi - - # strip region subtag if $lang is in the list - if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then - xflag=${lang%%-*} - else - xflag=${lang} - fi - - SRC_URI+=" l10n_${xflag/[_@]/-}? (" - SRC_URI+=" ${MOZ_SRC_BASE_URI}/linux-x86_64/xpi/${lang}.xpi -> ${MOZ_P_DISTFILES}-${lang}.xpi" - SRC_URI+=" )" - IUSE+=" l10n_${xflag/[_@]/-}" - done -} -mozilla_set_globals - -moz_install_xpi() { - debug-print-function ${FUNCNAME} "$@" - - if [[ ${#} -lt 2 ]] ; then - die "${FUNCNAME} requires at least two arguments" - fi - - local DESTDIR=${1} - shift - - insinto "${DESTDIR}" - - local emid xpi_file xpi_tmp_dir - for xpi_file in "${@}" ; do - emid= - xpi_tmp_dir=$(mktemp -d --tmpdir="${T}") - - # Unpack XPI - unzip -qq "${xpi_file}" -d "${xpi_tmp_dir}" || die - - # Determine extension ID - if [[ -f "${xpi_tmp_dir}/install.rdf" ]] ; then - emid=$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${xpi_tmp_dir}/install.rdf") - [[ -z "${emid}" ]] && die "failed to determine extension id from install.rdf" - elif [[ -f "${xpi_tmp_dir}/manifest.json" ]] ; then - emid=$(sed -n -e 's/.*"id": "\([^"]*\)".*/\1/p' "${xpi_tmp_dir}/manifest.json") - [[ -z "${emid}" ]] && die "failed to determine extension id from manifest.json" - else - die "failed to determine extension id" - fi - - einfo "Installing ${emid}.xpi into ${ED}${DESTDIR} ..." - newins "${xpi_file}" "${emid}.xpi" - done -} - -pkg_setup() { - CONFIG_CHECK="~SECCOMP" - WARNING_SECCOMP="CONFIG_SECCOMP not set! This system will be unable to play DRM-protected content." - - linux-info_pkg_setup -} - -src_unpack() { - local _lp_dir="${WORKDIR}/language_packs" - local _src_file - - mkdir "${S}" || die - - if [[ ! -d "${_lp_dir}" ]] ; then - mkdir "${_lp_dir}" || die - fi - - for _src_file in ${A} ; do - if [[ ${_src_file} == *.xpi ]]; then - cp "${DISTDIR}/${_src_file}" "${_lp_dir}" || die "Failed to copy '${_src_file}' to '${_lp_dir}'!" - else - MY_SRC_FILE=${_src_file} - fi - done -} - -src_install() { - # Set MOZILLA_FIVE_HOME - local MOZILLA_FIVE_HOME="/opt/${MOZ_PN}" - - dodir /opt - pushd "${ED}"/opt &>/dev/null || die - unpack "${MY_SRC_FILE}" - popd &>/dev/null || die - - pax-mark m \ - "${ED}${MOZILLA_FIVE_HOME}"/${MOZ_PN} \ - "${ED}${MOZILLA_FIVE_HOME}"/${MOZ_PN}-bin \ - "${ED}${MOZILLA_FIVE_HOME}"/plugin-container - - # Patch alsa support - local apulselib= - if use alsa && ! use pulseaudio ; then - apulselib="${EPREFIX}/usr/$(get_libdir)/apulse" - patchelf --set-rpath "${apulselib}" "${ED}${MOZILLA_FIVE_HOME}/libxul.so" || die - fi - - # Install policy (currently only used to disable application updates) - insinto "${MOZILLA_FIVE_HOME}/distribution" - newins "${FILESDIR}"/disable-auto-update.policy.json policies.json - - # Install system-wide preferences - local PREFS_DIR="${MOZILLA_FIVE_HOME}/browser/defaults/preferences" - insinto "${PREFS_DIR}" - newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js - - local GENTOO_PREFS="${ED}${PREFS_DIR}/all-gentoo.js" - - if ! use gmp-autoupdate ; then - local plugin - for plugin in "${MOZ_GMP_PLUGIN_LIST[@]}" ; do - einfo "Disabling auto-update for ${plugin} plugin ..." - cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to disable autoupdate for ${plugin} media plugin" - pref("media.${plugin}.autoupdate", false); - EOF - done - fi - - # Install language packs - local langpacks=( $(find "${WORKDIR}/language_packs" -type f -name '*.xpi') ) - if [[ -n "${langpacks}" ]] ; then - moz_install_xpi "${MOZILLA_FIVE_HOME}/distribution/extensions" "${langpacks[@]}" - fi - - # Install icons - local icon_srcdir="${ED}/${MOZILLA_FIVE_HOME}/browser/chrome/icons/default" - local icon_symbolic_file="${FILESDIR}/firefox-symbolic.svg" - - insinto /usr/share/icons/hicolor/symbolic/apps - newins "${icon_symbolic_file}" ${PN}-symbolic.svg - - local icon size - for icon in "${icon_srcdir}"/default*.png ; do - size=${icon%.png} - size=${size##*/default} - - if [[ ${size} -eq 48 ]] ; then - newicon "${icon}" ${PN}.png - fi - - newicon -s ${size} "${icon}" ${PN}.png - done - - # Install menu - local app_name="Mozilla ${MOZ_PN^} (bin)" - local desktop_file="${FILESDIR}/${PN}-r3.desktop" - local desktop_filename="${PN}.desktop" - local exec_command="${PN}" - local icon="${PN}" - local use_wayland="false" - - if use wayland ; then - use_wayland="true" - fi - - cp "${desktop_file}" "${WORKDIR}/${PN}.desktop-template" || die - - sed -i \ - -e "s:@NAME@:${app_name}:" \ - -e "s:@EXEC@:${exec_command}:" \ - -e "s:@ICON@:${icon}:" \ - "${WORKDIR}/${PN}.desktop-template" \ - || die - - newmenu "${WORKDIR}/${PN}.desktop-template" "${desktop_filename}" - - rm "${WORKDIR}/${PN}.desktop-template" || die - - # Install wrapper script - [[ -f "${ED}/usr/bin/${PN}" ]] && rm "${ED}/usr/bin/${PN}" - newbin "${FILESDIR}/${PN}-r1.sh" ${PN} - - # Update wrapper - sed -i \ - -e "s:@PREFIX@:${EPREFIX}/usr:" \ - -e "s:@MOZ_FIVE_HOME@:${MOZILLA_FIVE_HOME}:" \ - -e "s:@APULSELIB_DIR@:${apulselib}:" \ - -e "s:@DEFAULT_WAYLAND@:${use_wayland}:" \ - "${ED}/usr/bin/${PN}" \ - || die -} - -pkg_postinst() { - xdg_pkg_postinst - - 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 "${MOZ_GMP_PLUGIN_LIST[@]}" ; do - elog "\t ${plugin}" - done - elog - fi - - use ffmpeg || ewarn "USE=-ffmpeg : HTML5 video will not render without media-video/ffmpeg installed" - - local show_doh_information show_normandy_information show_shortcut_information - - if [[ -z "${REPLACING_VERSIONS}" ]] ; then - # New install; Tell user that DoH is disabled by default - show_doh_information=yes - show_normandy_information=yes - show_shortcut_information=no - else - local replacing_version - for replacing_version in ${REPLACING_VERSIONS} ; do - if ver_test "${replacing_version}" -lt 91.0 ; then - # Tell user that we no longer install a shortcut - # per supported display protocol - show_shortcut_information=yes - fi - done - fi - - if [[ -n "${show_doh_information}" ]] ; then - elog - elog "Note regarding Trusted Recursive Resolver aka DNS-over-HTTPS (DoH):" - elog "Due to privacy concerns (encrypting DNS might be a good thing, sending all" - elog "DNS traffic to Cloudflare by default is not a good idea and applications" - elog "should respect OS configured settings), \"network.trr.mode\" was set to 5" - elog "(\"Off by choice\") by default." - elog "You can enable DNS-over-HTTPS in ${PN^}'s preferences." - fi - - # bug 713782 - if [[ -n "${show_normandy_information}" ]] ; then - elog - elog "Upstream operates a service named Normandy which allows Mozilla to" - elog "push changes for default settings or even install new add-ons remotely." - elog "While this can be useful to address problems like 'Armagadd-on 2.0' or" - elog "revert previous decisions to disable TLS 1.0/1.1, privacy and security" - elog "concerns prevail, which is why we have switched off the use of this" - elog "service by default." - elog - elog "To re-enable this service set" - elog - elog " app.normandy.enabled=true" - elog - elog "in about:config." - fi - - if [[ -n "${show_shortcut_information}" ]] ; then - elog - elog "Since firefox-91.0 we no longer install multiple shortcuts for" - elog "each supported display protocol. Instead we will only install" - elog "one generic Mozilla Firefox shortcut." - elog "If you still want to be able to select between running Mozilla Firefox" - elog "on X11 or Wayland, you have to re-create these shortcuts on your own." - fi -} -- cgit v1.2.3