From 256a5e60a87bc019bdb665049d0b5c7c21dcbf94 Mon Sep 17 00:00:00 2001 From: Martin Väth Date: Thu, 3 Dec 2015 22:07:22 +0100 Subject: Use BROWSER with USE_EXPAND --- eclass/ChangeLog | 10 ++++++- eclass/mv_mozextension-r1.eclass | 61 +++++++++++++++++++++++++++------------- 2 files changed, 51 insertions(+), 20 deletions(-) (limited to 'eclass') 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 : + mv_mozextension-r1.eclass: Use BROWSER with USE_EXPAND. + Allow to specify source/binary only + + 28 Nov 2015; Martin Väth : + Replace mv_mozextension.eclass by mv_mozextension-r1.eclass without + default phase functions for EAPI=6 compatibility + 25 Jan 2015; Martin Väth : - 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 : 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: [] [] [...] # @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: [] [] [...] # @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: [] [] [...] # @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 -- cgit v1.2.3-65-gdbad