summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2018-09-07 19:11:43 +0200
committerThomas Deutschmann <whissi@gentoo.org>2018-09-07 19:15:31 +0200
commit52716463ca346792b17cb994b9cf77639def040d (patch)
tree10628006cad8c4871baf825c04a42b5166176cf8 /eclass
parentwww-client/firefox: disable built-in ccache support (diff)
downloadgentoo-52716463ca346792b17cb994b9cf77639def040d.tar.gz
gentoo-52716463ca346792b17cb994b9cf77639def040d.tar.bz2
gentoo-52716463ca346792b17cb994b9cf77639def040d.zip
www-client/firefox: install language packs as XPI file
Unpacked extensions are no longer supported. [Link 1] Link 1: https://blog.mozilla.org/addons/2018/02/22/removing-support-unpacked-extensions/ Closes: https://bugs.gentoo.org/665352 Package-Manager: Portage-2.3.49, Repoman-2.3.10
Diffstat (limited to 'eclass')
-rw-r--r--eclass/mozextension.eclass30
-rw-r--r--eclass/mozlinguas-v2.eclass14
2 files changed, 42 insertions, 2 deletions
diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass
index 425da7e85bf1..68f401ee8661 100644
--- a/eclass/mozextension.eclass
+++ b/eclass/mozextension.eclass
@@ -91,5 +91,35 @@ xpi_install() {
doins -r "${x}"/* || die "failed to copy extension"
}
+xpi_copy() {
+ local emid
+
+ # You must tell xpi_install which xpi to use
+ [[ ${#} -ne 1 ]] && die "$FUNCNAME takes exactly one argument, please specify an xpi to unpack"
+
+ x="${1}"
+ #cd ${x}
+ # determine id for extension
+ if [[ -f "${x}"/install.rdf ]]; then
+ emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)" \
+ || die "failed to determine extension id from install.rdf"
+ elif [[ -f "${x}"/manifest.json ]]; then
+ emid="$( sed -n 's/.*"id": "\([^"]*\)",.*/\1/p' "${x}"/manifest.json )" \
+ || die "failed to determine extension id from manifest.json"
+ else
+ die "failed to determine extension id"
+ fi
+
+ if [[ -n ${MOZEXTENSION_TARGET} ]]; then
+ insinto "${MOZILLA_FIVE_HOME}"/${MOZEXTENSION_TARGET%/}
+ elif $(mozversion_extension_location) ; then
+ insinto "${MOZILLA_FIVE_HOME}"/browser/extensions
+ else
+ insinto "${MOZILLA_FIVE_HOME}"/extensions
+ fi
+
+ newins "${DISTDIR%/}"/${x##*/}.xpi ${emid}.xpi
+}
+
_MOZEXTENSION=1
fi
diff --git a/eclass/mozlinguas-v2.eclass b/eclass/mozlinguas-v2.eclass
index 77f1d0a439cf..73576e967fa6 100644
--- a/eclass/mozlinguas-v2.eclass
+++ b/eclass/mozlinguas-v2.eclass
@@ -124,13 +124,18 @@ esac
# shouldn't (ie it is an alpha or beta package)
: ${MOZ_FORCE_UPSTREAM_L10N:=""}
-
# @ECLASS-VARIABLE: MOZ_TOO_REGIONALIZED_FOR_L10N
# @INTERNAL
# @DESCRIPTION:
# Upstream identifiers that should not contain region subtags in L10N
MOZ_TOO_REGIONALIZED_FOR_L10N=( fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO nn-NO pa-IN sv-SE )
+# @ECLASS-VARIABLE: MOZ_INSTALL_L10N_XPIFILE
+# @DESCRIPTION:
+# Install langpacks as .xpi file instead of unpacked directory.
+# Leave unset to install unpacked
+: ${MOZ_INSTALL_L10N_XPIFILE:=""}
+
# Add l10n_* to IUSE according to available language packs
# No language packs for alphas and betas
if ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]] ; then
@@ -365,8 +370,13 @@ mozlinguas_src_install() {
done
popd > /dev/null || die
fi
+
for x in "${mozlinguas[@]}"; do
- xpi_install "${WORKDIR}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}"
+ if [[ -n ${MOZ_INSTALL_L10N_XPIFILE} ]]; then
+ xpi_copy "${WORKDIR}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}"
+ else
+ xpi_install "${WORKDIR}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}"
+ fi
done
}