summaryrefslogtreecommitdiff
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/mozextension.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/mozextension.eclass')
-rw-r--r--eclass/mozextension.eclass30
1 files changed, 30 insertions, 0 deletions
diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass
index 425da7e85bf..68f401ee866 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