public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Nirbheek Chauhan" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/mozilla:master commit in: mail-client/thunderbird/, www-client/firefox/, www-client/firefox-bin/, eclass/, ...
Date: Tue,  3 Jan 2012 07:24:34 +0000 (UTC)	[thread overview]
Message-ID: <5b1898fe2b1bdd09258a9d2d8056b28f8f3ee0a0.nirbheek@gentoo> (raw)

commit:     5b1898fe2b1bdd09258a9d2d8056b28f8f3ee0a0
Author:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  3 07:20:49 2012 +0000
Commit:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Tue Jan  3 07:20:49 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/mozilla.git;a=commit;h=5b1898fe

Add mozlinguas.eclass, and port firefox + thunderbird to it

* Binary ebuilds were ported as well
* Will port seamonkey later, since its needs seem to be very specific
* After porting, I need to post it to gentoo-dev for comments

---
 eclass/mozlinguas.eclass                           |  112 ++++++++++++++++++++
 mail-client/thunderbird-bin/Manifest               |    3 +-
 .../thunderbird-bin/thunderbird-bin-9.0.1.ebuild   |   83 ++++-----------
 mail-client/thunderbird/Manifest                   |    2 +-
 mail-client/thunderbird/thunderbird-8.0-r2.ebuild  |   91 ++++------------
 www-client/firefox-bin/Manifest                    |    3 +-
 www-client/firefox-bin/firefox-bin-9.0.ebuild      |   97 ++++-------------
 www-client/firefox/Manifest                        |    2 +-
 www-client/firefox/firefox-9.0.ebuild              |  103 +++++-------------
 9 files changed, 208 insertions(+), 288 deletions(-)

diff --git a/eclass/mozlinguas.eclass b/eclass/mozlinguas.eclass
new file mode 100644
index 0000000..b6ece9b
--- /dev/null
+++ b/eclass/mozlinguas.eclass
@@ -0,0 +1,112 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# @ECLASS: mozlinguas.eclass
+# @MAINTAINER: mozilla@gentoo.org
+# @AUTHOR: Nirbheek Chauhan <nirbheek@gentoo.org>
+# @BLURB: Handle language packs for mozilla products
+# @DESCRIPTION:
+# Sets IUSE according to LANGS (language packs available). Also exports
+# src_unpack and src_install for use in ebuilds.
+
+inherit mozextension
+
+case "${EAPI:-0}" in
+	0|1)
+		die "EAPI ${EAPI:-0} does not support the '->' SRC_URI operator";;
+	2|3|4)
+		EXPORT_FUNCTIONS src_unpack src_install;;
+	*)
+		die "EAPI ${EAPI} is not supported, contact eclass maintainers";;
+esac
+
+# @ECLASS-VARIABLE: LANGS
+# @DEFAULT-UNSET
+# @DESCRIPTION: Array containing the list of language pack xpis available for
+# this release. The list can be updated with scripts/get_langs.sh from the
+# mozilla overlay.
+: ${LANGS:=""}
+
+# @ECLASS-VARIABLE: FTP_URI
+# @DEFAULT-UNSET
+# @DESCRIPTION: The ftp URI prefix for the release tarballs and language packs.
+: ${FTP_URI:=""}
+
+# @ECLASS-VARIABLE: MOZ_PV
+# @DESCRIPTION: Ebuild package version converted to equivalent upstream version.
+# Defaults to ${PV}, and should be overridden for alphas, betas, and RCs
+: ${MOZ_PV:="${PV}"}
+
+# @ECLASS-VARIABLE: MOZ_PN
+# @DESCRIPTION: Ebuild package name converted to equivalent upstream name.
+# Defaults to ${PN}, and should be overridden for binary ebuilds.
+: ${MOZ_PN:="${PN}"}
+
+# @ECLASS-VARIABLE: MOZ_P
+# @DESCRIPTION: Ebuild package name + version converted to upstream equivalent.
+# Defaults to ${MOZ_PN}-${MOZ_PV}
+: ${MOZ_P:="${MOZ_PN}-${MOZ_PV}"}
+
+# Add linguas_* to IUSE according to available language packs
+# No language packs for alphas and betas
+if ! [[ ${PV} =~ alpha|beta ]]; then
+	for X in "${LANGS[@]}" ; do
+		# en and en_US are handled internally
+		if [[ ${X} = en ]] || [[ ${X} = en-US ]]; then
+			continue
+		fi
+		SRC_URI="${SRC_URI}
+			linguas_${X/-/_}? ( ${FTP_URI}/${MOZ_PV}/linux-i686/xpi/${X}.xpi -> ${MOZ_P}-${X}.xpi )"
+		IUSE="${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
+
+linguas() {
+	# Generate the list of language packs called "linguas"
+	# This list is used to unpack and install the xpi language packs
+	local LINGUA
+	for LINGUA in ${LINGUAS}; do
+		if has ${LINGUA} en en_US; then
+			# For mozilla products, en and en_US are handled internally
+			continue
+		# If this language is supported by ${P},
+		elif has ${LINGUA} "${LANGS[@]//-/_}"; then
+			# Add the language to linguas, if it isn't already there
+			has ${LINGUA//_/-} "${linguas[@]}" || linguas+=(${LINGUA//_/-})
+			continue
+		# For each short LINGUA that isn't in LANGS,
+		# We used to add *all* long LANGS to the linguas list,
+		# but we stopped doing that due to bug 325195.
+		fi
+		ewarn "Sorry, but ${P} does not support the ${LINGUA} locale"
+	done
+}
+
+# @FUNCTION: mozlinguas_src_unpack
+# @DESCRIPTION:
+# Unpack xpi language packs according to the user's LINGUAS settings
+mozlinguas_src_unpack() {
+	local X
+	linguas
+	for X in "${linguas[@]}"; do
+		# FIXME: Add support for unpacking xpis to portage
+		xpi_unpack "${MOZ_P}-${X}.xpi"
+	done
+	if [[ "${linguas[*]}" != "" && "${linguas[*]}" != "en" ]]; then
+		einfo "Selected language packs (first will be default): ${linguas[*]}"
+	fi
+}
+
+# @FUNCTION: mozlinguas_src_install
+# @DESCRIPTION:
+# Install xpi language packs according to the user's LINGUAS settings
+mozlinguas_src_install() {
+	local X
+	linguas
+	for X in "${linguas[@]}"; do
+		xpi_install "${WORKDIR}/${MOZ_P}-${X}"
+	done
+}

diff --git a/mail-client/thunderbird-bin/Manifest b/mail-client/thunderbird-bin/Manifest
index 0acda36..38b0fad 100644
--- a/mail-client/thunderbird-bin/Manifest
+++ b/mail-client/thunderbird-bin/Manifest
@@ -54,6 +54,5 @@ DIST thunderbird-9.0.1-zh-CN.xpi 426798 RMD160 d6cc996f801e93e8c1ebcd15477686e84
 DIST thunderbird-9.0.1-zh-TW.xpi 427201 RMD160 d3a47ee5b8283839b57bea335ae96a7f478d9122 SHA1 fa5fa533f16cf69be45493e885a7b8cd7521c370 SHA256 34dba557c5821410526bb910770bb8f9b22508a16bdcd4f729fd94dde6815924
 DIST thunderbird-bin_i686-9.0.1.tar.bz2 18995445 RMD160 46370c2e124fa71671a1374867a0835358313571 SHA1 ea6da4d1b46978cb13367cb66dc64123b0a1201d SHA256 9cc7a222ccf764696308cfe7a043af401cba322ee4f2a1a5897df128f12b9b5a
 DIST thunderbird-bin_x86_64-9.0.1.tar.bz2 22025281 RMD160 74ad4c1acf68aedb91e0e3be6fba80360a5c2558 SHA1 0e18402491a4c112fec633c6427db4a4b5ef9ec5 SHA256 536ab6fbdad0ff3bde2c9406b718888c3128f8def8d8d8c1f395a44611d849e8
-EBUILD thunderbird-bin-9.0.1.ebuild 4203 RMD160 35cb9da9a0d4c9432f3c825bddebbce86f4c5f55 SHA1 4a87293c6236df2adc0e19a90df620a4887c6b4d SHA256 9653a2fa5a0fdf10b3045bec009d1b10a354db9d80e7feb6a74f9e57730c4b5c
-MISC ChangeLog 33054 RMD160 1a42087d21f839375f18a0eecd2dd4b54d60fef4 SHA1 3ddadd2e2a3e8646743ccc4b322079db599b48a7 SHA256 6971534275ed68690318210986f93ddd37e9a5e9c45c932d7dc58bce0794a14a
+EBUILD thunderbird-bin-9.0.1.ebuild 2865 RMD160 58f0f6859ae0e4f8ae55ce7b6bcd293e1065403f SHA1 eb5d32864222458824aa098b19ef6c73b5dcfc84 SHA256 64454048f39ace6f913f982119fba2e65d854978e93e7c8097c03161c7fb1431
 MISC metadata.xml 239 RMD160 1ae864a1acabe6bbce1c44a39d0ea55e04ccfaa7 SHA1 2760f4017fb87bfec958b0472cd86151bb3c3ab3 SHA256 7dc1b4cbb0d49bbe877f0978fc8cd278614f95982a4375336dfb5b72e866efd0

diff --git a/mail-client/thunderbird-bin/thunderbird-bin-9.0.1.ebuild b/mail-client/thunderbird-bin/thunderbird-bin-9.0.1.ebuild
index 39a9791..a03d7b2 100644
--- a/mail-client/thunderbird-bin/thunderbird-bin-9.0.1.ebuild
+++ b/mail-client/thunderbird-bin/thunderbird-bin-9.0.1.ebuild
@@ -4,22 +4,27 @@
 
 EAPI="3"
 
-inherit eutils multilib mozextension pax-utils fdo-mime gnome2-utils
-
 # Can be updated using scripts/get_langs.sh from mozilla overlay
 LANGS=(ar be bg bn-BD br ca cs da de el en en-GB en-US es-AR es-ES et eu fi fr
 fy-NL ga-IE gd gl he hu id is it ja ko lt nb-NO nl nn-NO pa-IN pl pt-BR pt-PT rm
 ro ru si sk sl sq sv-SE ta-LK tr uk vi zh-CN zh-TW)
 
-MY_PN="${PN/-bin}"
-MY_PV="${PV/_beta/b}"
-MY_P="${MY_PN}-${MY_PV}"
+# Upstream ftp release URI that's used by mozlinguas.eclass
+# We don't use the http mirror because it deletes old tarballs.
+FTP_URI="ftp://ftp.mozilla.org/pub/mozilla.org/${MOZ_PN}/releases/"
+
+# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
+MOZ_PN="${PN/-bin}"
+MOZ_PV="${PV/_beta/b}"
+MOZ_PV="${MOZ_PV/_rc/rc}"
+MOZ_P="${MOZ_PN}-${MOZ_PV}"
+
+inherit eutils multilib pax-utils fdo-mime gnome2-utils mozlinguas
 
 DESCRIPTION="Thunderbird Mail Client"
-FTP_URI="ftp://ftp.mozilla.org/pub/mozilla.org/${MY_PN}/releases/"
-SRC_URI="
-	amd64? ( ${FTP_URI}/${MY_PV}/linux-x86_64/en-US/${MY_P}.tar.bz2 -> ${PN}_x86_64-${PV}.tar.bz2 )
-	x86? ( ${FTP_URI}/${MY_PV}/linux-i686/en-US/${MY_P}.tar.bz2 -> ${PN}_i686-${PV}.tar.bz2 )"
+SRC_URI="${SRC_URI}
+	amd64? ( ${FTP_URI}/${MOZ_PV}/linux-x86_64/en-US/${MOZ_P}.tar.bz2 -> ${PN}_x86_64-${PV}.tar.bz2 )
+	x86? ( ${FTP_URI}/${MOZ_PV}/linux-i686/en-US/${MOZ_P}.tar.bz2 -> ${PN}_i686-${PV}.tar.bz2 )"
 HOMEPAGE="http://www.mozilla.com/thunderbird"
 RESTRICT="strip"
 
@@ -28,22 +33,6 @@ SLOT="0"
 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
 IUSE="+crashreporter"
 
-for X in "${LANGS[@]}" ; do
-	# en and en_US are handled internally
-	if [[ ${X} != en ]] && [[ ${X} != en-US ]]; then
-		SRC_URI="${SRC_URI}
-			linguas_${X/-/_}? ( ${FTP_URI}/${MY_PV}/linux-i686/xpi/${X}.xpi -> ${P/-bin}-${X}.xpi )"
-	fi
-	IUSE="${IUSE} linguas_${X/-/_}"
-	# Install all the specific locale xpis if there's no generic locale xpi
-	# Example: there's no pt.xpi, so install all pt-*.xpi
-	if ! has ${X%%-*} "${LANGS[@]}"; then
-		SRC_URI="${SRC_URI}
-			linguas_${X%%-*}? ( ${FTP_URI}/${MY_PV}/linux-i686/xpi/${X}.xpi -> ${P/-bin}-${X}.xpi )"
-		IUSE="${IUSE} linguas_${X%%-*}"
-	fi
-done
-
 DEPEND="app-arch/unzip"
 RDEPEND="x11-libs/libXrender
 	x11-libs/libXt
@@ -51,56 +40,24 @@ RDEPEND="x11-libs/libXrender
 	>=x11-libs/gtk+-2.2:2
 	crashreporter? ( net-misc/curl ) "
 
-S="${WORKDIR}/${MY_PN}"
-
-# TODO: Move all the linguas crap to an eclass
-linguas() {
-	# Generate the list of language packs called "linguas"
-	# This list is used to install the xpi language packs
-	local LINGUA
-	for LINGUA in ${LINGUAS}; do
-		if has ${LINGUA} en en_US; then
-			# For mozilla products, en and en_US are handled internally
-			continue
-		# If this language is supported by ${P},
-		elif has ${LINGUA} "${LANGS[@]//-/_}"; then
-			# Add the language to linguas, if it isn't already there
-			has ${LINGUA//_/-} "${linguas[@]}" || linguas+=(${LINGUA//_/-})
-			continue
-		# For each short LINGUA that isn't in LANGS,
-		# add *all* long LANGS to the linguas list
-		elif ! has ${LINGUA%%-*} "${LANGS[@]}"; then
-			for LANG in "${LANGS[@]}"; do
-				if [[ ${LANG} == ${LINGUA}-* ]]; then
-					has ${LANG} "${linguas[@]}" || linguas+=(${LANG})
-					continue 2
-				fi
-			done
-		fi
-		ewarn "Sorry, but ${P} does not support the ${LINGUA} locale"
-	done
-}
+S="${WORKDIR}/${MOZ_PN}"
 
 src_unpack() {
 	unpack ${A}
 
-	linguas
-	for X in "${linguas[@]}"; do
-		xpi_unpack "${P/-bin}-${X}.xpi"
-	done
+	# Unpack language packs
+	mozlinguas_src_unpack
 }
 
 src_install() {
-	declare MOZILLA_FIVE_HOME="/opt/${MY_PN}"
+	declare MOZILLA_FIVE_HOME="/opt/${MOZ_PN}"
 
 	# Install thunderbird in /opt
 	dodir ${MOZILLA_FIVE_HOME%/*}
 	mv "${S}" "${D}"${MOZILLA_FIVE_HOME}
 
-	linguas
-	for X in "${linguas[@]}"; do
-		xpi_install "${WORKDIR}/${P/-bin}-${X}"
-	done
+	# Install language packs
+	mozlinguas_src_install
 
 	# Create /usr/bin/thunderbird-bin
 	dodir /usr/bin/

diff --git a/mail-client/thunderbird/Manifest b/mail-client/thunderbird/Manifest
index 432c859..4b80ce3 100644
--- a/mail-client/thunderbird/Manifest
+++ b/mail-client/thunderbird/Manifest
@@ -56,4 +56,4 @@ DIST thunderbird-8.0-zh-CN.xpi 422519 RMD160 ef881e92de682aa3d807a53a7f536f51e67
 DIST thunderbird-8.0-zh-TW.xpi 423019 RMD160 3326d286df45aee39ea4dc9303c6e4459b41dba2 SHA1 a81c24ab001eb521a1b4e49da16c8f6914676641 SHA256 a6c78df16a242b1731709fdacae8fcfde630fe10469abfd6a696b46076e9059a
 DIST thunderbird-8.0.source.tar.bz2 89435206 RMD160 373420ec009a7f28f12a64a0d55e9d959573974e SHA1 18b77e44f1653eb3d59056870f535e3c373d99fd SHA256 f728bd2dbc04e6c3a096d79a9ee320740f53794a28be307da8655c8fd90f77f5
 DIST thunderbird-9.0-patches-0.1.tar.xz 696 RMD160 986ad69f21f6eddf46b73258b0a2aa8eb85fb9c4 SHA1 62dd6e724e2e3a1b76eaed3d165e2e9f47385f8a SHA256 64028e8ca37e1259ed196dfe6e8a87cd08153047f80639ca36cfd276eaa9aaea
-EBUILD thunderbird-8.0-r2.ebuild 9851 RMD160 9c684fca7e96c6eb2a2779b02d7a8bdb7f067c3e SHA1 c257c939d12405addf9324e08639803e1bd121c3 SHA256 c295eb5b0fadeb0dd82433834a673ea09c691b480ff3fc2b1f652ad5d5c3d6f9
+EBUILD thunderbird-8.0-r2.ebuild 8371 RMD160 a2a2b269de738ffc94b9c92b4693f8f1744d3d81 SHA1 357ad2e665ec52d5e4a39bda812bc0aa2bf11b58 SHA256 ff38162eec9af0eeb6b42c2df7e5d3d8b41fc849bb2bdc9b3cf8e2d8883e691a

diff --git a/mail-client/thunderbird/thunderbird-8.0-r2.ebuild b/mail-client/thunderbird/thunderbird-8.0-r2.ebuild
index 18d87fd..87333da 100644
--- a/mail-client/thunderbird/thunderbird-8.0-r2.ebuild
+++ b/mail-client/thunderbird/thunderbird-8.0-r2.ebuild
@@ -5,11 +5,22 @@
 EAPI="3"
 WANT_AUTOCONF="2.1"
 
-inherit flag-o-matic toolchain-funcs mozconfig-3 makeedit multilib mozextension autotools pax-utils python check-reqs nsplugins
+# This list can be updated using scripts/get_langs.sh from the mozilla overlay
+LANGS=(ar be bg bn-BD br ca cs da de el en en-GB en-US es-AR es-ES et eu fi
+fr fy-NL ga-IE gd gl he hu id is it ja ko lt nb-NO nl nn-NO pa-IN pl pt-BR
+pt-PT rm ro ru si sk sl sq sv-SE ta-LK tr uk vi zh-CN zh-TW)
 
-TB_PV="${PV/_beta/b}"
-TB_P="${PN}-${TB_PV}"
+# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
+MOZ_PV="${PV/_beta/b}"
+MOZ_P="${PN}-${MOZ_PV}"
+
+# Enigmail version
 EMVER="1.3.4"
+# Upstream ftp release URI that's used by mozlinguas.eclass
+# We don't use the http mirror because it deletes old tarballs.
+FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
+
+inherit flag-o-matic toolchain-funcs mozconfig-3 makeedit multilib autotools pax-utils python check-reqs nsplugins mozlinguas
 
 DESCRIPTION="Thunderbird Mail Client"
 HOMEPAGE="http://www.mozilla.com/en-US/thunderbird/"
@@ -18,38 +29,16 @@ KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
 SLOT="0"
 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
 IUSE="bindist gconf +crashreporter +crypt +ipc +lightning mozdom +webm"
+
 PATCH="${PN}-9.0-patches-0.1"
 PATCHFF="firefox-${PV}-patches-0.2"
 
-FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
-SRC_URI="${FTP_URI}/${TB_PV}/source/${TB_P}.source.tar.bz2
+SRC_URI="${SRC_URI}
+	${FTP_URI}/${MOZ_PV}/source/${MOZ_P}.source.tar.bz2
 	crypt? ( http://www.mozilla-enigmail.org/download/source/enigmail-${EMVER}.tar.gz )
 	http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
 	http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCHFF}.tar.xz"
 
-if ! [[ ${PV} =~ alpha|beta ]]; then
-	# This list can be updated using scripts/get_langs.sh from the mozilla overlay
-	LANGS=(ar be bg bn-BD br ca cs da de el en en-GB en-US es-AR es-ES et eu fi
-	fr fy-NL ga-IE gd gl he hu id is it ja ko lt nb-NO nl nn-NO pa-IN pl pt-BR
-	pt-PT rm ro ru si sk sl sq sv-SE ta-LK tr uk vi zh-CN zh-TW)
-
-	for X in "${LANGS[@]}" ; do
-		# en and en_US are handled internally
-		if [[ ${X} != en ]] && [[ ${X} != en-US ]]; then
-			SRC_URI="${SRC_URI}
-				linguas_${X/-/_}? ( ${FTP_URI}/${TB_PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
-		fi
-		IUSE="${IUSE} linguas_${X/-/_}"
-		# Install all the specific locale xpis if there's no generic locale xpi
-		# Example: there's no pt.xpi, so install all pt-*.xpi
-		if ! has ${X%%-*} "${LANGS[@]}"; then
-			SRC_URI="${SRC_URI}
-				linguas_${X%%-*}? ( ${FTP_URI}/${TB_PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
-			IUSE="${IUSE} linguas_${X%%-*}"
-		fi
-	done
-fi
-
 RDEPEND=">=sys-devel/binutils-2.16.1
 	>=dev-libs/nss-3.12.10
 	>=dev-libs/nspr-4.8.8
@@ -75,34 +64,6 @@ DEPEND="${RDEPEND}"
 
 S="${WORKDIR}"/comm-release
 
-# TODO: Move all the linguas crap to an eclass
-linguas() {
-	# Generate the list of language packs called "linguas"
-	# This list is used to install the xpi language packs
-	local LINGUA
-	for LINGUA in ${LINGUAS}; do
-		if has ${LINGUA} en en_US; then
-			# For mozilla products, en and en_US are handled internally
-			continue
-		# If this language is supported by ${P},
-		elif has ${LINGUA} "${LANGS[@]//-/_}"; then
-			# Add the language to linguas, if it isn't already there
-			has ${LINGUA//_/-} "${linguas[@]}" || linguas+=(${LINGUA//_/-})
-			continue
-		# For each short LINGUA that isn't in LANGS,
-		# add *all* long LANGS to the linguas list
-		elif ! has ${LINGUA%%-*} "${LANGS[@]}"; then
-			for LANG in "${LANGS[@]}"; do
-				if [[ ${LANG} == ${LINGUA}-* ]]; then
-					has ${LANG} "${linguas[@]}" || linguas+=(${LANG})
-					continue 2
-				fi
-			done
-		fi
-		ewarn "Sorry, but ${P} does not support the ${LINGUA} locale"
-	done
-}
-
 pkg_setup() {
 	moz_pkgsetup
 
@@ -124,12 +85,8 @@ pkg_setup() {
 src_unpack() {
 	unpack ${A}
 
-	if ! [[ ${PV} =~ alpha|beta ]]; then
-		linguas
-		for X in "${linguas[@]}"; do
-			xpi_unpack "${P}-${X}.xpi"
-		done
-	fi
+	# Unpack language packs
+	mozlinguas_src_unpack
 }
 
 src_prepare() {
@@ -250,6 +207,9 @@ src_install() {
 
 	emake DESTDIR="${D}" install || die "emake install failed"
 
+	# Install language packs
+	mozlinguas_src_install
+
 	if ! use bindist; then
 		newicon "${S}"/other-licenses/branding/thunderbird/content/icon48.png thunderbird-icon.png
 		domenu "${FILESDIR}"/icon/${PN}.desktop
@@ -295,13 +255,6 @@ src_install() {
 			-i "${ED}"/usr/share/applications/${PN}.desktop
 	fi
 
-	if ! [[ ${PV} =~ alpha|beta ]]; then
-		linguas
-		for X in "${linguas[@]}"; do
-			xpi_install "${WORKDIR}/${P}-${X}"
-		done
-	fi
-
 	pax-mark m "${ED}"/${MOZILLA_FIVE_HOME}/thunderbird-bin
 
 	# Enable very specific settings for thunderbird-3

diff --git a/www-client/firefox-bin/Manifest b/www-client/firefox-bin/Manifest
index f6452f4..74b1f3d 100644
--- a/www-client/firefox-bin/Manifest
+++ b/www-client/firefox-bin/Manifest
@@ -85,6 +85,5 @@ DIST firefox-9.0-zh-TW.xpi 247498 RMD160 163fa9dde9caa2e209eff47a1bdfee6cfd807aa
 DIST firefox-9.0-zu.xpi 238395 RMD160 67afb3fd7bd9006830747a75b5175facf8615f86 SHA1 1b7c947e15d5fb2f75503e1cad9940283edc87d5 SHA256 aedf4ab70c7cf603210e4ece1c21faf0c031f7b488dddc074c3f00e9d9a2feb5
 DIST firefox-bin_i686-9.0.tar.bz2 16842339 RMD160 190a782228ba276d0862d44ebe5e06f6a4fb8939 SHA1 bd8652a826bfe4f3ec21425967d437582c9c4f85 SHA256 6c7a2bcfb4af5ed94fb3361380036c9cf33624330251c3c4793e26e15c50cb6c
 DIST firefox-bin_x86_64-9.0.tar.bz2 18632139 RMD160 758976ca43e41d8feab58ade1001cf9a7b86f347 SHA1 bb9674a8fec3bb3d640aa38220a4f2081454b220 SHA256 3dce7000ec01ea101370bbc9c685cc67e5b9bd0395566b887dfe5d09f7c6cd9c
-EBUILD firefox-bin-9.0.ebuild 5564 RMD160 64642170e8a74eba6a5a4e58b58cc1c8ea2e9ef2 SHA1 4e691d5d23fe86a54247bab4ddf16e3304b7d041 SHA256 48756b6b55d8cc45ade8d801094c76c43e5b22a45a78188945c73cc750936f68
-MISC ChangeLog 51157 RMD160 5d23efa1422a7f3bf9034db6c11a7153e8450587 SHA1 d71eb3ac85978142c83ebe6f1f7083c3246da042 SHA256 7b1179e5fd74761c9d6b355f981271afc5a0d14f1a6152431bc70ecac3fd9f77
+EBUILD firefox-bin-9.0.ebuild 3749 RMD160 889bc5056ada1521081454aab3d96a46a1572086 SHA1 ef812f9b07774f668f2a81c84b6502e3c1001b5e SHA256 eeccce7957dbccb06e10c5deacd11d2959028a679bc5cdcb2fc216d685bc44b1
 MISC metadata.xml 160 RMD160 d5a9f0bf8989621c2bde30facb53bcae00aba709 SHA1 5015c07af2083f20f9552d7fb11afb5ea69af345 SHA256 0cc5126362a12cee42ec1197c528a804cf36859329dd2c6d9225726831d14b8b

diff --git a/www-client/firefox-bin/firefox-bin-9.0.ebuild b/www-client/firefox-bin/firefox-bin-9.0.ebuild
index aa07b02..e7a31aa 100644
--- a/www-client/firefox-bin/firefox-bin-9.0.ebuild
+++ b/www-client/firefox-bin/firefox-bin-9.0.ebuild
@@ -4,8 +4,6 @@
 
 EAPI="3"
 
-inherit eutils mozilla-launcher multilib mozextension pax-utils fdo-mime gnome2-utils
-
 # Can be updated using scripts/get_langs.sh from mozilla overlay
 LANGS=(af ak ar ast be bg bn-BD bn-IN br bs ca cs cy da de el en en-GB en-US
 en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr fy-NL ga-IE gd gl gu-IN he hi-IN
@@ -13,15 +11,22 @@ hr hu hy-AM id is it ja kk kn ko ku lg lt lv mai mk ml mr nb-NO nl nn-NO nso or
 pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta ta-LK te th tr uk vi
 zh-CN zh-TW zu)
 
-MY_PV="${PV/_rc/rc}"
-MY_PN="${PN/-bin}"
-MY_P="${MY_PN}-${MY_PV}"
+# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
+MOZ_PV="${PV/_beta/b}" # Handle beta for SRC_URI
+MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
+MOZ_PN="${PN/-bin}"
+MOZ_P="${MOZ_PN}-${MOZ_PV}"
+
+# Upstream ftp release URI that's used by mozlinguas.eclass
+# We don't use the http mirror because it deletes old tarballs.
+FTP_URI="ftp://ftp.mozilla.org/pub/mozilla.org/${MOZ_PN}/releases/"
+
+inherit eutils mozilla-launcher multilib pax-utils fdo-mime gnome2-utils mozlinguas
 
 DESCRIPTION="Firefox Web Browser"
-FTP_URI="ftp://ftp.mozilla.org/pub/mozilla.org/${MY_PN}/releases/"
-SRC_URI="
-	amd64? ( ${FTP_URI}/${MY_PV}/linux-x86_64/en-US/${MY_P}.tar.bz2 -> ${PN}_x86_64-${PV}.tar.bz2 )
-	x86? ( ${FTP_URI}/${MY_PV}/linux-i686/en-US/${MY_P}.tar.bz2 -> ${PN}_i686-${PV}.tar.bz2 )"
+SRC_URI="${SRC_URI}
+	amd64? ( ${FTP_URI}/${MOZ_PV}/linux-x86_64/en-US/${MOZ_P}.tar.bz2 -> ${PN}_x86_64-${PV}.tar.bz2 )
+	x86? ( ${FTP_URI}/${MOZ_PV}/linux-i686/en-US/${MOZ_P}.tar.bz2 -> ${PN}_i686-${PV}.tar.bz2 )"
 HOMEPAGE="http://www.mozilla.com/firefox"
 RESTRICT="strip mirror"
 
@@ -30,22 +35,6 @@ SLOT="0"
 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
 IUSE="startup-notification"
 
-for X in "${LANGS[@]}" ; do
-	# en and en_US are handled internally
-	if [[ ${X} != en ]] && [[ ${X} != en-US ]]; then
-		SRC_URI="${SRC_URI}
-			linguas_${X/-/_}? ( ${FTP_URI}/${MY_PV}/linux-i686/xpi/${X}.xpi -> ${P/-bin/}-${X}.xpi )"
-	fi
-	IUSE="${IUSE} linguas_${X/-/_}"
-	# Install all the specific locale xpis if there's no generic locale xpi
-	# Example: there's no pt.xpi, so install all pt-*.xpi
-	if ! has ${X%%-*} "${LANGS[@]}"; then
-		SRC_URI="${SRC_URI}
-			linguas_${X%%-*}? ( ${FTP_URI}/${MY_PV}/linux-i686/xpi/${X}.xpi -> ${P/-bin/}-${X}.xpi )"
-		IUSE="${IUSE} linguas_${X%%-*}"
-	fi
-done
-
 DEPEND="app-arch/unzip"
 RDEPEND="dev-libs/dbus-glib
 	x11-libs/libXrender
@@ -56,51 +45,17 @@ RDEPEND="dev-libs/dbus-glib
 	>=media-libs/alsa-lib-1.0.16
 "
 
-S="${WORKDIR}/${MY_PN}"
-
-# TODO: Move all the linguas crap to an eclass
-linguas() {
-	# Generate the list of language packs called "linguas"
-	# This list is used to install the xpi language packs
-	local LINGUA
-	for LINGUA in ${LINGUAS}; do
-		if has ${LINGUA} en en_US; then
-			# For mozilla products, en and en_US are handled internally
-			continue
-		# If this language is supported by ${P},
-		elif has ${LINGUA} "${LANGS[@]//-/_}"; then
-			# Add the language to linguas, if it isn't already there
-			has ${LINGUA//_/-} "${linguas[@]}" || linguas+=(${LINGUA//_/-})
-			continue
-		# For each short LINGUA that isn't in LANGS,
-		# add *all* long LANGS to the linguas list
-		elif ! has ${LINGUA%%-*} "${LANGS[@]}"; then
-			for LANG in "${LANGS[@]}"; do
-				if [[ ${LANG} == ${LINGUA}-* ]]; then
-					has ${LANG} "${linguas[@]}" || linguas+=(${LANG})
-					continue 2
-				fi
-			done
-		fi
-		ewarn "Sorry, but ${P} does not support the ${LINGUA} locale"
-	done
-}
+S="${WORKDIR}/${MOZ_PN}"
 
 src_unpack() {
 	unpack ${A}
 
-	linguas
-	for X in "${linguas[@]}"; do
-		# FIXME: Add support for unpacking xpis to portage
-		[[ ${X} != "en" ]] && xpi_unpack "${P/-bin/}-${X}.xpi"
-	done
-	if [[ "${linguas[*]}" != "" && "${linguas[*]}" != "en" ]]; then
-		einfo "Selected language packs (first will be default): ${linguas[*]}"
-	fi
+	# Unpack language packs
+	mozlinguas_src_unpack
 }
 
 src_install() {
-	declare MOZILLA_FIVE_HOME=/opt/${MY_PN}
+	declare MOZILLA_FIVE_HOME=/opt/${MOZ_PN}
 
 	# Install icon and .desktop for menu entry
 	newicon "${S}"/chrome/icons/default/default48.png ${PN}-icon.png
@@ -119,18 +74,8 @@ src_install() {
 	insinto ${MOZILLA_FIVE_HOME}/defaults/pref/
 	doins "${FILESDIR}"/${PN}-prefs.js || die
 
-	linguas
-	for X in "${linguas[@]}"; do
-		[[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P/-bin/}-${X}"
-	done
-
-	local LANG=${linguas%% *}
-	if [[ -n ${LANG} && ${LANG} != "en" ]]; then
-		elog "Setting default locale to ${LANG}"
-		echo "pref(\"general.useragent.locale\", \"${LANG}\");" \
-			>> "${D}${MOZILLA_FIVE_HOME}"/defaults/pref/${PN}-prefs.js || \
-			die "sed failed to change locale"
-	fi
+	# Install language packs
+	mozlinguas_src_install
 
 	# Create /usr/bin/firefox-bin
 	dodir /usr/bin/
@@ -139,7 +84,7 @@ src_install() {
 	unset LD_PRELOAD
 	LD_LIBRARY_PATH="/opt/firefox/"
 	GTK_PATH=/usr/lib/gtk-2.0/
-	exec /opt/${MY_PN}/${MY_PN} "\$@"
+	exec /opt/${MOZ_PN}/${MOZ_PN} "\$@"
 	EOF
 	fperms 0755 /usr/bin/${PN}
 

diff --git a/www-client/firefox/Manifest b/www-client/firefox/Manifest
index 77191fa..374723d 100644
--- a/www-client/firefox/Manifest
+++ b/www-client/firefox/Manifest
@@ -84,4 +84,4 @@ DIST firefox-9.0-zh-CN.xpi 246728 RMD160 96aef0ad9287f41589f59246eba1d2445d18a0c
 DIST firefox-9.0-zh-TW.xpi 247498 RMD160 163fa9dde9caa2e209eff47a1bdfee6cfd807aaf SHA1 f6c14facb1556002fcfb414533c171c2b9e08582 SHA256 6b50bd60567a46fd7af62160271ab9e0d5a40666c6a812fb9adcd7bce474a936
 DIST firefox-9.0-zu.xpi 238395 RMD160 67afb3fd7bd9006830747a75b5175facf8615f86 SHA1 1b7c947e15d5fb2f75503e1cad9940283edc87d5 SHA256 aedf4ab70c7cf603210e4ece1c21faf0c031f7b488dddc074c3f00e9d9a2feb5
 DIST firefox-9.0.source.tar.bz2 74197197 RMD160 4631b103aa80ae2ae22b61453f4e02c89962f1c1 SHA1 f79324ec6205e4c23d51d8ab2e790de1b2541657 SHA256 9e876498da6c2eb2a49b57b461d5b969b11810f6af9eaa858d8e4cb514a9bd05
-EBUILD firefox-9.0.ebuild 11336 RMD160 60134fb51ae87ec41548cce8d63130fe93912716 SHA1 5fdb512fdc06b9d885bf8d96ac860215bf6699e2 SHA256 cf8782ddac928c05cefc91a2669268ddd6c2228ce34936d169ac693d34b07608
+EBUILD firefox-9.0.ebuild 9841 RMD160 dff3bead4592c4caf08266e07978ecd2af80d2d2 SHA1 bf087b91aaf119dafbc2b9ee40697bd8edc9f73f SHA256 54d7b56e3c4e8d8214ae11546e1fd6640b11f76b8d2179717b96b9c2ca79ea75

diff --git a/www-client/firefox/firefox-9.0.ebuild b/www-client/firefox/firefox-9.0.ebuild
index 966ac30..c401e11 100644
--- a/www-client/firefox/firefox-9.0.ebuild
+++ b/www-client/firefox/firefox-9.0.ebuild
@@ -6,14 +6,27 @@ EAPI="3"
 VIRTUALX_REQUIRED="pgo"
 WANT_AUTOCONF="2.1"
 
-inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 multilib pax-utils fdo-mime autotools mozextension versionator python virtualx nsplugins
-
-MAJ_FF_PV="$(get_version_component_range 1-2)" # 3.5, 3.6, 4.0, etc.
-FF_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
-FF_PV="${FF_PV/_beta/b}" # Handle beta for SRC_URI
-FF_PV="${FF_PV/_rc/rc}" # Handle rc for SRC_URI
+# This list can be updated with scripts/get_langs.sh from the mozilla overlay
+LANGS=(af ak ar ast be bg bn-BD bn-IN br bs ca cs cy da de el en en-GB en-US
+en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr fy-NL ga-IE gd gl gu-IN he
+hi-IN hr hu hy-AM id is it ja kk kn ko ku lg lt lv mai mk ml mr nb-NO nl
+nn-NO nso or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta ta-LK
+te th tr uk vi zh-CN zh-TW zu)
+
+# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
+MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
+MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
+MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
+
+# Changeset for alpha snapshot
 CHANGESET="e56ecd8b3a68"
+# Patch version
 PATCH="${PN}-9.0-patches-0.4"
+# Upstream ftp release URI that's used by mozlinguas.eclass
+# We don't use the http mirror because it deletes old tarballs.
+FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
+
+inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 multilib pax-utils fdo-mime autotools python virtualx nsplugins mozlinguas
 
 DESCRIPTION="Firefox Web Browser"
 HOMEPAGE="http://www.mozilla.com/firefox"
@@ -23,9 +36,9 @@ SLOT="0"
 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
 IUSE="bindist +crashreporter +ipc pgo system-sqlite +webm"
 
-FTP_URI="ftp://ftp.mozilla.org/pub/firefox/releases/"
 # More URIs appended below...
-SRC_URI="http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz"
+SRC_URI="${SRC_URI}
+	http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz"
 
 ASM_DEPEND=">=dev-lang/yasm-1.1"
 
@@ -54,74 +67,20 @@ DEPEND="${RDEPEND}
 # No source releases for alpha|beta
 if [[ ${PV} =~ alpha ]]; then
 	SRC_URI="${SRC_URI}
-		http://dev.gentoo.org/~anarchy/mozilla/firefox/firefox-${FF_PV}_${CHANGESET}.source.tar.bz2"
+		http://dev.gentoo.org/~anarchy/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
 	S="${WORKDIR}/mozilla-central"
 elif [[ ${PV} =~ beta ]]; then
 	SRC_URI="${SRC_URI}
-		${FTP_URI}/${FF_PV}/source/firefox-${FF_PV}.source.tar.bz2"
+		${FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
 	S="${WORKDIR}/mozilla-beta"
 else
 	SRC_URI="${SRC_URI}
-		${FTP_URI}/${FF_PV}/source/firefox-${FF_PV}.source.tar.bz2"
+		${FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
 	S="${WORKDIR}/mozilla-release"
 fi
 
-# No language packs for alphas
-if ! [[ ${PV} =~ alpha|beta ]]; then
-	# This list can be updated with scripts/get_langs.sh from mozilla overlay
-	LANGS=(af ak ar ast be bg bn-BD bn-IN br bs ca cs cy da de el en en-GB en-US
-	en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr fy-NL ga-IE gd gl gu-IN he
-	hi-IN hr hu hy-AM id is it ja kk kn ko ku lg lt lv mai mk ml mr nb-NO nl
-	nn-NO nso or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta ta-LK
-	te th tr uk vi zh-CN zh-TW zu)
-
-	for X in "${LANGS[@]}" ; do
-		# en and en_US are handled internally
-		if [[ ${X} != en ]] && [[ ${X} != en-US ]]; then
-			SRC_URI="${SRC_URI}
-				linguas_${X/-/_}? ( ${FTP_URI}/${FF_PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
-		fi
-		IUSE="${IUSE} linguas_${X/-/_}"
-		# Install all the specific locale xpis if there's no generic locale xpi
-		# Example: there's no pt.xpi, so install all pt-*.xpi
-		if ! has ${X%%-*} "${LANGS[@]}"; then
-			SRC_URI="${SRC_URI}
-				linguas_${X%%-*}? ( ${FTP_URI}/${FF_PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
-			IUSE="${IUSE} linguas_${X%%-*}"
-		fi
-	done
-fi
-
 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
 
-# TODO: Move all the linguas crap to an eclass
-linguas() {
-	# Generate the list of language packs called "linguas"
-	# This list is used to install the xpi language packs
-	local LINGUA
-	for LINGUA in ${LINGUAS}; do
-		if has ${LINGUA} en en_US; then
-			# For mozilla products, en and en_US are handled internally
-			continue
-		# If this language is supported by ${P},
-		elif has ${LINGUA} "${LANGS[@]//-/_}"; then
-			# Add the language to linguas, if it isn't already there
-			has ${LINGUA//_/-} "${linguas[@]}" || linguas+=(${LINGUA//_/-})
-			continue
-		# For each short LINGUA that isn't in LANGS,
-		# add *all* long LANGS to the linguas list
-		elif ! has ${LINGUA%%-*} "${LANGS[@]}"; then
-			for LANG in "${LANGS[@]}"; do
-				if [[ ${LANG} == ${LINGUA}-* ]]; then
-					has ${LANG} "${linguas[@]}" || linguas+=(${LANG})
-					continue 2
-				fi
-			done
-		fi
-		ewarn "Sorry, but ${P} does not support the ${LINGUA} locale"
-	done
-}
-
 pkg_setup() {
 	moz_pkgsetup
 
@@ -133,6 +92,7 @@ pkg_setup() {
 		SESSION_MANAGER \
 		XDG_SESSION_COOKIE \
 		XAUTHORITY
+	gnome2_environment_reset
 
 	if ! use bindist; then
 		einfo
@@ -160,11 +120,8 @@ pkg_setup() {
 src_unpack() {
 	unpack ${A}
 
-	linguas
-	for X in "${linguas[@]}"; do
-		# FIXME: Add support for unpacking xpis to portage
-		xpi_unpack "${P}-${X}.xpi"
-	done
+	# Unpack language packs
+	mozlinguas_src_unpack
 }
 
 src_prepare() {
@@ -296,10 +253,8 @@ src_install() {
 	MOZ_MAKE_FLAGS="${MAKEOPTS}" \
 	emake DESTDIR="${D}" install || die "emake install failed"
 
-	linguas
-	for X in "${linguas[@]}"; do
-		xpi_install "${WORKDIR}/${P}-${X}"
-	done
+	# Install language packs
+	mozlinguas_src_install
 
 	local size sizes icon_path icon name
 	if use bindist; then



                 reply	other threads:[~2012-01-03  7:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b1898fe2b1bdd09258a9d2d8056b28f8f3ee0a0.nirbheek@gentoo \
    --to=nirbheek@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox