summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2015-12-03 22:07:22 +0100
committerMartin Väth <martin@mvath.de>2015-12-04 23:36:13 +0100
commit256a5e60a87bc019bdb665049d0b5c7c21dcbf94 (patch)
tree1c00d0cf438b74c96cdbd9b2bdbbdea441fbdda5 /eclass
parentapp-shells/zshrc-mv: Version bump (diff)
downloadmv-256a5e60a87bc019bdb665049d0b5c7c21dcbf94.tar.gz
mv-256a5e60a87bc019bdb665049d0b5c7c21dcbf94.tar.bz2
mv-256a5e60a87bc019bdb665049d0b5c7c21dcbf94.zip
Use BROWSER with USE_EXPAND
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog10
-rw-r--r--eclass/mv_mozextension-r1.eclass61
2 files changed, 51 insertions, 20 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 09e28aa9..8437dd08 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -2,8 +2,16 @@
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
# $Id$
+ 04 Dec 2015; Martin Väth <martin@mvath.de>:
+ mv_mozextension-r1.eclass: Use BROWSER with USE_EXPAND.
+ Allow to specify source/binary only
+
+ 28 Nov 2015; Martin Väth <martin@mvath.de>:
+ Replace mv_mozextension.eclass by mv_mozextension-r1.eclass without
+ default phase functions for EAPI=6 compatibility
+
25 Jan 2015; Martin Väth <martin@mvath.de>:
- avoid use_if_iuse in mv_mozextenstion.eclass to be fully pms compatible
+ avoid use_if_iuse in mv_mozextension.eclass to be fully pms compatible
24 Jan 2015; Martin Väth <martin@mvath.de>:
Remove auteps from mv_mozextension.eclass
diff --git a/eclass/mv_mozextension-r1.eclass b/eclass/mv_mozextension-r1.eclass
index ae462400..7e58de6d 100644
--- a/eclass/mv_mozextension-r1.eclass
+++ b/eclass/mv_mozextension-r1.eclass
@@ -83,46 +83,69 @@ MOZ_DEPEND='app-arch/unzip'
# @USAGE: [<browser>] [<browser>] [...]
# @DESCRIPTION:
# Outputs RDEPEND expression appropriate for browsers.
-# browser is firefox or seamonkey and implies source or binary version.
-# If no browser is specified, all are assumed.
+# browser is [firefox|seamonkey][-source|-bin] (no specified means both/all)
moz_rdepend() {
local rdep i
[ ${#} -ne 0 ] || set -- "firefox seamonkey"
+ i=
rdep=
case "${*}" in
+ *firefox?source*)
+ i=a
+ rdep="browser_firefox? ( www-client/firefox )";;
+ *firefox?bin*)
+ i=a
+ rdep="browser_firefox-bin? ( www-client/firefox-bin )";;
*firefox*)
- rdep="firefox? ( www-client/firefox )
-firefox-bin? ( www-client/firefox-bin )";;
+ i=aa
+ rdep="browser_firefox? ( www-client/firefox )
+browser_firefox-bin? ( www-client/firefox-bin )";;
esac
case "${*}" in
+ *seamonkey?source*)
+ i=${i}a
+ rdep=${rdep}${rdep:+'
+'}"browser_seamonkey? ( www-client/seamonkey )";;
+ *seamonkey?bin*)
+ i=${i}a
+ rdep=${rdep}${rdep:+'
+'}"browser_seamonkey-bin? ( www-client/seamonkey-bin )";;
*seamonkey*)
+ i=${i}aa
rdep=${rdep}${rdep:+'
-'}"seamonkey? ( www-client/seamonkey )
-seamonkey-bin? ( www-client/seamonkey-bin )";;
+'}"browser_seamonkey? ( www-client/seamonkey )
+browser_seamonkey-bin? ( www-client/seamonkey-bin )";;
esac
- [ -n "${rdep}" ] || die "moz_rdepend must be called with \"firefox\" or \"seamonkey\""
- echo "|| ( ${rdep} )"
+ [ -n "${i}" ] || die "args must be [firefox|seamonkey][-source|-bin]"
+ [ "${i}" = a ] && echo "${rdep}" || echo "|| ( ${rdep} )"
}
# @FUNCTION: moz_iuse
# @USAGE: [<browser>] [<browser>] [...]
# @DESCRIPTION:
# Outputs IUSE expression appropriate for browsers.
-# browser is firefox or seamonkey and implies source or binary version.
-# If no browser is specified, all are assumed.
+# browser is [firefox|seamonkey][-source|-bin] (no specified means both/all)
moz_iuse() {
local iuse i
[ ${#} -ne 0 ] || set -- "firefox seamonkey"
iuse=
case "${*}" in
+ *firefox?source*)
+ iuse="browser_firefox";;
+ *firefox?bin*)
+ iuse="browser_firefox-bin";;
*firefox*)
- iuse="firefox firefox-bin";;
+ iuse="browser_firefox browser_firefox-bin";;
esac
case "${*}" in
+ *seamonkey?source*)
+ iuse="${iuse}${iuse:+ }browser_seamonkey";;
+ *seamonkey?bin*)
+ iuse="${iuse}${iuse:+ }browser_seamonkey-bin";;
*seamonkey*)
- iuse="${iuse}${iuse:+ }seamonkey seamonkey-bin";;
+ iuse="${iuse}${iuse:+ }browser_seamonkey browser_seamonkey-bin";;
esac
- [ -n "${iuse}" ] || die "moz_iuse must be called with \"firefox\" or \"seamonkey\""
+ [ -n "${iuse}" ] || die "args must be [firefox|seamonkey][-source|-bin]"
echo "${iuse}"
}
@@ -130,10 +153,10 @@ moz_iuse() {
# @USAGE: [<browser>] [<browser>] [...]
# @DESCRIPTION:
# Outputs REQUIRED_USE expression appropriate for browsers.
-# browser is firefox or seamonkey and implies source or binary version.
-# If no browser is specified, all are assumed.
+# browser is [firefox|seamonkey][-source|-bin] (no specified means both/all)
moz_required_use() {
- echo "|| ( $(moz_iuse "$@") )"
+ set -- $(moz_iuse "${@}")
+ [ ${#} -lt 2 ] && echo "${*}" || echo "|| ( ${*} )"
}
# @FUNCTION: moz_unpack
@@ -218,11 +241,11 @@ moz_install_for_browser() {
case ${1} in
firefox)
dest="/usr/$(get_libdir)/${firefox}";;
- firefox-bin)
+ firefox?bin)
dest="/opt/${firefox}";;
seamonkey)
dest="/usr/$(get_libdir)/${seamonkey}";;
- seamonkey-bin)
+ seamonkey?bin)
dest="/opt/${seamonkey}";;
*)
die "unknown browser specified";;
@@ -241,7 +264,7 @@ moz_install_for_browser() {
moz_install() {
local i
for i in firefox firefox-bin seamonkey seamonkey-bin
- do if in_iuse "${i}" && use "${i}"
+ do if in_iuse "browser_${i}" && use "browser_${i}"
then moz_install_for_browser "${i}" "${@}"
fi
done