axs 15/07/16 16:25:47
Modified: ChangeLog mozconfig-v6.38.eclass
mozconfig-v6.39.eclass mozcoreconf-v3.eclass
mozextension.eclass mozlinguas.eclass
Log:
Update mozilla support eclasses
Revision Changes Path
1.1713 eclass/ChangeLog
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1713&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1713&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1712&r2=1.1713
Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1712
retrieving revision 1.1713
diff -u -r1.1712 -r1.1713
--- ChangeLog 16 Jul 2015 14:29:39 -0000 1.1712
+++ ChangeLog 16 Jul 2015 16:25:47 -0000 1.1713
@@ -1,6 +1,11 @@
# ChangeLog for eclass directory
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1712 2015/07/16
14:29:39 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1713 2015/07/16
16:25:47 axs Exp $
+
+ 16 Jul 2015; Ian Stakenvicius (_AxS_) <[email protected]>
+ mozconfig-v6.38.eclass, mozconfig-v6.39.eclass, mozcoreconf-v3.eclass,
+ mozextension.eclass, mozlinguas.eclass:
+ Update mozilla support eclasses
16 Jul 2015; Michał Górny <[email protected]> distutils-r1.eclass:
Forbid also installing "examples" package, bug #555038.
1.2 eclass/mozconfig-v6.38.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozconfig-v6.38.eclass?rev=1.2&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozconfig-v6.38.eclass?rev=1.2&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozconfig-v6.38.eclass?r1=1.1&r2=1.2
Index: mozconfig-v6.38.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mozconfig-v6.38.eclass,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mozconfig-v6.38.eclass 7 Jul 2015 14:11:37 -0000 1.1
+++ mozconfig-v6.38.eclass 16 Jul 2015 16:25:47 -0000 1.2
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozconfig-v6.38.eclass,v 1.1
2015/07/07 14:11:37 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mozconfig-v6.38.eclass,v 1.2
2015/07/16 16:25:47 axs Exp $
#
# @ECLASS: mozconfig-v5.33.eclass
# @MAINTAINER:
@@ -122,6 +122,9 @@
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
+# only one of gstreamer and gstreamer-0 can be enabled at a time, so set
REQUIRED_USE to signify this
+REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
+
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
@@ -218,12 +221,10 @@
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
- if use gstreamer || use gstreamer-0 ; then
- if use gstreamer-0 ; then
- mozconfig_annotate '+gstreamer-0'
--enable-gstreamer=0.10
- else
- mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
- fi
+ if use gstreamer ; then
+ mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
+ elif use gstreamer-0 ; then
+ mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
else
mozconfig_annotate '' --disable-gstreamer
fi
1.2 eclass/mozconfig-v6.39.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozconfig-v6.39.eclass?rev=1.2&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozconfig-v6.39.eclass?rev=1.2&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozconfig-v6.39.eclass?r1=1.1&r2=1.2
Index: mozconfig-v6.39.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mozconfig-v6.39.eclass,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mozconfig-v6.39.eclass 7 Jul 2015 14:11:37 -0000 1.1
+++ mozconfig-v6.39.eclass 16 Jul 2015 16:25:47 -0000 1.2
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozconfig-v6.39.eclass,v 1.1
2015/07/07 14:11:37 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mozconfig-v6.39.eclass,v 1.2
2015/07/16 16:25:47 axs Exp $
#
# @ECLASS: mozconfig-v5.33.eclass
# @MAINTAINER:
@@ -222,12 +222,10 @@
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
- if use gstreamer || use gstreamer-0 ; then
- if use gstreamer-0 ; then
- mozconfig_annotate '+gstreamer-0'
--enable-gstreamer=0.10
- else
- mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
- fi
+ if use gstreamer ; then
+ mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
+ elif use gstreamer-0 ; then
+ mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
else
mozconfig_annotate '' --disable-gstreamer
fi
1.2 eclass/mozcoreconf-v3.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozcoreconf-v3.eclass?rev=1.2&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozcoreconf-v3.eclass?rev=1.2&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozcoreconf-v3.eclass?r1=1.1&r2=1.2
Index: mozcoreconf-v3.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mozcoreconf-v3.eclass,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mozcoreconf-v3.eclass 14 Oct 2014 16:10:36 -0000 1.1
+++ mozcoreconf-v3.eclass 16 Jul 2015 16:25:47 -0000 1.2
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozcoreconf-v3.eclass,v 1.1
2014/10/14 16:10:36 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mozcoreconf-v3.eclass,v 1.2
2015/07/16 16:25:47 axs Exp $
#
# @ECLASS: mozcoreconf.eclass
# @MAINTAINER:
@@ -10,6 +10,8 @@
#
# inherit mozconfig-v5.* or above for mozilla configuration support
+if [[ ! ${_MOZCORECONF_V3} ]]; then
+
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE='threads,sqlite'
@@ -255,3 +257,5 @@
echo "ac_add_options --enable-extensions=${exts// /,}" >> .mozconfig
}
+_MOZCORECONF_V3=1
+fi
1.10 eclass/mozextension.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozextension.eclass?rev=1.10&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozextension.eclass?rev=1.10&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozextension.eclass?r1=1.9&r2=1.10
Index: mozextension.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mozextension.eclass,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mozextension.eclass 28 May 2013 03:29:50 -0000 1.9
+++ mozextension.eclass 16 Jul 2015 16:25:47 -0000 1.10
@@ -1,12 +1,21 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozextension.eclass,v 1.9 2013/05/28
03:29:50 anarchy Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mozextension.eclass,v 1.10
2015/07/16 16:25:47 axs Exp $
#
# @ECLASS: mozextension.eclass
# @MAINTAINER:
# Mozilla team <[email protected]>
# @BLURB: Install extensions for use in mozilla products.
+#
+if [[ ! ${_MOZEXTENSION} ]]; then
+# @ECLASS-VARIABLE: MOZEXTENSION_TARGET
+# @DESCRIPTION:
+# This variable allows the installation path for xpi_install
+# to be overridden from the default app-global extensions path.
+# Default is empty, which installs to predetermined hard-coded
+# paths specified in the eclass.
+: ${MOZEXTENSION_TARGET:=""}
inherit eutils
@@ -65,10 +74,15 @@
# determine id for extension
emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d;
s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)" \
|| die "failed to determine extension id"
- if $(mozversion_extension_location) ; then
+ if [[ -n ${MOZEXTENSION_TARGET} ]]; then
+ insinto "${MOZILLA_FIVE_HOME}"/${MOZEXTENSION_TARGET%/}/${emid}
+ elif $(mozversion_extension_location) ; then
insinto "${MOZILLA_FIVE_HOME}"/browser/extensions/${emid}
else
insinto "${MOZILLA_FIVE_HOME}"/extensions/${emid}
fi
doins -r "${x}"/* || die "failed to copy extension"
}
+
+_MOZEXTENSION=1
+fi
1.7 eclass/mozlinguas.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozlinguas.eclass?rev=1.7&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozlinguas.eclass?rev=1.7&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mozlinguas.eclass?r1=1.6&r2=1.7
Index: mozlinguas.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mozlinguas.eclass,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- mozlinguas.eclass 5 Apr 2013 15:27:40 -0000 1.6
+++ mozlinguas.eclass 16 Jul 2015 16:25:47 -0000 1.7
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozlinguas.eclass,v 1.6 2013/04/05
15:27:40 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mozlinguas.eclass,v 1.7 2015/07/16
16:25:47 axs Exp $
# @ECLASS: mozlinguas.eclass
# @MAINTAINER:
@@ -10,15 +10,16 @@
# @BLURB: Handle language packs for mozilla products
# @DESCRIPTION:
# Sets IUSE according to MOZ_LANGS (language packs available). Also exports
-# src_unpack and src_install for use in ebuilds.
+# src_unpack, src_compile and src_install for use in ebuilds, and provides
+# supporting functions for langpack generation and installation.
-inherit mozextension
+inherit mozextension mozcoreconf-v3
case "${EAPI:-0}" in
0|1)
die "EAPI ${EAPI:-0} does not support the '->' SRC_URI
operator";;
2|3|4|5)
- EXPORT_FUNCTIONS src_unpack src_install;;
+ EXPORT_FUNCTIONS src_unpack src_compile src_install;;
*)
die "EAPI ${EAPI} is not supported, contact eclass
maintainers";;
esac
@@ -53,6 +54,11 @@
# The ftp URI prefix for the release tarballs and language packs.
: ${MOZ_FTP_URI:=""}
+# @ECLASS-VARIABLE: MOZ_HTTP_URI
+# @DESCRIPTION:
+# The http URI prefix for the release tarballs and language packs.
+: ${MOZ_HTTP_URI:=""}
+
# @ECLASS-VARIABLE: MOZ_LANGPACK_PREFIX
# @DESCRIPTION:
# The relative path till the lang code in the langpack file URI.
@@ -65,21 +71,86 @@
# Defaults to '.xpi'
: ${MOZ_LANGPACK_SUFFIX:=".xpi"}
+# @ECLASS-VARIABLE: MOZ_LANGPACK_UNOFFICIAL
+# @DESCRIPTION:
+# The status of the langpack, used to differentiate within
+# Manifests and on Gentoo mirrors as to when the langpacks are
+# generated officially by Mozilla or if they were generated
+# unofficially by others (ie the Gentoo mozilla team). When
+# this var is set, the distfile will have a .unofficial.xpi
+# suffix.
+: ${MOZ_LANGPACK_UNOFFICIAL:=""}
+
+# @ECLASS-VARIABLE: MOZ_GENERATE_LANGPACKS
+# @DESCRIPTION:
+# This flag specifies whether or not the langpacks should be
+# generated directly during the build process, rather than
+# being downloaded and installed from upstream pre-built
+# extensions. Primarily it supports pre-release builds.
+# Defaults to empty.
+: ${MOZ_GENERATE_LANGPACKS:=""}
+
+# @ECLASS-VARIABLE: MOZ_L10N_SOURCEDIR
+# @DESCRIPTION:
+# The path that l10n sources can be found at, once unpacked.
+# Defaults to ${WORKDIR}/l10n-sources
+: ${MOZ_L10N_SOURCEDIR:="${WORKDIR}/l10n-sources"}
+
+# @ECLASS-VARIABLE: MOZ_L10N_URI_PREFIX
+# @DESCRIPTION:
+# The full URI prefix of the distfile for each l10n locale. The
+# AB_CD and MOZ_L10N_URI_SUFFIX will be appended to this to complete the
+# SRC_URI when MOZ_GENERATE_LANGPACKS is set. If empty, nothing will
+# be added to SRC_URI.
+# Defaults to empty.
+: ${MOZ_L10N_URI_PREFIX:=""}
+
+# @ECLASS-VARIABLE: MOZ_L10N_URI_SUFFIX
+# @DESCRIPTION:
+# The suffix of l10n source distfiles.
+# Defaults to '.tar.xz'
+: ${MOZ_L10N_URI_SUFFIX:=".tar.xz"}
+
# Add linguas_* to IUSE according to available language packs
# No language packs for alphas and betas
-if ! [[ ${PV} =~ alpha|beta ]] || { [[ ${PN} == seamonkey ]] && ! [[ ${PV} =~
alpha ]] ; } ; then
+if ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]] ; then
+ if ! [[ ${PV} =~ alpha|beta ]] || { [[ ${PN} == seamonkey ]] && ! [[
${PV} =~ alpha ]] ; } ; then
+ [[ -z ${MOZ_FTP_URI} ]] && [[ -z ${MOZ_HTTP_URI} ]] && die "No URI set
to download langpacks, please set one of MOZ_{FTP,HTTP}_URI"
for x in "${MOZ_LANGS[@]}" ; do
# en and en_US are handled internally
if [[ ${x} == en ]] || [[ ${x} == en-US ]]; then
continue
fi
- SRC_URI+="
- linguas_${x/-/_}?
- (
${MOZ_FTP_URI}/${MOZ_LANGPACK_PREFIX}${x}${MOZ_LANGPACK_SUFFIX} ->
${MOZ_P}-${x}.xpi )"
+ SRC_URI+=" linguas_${x/-/_}? ("
+ [[ -n ${MOZ_FTP_URI} ]] && SRC_URI+="
+
${MOZ_FTP_URI}/${MOZ_LANGPACK_PREFIX}${x}${MOZ_LANGPACK_SUFFIX} ->
${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi"
+ [[ -n ${MOZ_HTTP_URI} ]] && SRC_URI+="
+
${MOZ_HTTP_URI}/${MOZ_LANGPACK_PREFIX}${x}${MOZ_LANGPACK_SUFFIX} ->
${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi"
+ SRC_URI+=" )"
IUSE+=" linguas_${x/-/_}"
# We used to do some magic if specific/generic locales were
missing, but
# we stopped doing that due to bug 325195.
done
+ fi
+else
+ for x in "${MOZ_LANGS[@]}" ; do
+ # en and en_US are handled internally
+ if [[ ${x} == en ]] || [[ ${x} == en-US ]]; then
+ continue
+ fi
+# Do NOT grab l10n sources from hg tip at this time, since it is a moving
target
+# if [[ ${PV} =~ alpha ]]; then
+# # Please note that this URI is not deterministic -
digest breakage could occur
+# SRC_URI+=" linguas_${x/-/_}? (
http://hg.mozilla.org/releases/l10n/mozilla-aurora/ach/archive/tip.tar.bz2 ->
${MOZ_P}-l10n-${x}.tar.bz2 )"
+# elif [[ ${PV} =~ beta ]] && ! [[ ${PN} == seamonkey ]]; then
+# # Please note that this URI is not deterministic -
digest breakage could occur
+# SRC_URI+=" linguas_${x/-/_}? (
http://hg.mozilla.org/releases/l10n/mozilla-beta/ach/archive/tip.tar.bz2 ->
${MOZ_P}-l10n-${x}.tar.bz2 )"
+# elif [[ -n ${MOZ_L10N_URI_PREFIX} ]]; then
+ if [[ -n ${MOZ_L10N_URI_PREFIX} ]]; then
+ SRC_URI+=" linguas_${x/-/_}? (
${MOZ_L10N_URI_PREFIX}${x}${MOZ_L10N_URI_SUFFIX} )"
+ fi
+ IUSE+=" linguas_${x/-/_}"
+ done
fi
unset x
@@ -90,9 +161,9 @@
# This list is used to unpack and install the xpi language packs
mozlinguas_export() {
if [[ ${PN} == seamonkey ]] ; then
- [[ ${PV} =~ alpha ]] && return
+ [[ ${PV} =~ alpha ]] && ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]] &&
return
else
- [[ ${PV} =~ alpha|beta ]] && return
+ [[ ${PV} =~ alpha|beta ]] && ! [[ -n ${MOZ_GENERATE_LANGPACKS}
]] && return
fi
local lingua
mozlinguas=()
@@ -120,23 +191,117 @@
# Unpack xpi language packs according to the user's LINGUAS settings
mozlinguas_src_unpack() {
local x
- mozlinguas_export
- for x in "${mozlinguas[@]}"; do
- # FIXME: Add support for unpacking xpis to portage
- xpi_unpack "${MOZ_P}-${x}.xpi"
- done
- if [[ "${mozlinguas[*]}" != "" && "${mozlinguas[*]}" != "en" ]]; then
- einfo "Selected language packs (first will be default):
${mozlinguas[*]}"
+ if ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]]; then
+ mozlinguas_export
+ for x in "${mozlinguas[@]}"; do
+ # FIXME: Add support for unpacking xpis to portage
+ xpi_unpack
"${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi"
+ done
+ if [[ "${mozlinguas[*]}" != "" && "${mozlinguas[*]}" != "en"
]]; then
+ einfo "Selected language packs (first will be default):
${mozlinguas[*]}"
+ fi
fi
}
+# @FUNCTION: mozlinguas_mozconfig
+# @DESCRIPTION:
+# if applicable, add the necessary flag to .mozconfig to support
+# the generation of locales
+mozlinguas_mozconfig() {
+ if [[ -n ${MOZ_GENERATE_LANGPACKS} ]]; then
+ mozconfig_annotate 'for building locales'
--with-l10n-base=${MOZ_L10N_SOURCEDIR}
+ fi
+}
+
+# @FUNCTION: mozlinguas_src_compile
+# @DESCRIPTION:
+# if applicable, build the selected locales.
+mozlinguas_src_compile() {
+ if [[ -n ${MOZ_GENERATE_LANGPACKS} ]]; then
+ # leverage BUILD_OBJ_DIR if set otherwise assume PWD.
+ local x y targets=( "langpack" ) localedir="${BUILD_OBJ_DIR:-.}"
+ case ${PN} in
+ *firefox)
+ localedir+="/browser/locales"
+ ;;
+ seamonkey)
+ localedir+="/suite/locales"
+ ;;
+ *thunderbird)
+ localedir+="/mail/locales"
+ targets+=( "calendar-langpack" )
+ ;;
+ *) die "Building locales for ${PN} is not supported."
+ esac
+ pushd "${localedir}" > /dev/null || die
+ mozlinguas_export
+ for x in "${mozlinguas[@]}"; do for y in "${targets[@]}"; do
+ emake ${y}-${x} LOCALE_MERGEDIR="./${y}-${x}"
+ done; done
+ popd > /dev/null || die
+ fi
+}
+
+# @FUNCTION: mozlinguas_xpistage_langpacks
+# @DESCRIPTION:
+# Add extra langpacks to the xpi-stage dir for prebuilt plugins
+#
+# First argument is the path to the extension
+# Second argument is the prefix of the source (same as first if unspecified)
+# Remaining arguments are the modules in the extension that are localized
+# (basename of first if unspecified)
+#
+# Example - installing extra langpacks for lightning:
+# src_install() {
+# ... # general installation steps
+# mozlinguas_xpistage_langpacks \
+# "${BUILD_OBJ_DIR}"/dist/xpi-stage/lightning \
+# "${WORKDIR}"/lightning \
+# lightning calendar
+# ... # proceed with installation from the xpi-stage dir
+# }
+
+mozlinguas_xpistage_langpacks() {
+ local l c modpath="${1}" srcprefix="${1}" modules=( "${1##*/}" )
+ shift
+ if [[ -n ${1} ]] ; then srcprefix="${1}" ; shift ; fi
+ if [[ -n ${1} ]] ; then modules=( $@ ) ; fi
+
+ mozlinguas_export
+ for l in "${mozlinguas[@]}"; do for c in "${modules[@]}" ; do
+ if [[ -e "${srcprefix}-${l}/chrome/${c}-${l}" ]]; then
+ cp -RLp -t "${modpath}/chrome"
"${srcprefix}-${l}/chrome/${c}-${l}" || die
+ grep "locale ${c} ${l} chrome/"
"${srcprefix}-${l}/chrome.manifest" \
+ >>"${modpath}/chrome.manifest" || die
+ elif [[ -e "${srcprefix}/chrome/${c}-${l}" ]]; then
+ cp -RLp -t "${modpath}/chrome"
"${srcprefix}/chrome/${c}-${l}" || die
+ grep "locale ${c} ${l} chrome/"
"${srcprefix}/chrome.manifest" \
+ >>"${modpath}/chrome.manifest" || die
+ else
+ ewarn "Locale ${l} was not found for ${c}, skipping."
+ fi
+ done; done
+}
+
# @FUNCTION: mozlinguas_src_install
# @DESCRIPTION:
# Install xpi language packs according to the user's LINGUAS settings
+# NOTE - uses ${BUILD_OBJ_DIR} or PWD if unset, for source-generated langpacks
mozlinguas_src_install() {
local x
mozlinguas_export
+ if [[ -n ${MOZ_GENERATE_LANGPACKS} ]]; then
+ local repopath="${WORKDIR}/${PN}-generated-langpacks"
+ mkdir -p "${repopath}"
+ pushd "${BUILD_OBJ_DIR:-.}"/dist/*/xpi > /dev/null || die
+ for x in "${mozlinguas[@]}"; do
+ cp "${MOZ_P}.${x}.langpack.xpi" \
+
"${repopath}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi" || die
+ xpi_unpack
"${repopath}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi"
+ done
+ popd > /dev/null || die
+ fi
for x in "${mozlinguas[@]}"; do
- xpi_install "${WORKDIR}/${MOZ_P}-${x}"
+ xpi_install
"${WORKDIR}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}"
done
}