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
# 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
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
}
DESTDIR="${D}" ./mach install
# Install language packs
- mozlinguas_src_install
+ MOZ_INSTALL_L10N_XPIFILE="1" mozlinguas_src_install
local size sizes icon_path icon name
if use bindist; then