Is there way to declare locals directly in 'for' loops?
--
Sergei
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=2
inherit base eutils python
MY_P="${P}DrNo"
DESCRIPTION="X(cross)platform Music Multiplexing System. The new generation of the XMMS player."
HOMEPAGE="http://xmms2.org/wiki/Main_Page"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
LICENSE="GPL-2 LGPL-2.1"
local optionals=""
local plugins=""
if ! use server ; then
waf_params+=" --without-xmms2d"
else
# some fun static mappings:
local option_map=( # USE # sorted xmms2 option flag (same, as USE if empty)
"avahi avahi"
"ENABLED cli"
"avahi dns_sd"
"phonehome et"
"ENABLED launcher"
"mlib-update medialib-updater"
"ENABLED nycli"
" perl"
"ENABLED pixmaps"
" python"
" ruby"
"DISABLED tests"
"DISABLED vistest"
"cxx xmmsclient++"
"cxx xmmsclient++-glib"
"DISABLED xmmsclient-cf"
"DISABLED xmmsclient-ecore" # not in tree
)
local plugin_map=( # USE # sorted xmms2 plugin flag (same, as USE if empty)
" alsa"
" airplay"
" ao"
"ffmpeg apefile"
"ffmpeg avcodec"
" asf"
"ENABLED asx"
" cdda"
"DISABLED coreaudio" # MacOS only?
" curl"
"ENABLED cue"
"avahi daap"
"ENABLED diskwrite"
"ENABLED equalizer"
"aac faad"
"ENABLED file"
" flac"
"ffmpeg flv"
"ffmpeg tta"
"DISABLED gme" # not in tree
" gvfs"
"ENABLED html"
" ices"
"ENABLED icymetaint"
"ENABLED id3v2"
" jack"
"ENABLED karaoke"
"ENABLED m3u"
" mac"
" mms"
"mp3 mad"
" mp4"
" mpg123"
" modplug"
" musepack"
"DISABLED nms" # not in tree
"ENABLED normalize"
"ENABLED null"
"ENABLED nulstripper"
" ofa"
" oss"
"ENABLED pls"
"pulseaudio pulse"
"ENABLED replaygain"
"xml rss"
" samba"
"DISABLED sc68" #not in tree
" sid"
" speex"
"DISABLED sun" # {Open,Net}BSD only
"DISABLED tremor" # not in tree
" vorbis"
" vocoder"
"ffmpeg tta"
"ENABLED wave"
"DISABLED waveout" # windows only
" wavpack"
"xml xspf"
"ENABLED xml"
)
local option
for option in "${option_map[@]}"; do
optionals+=$(xmms2_flag $option)
done
local plugin
for plugin in "${plugin_map[@]}"; do
plugins+=$(xmms2_flag $plugin)
done
fi # ! server
# pass them explicitely even if empty as we try to avoid magic deps
waf_params+=" --with-optionals=${optionals:1}" # skip first ',' if yet
waf_params+=" --with-plugins=${plugins:1}"
./waf ${waf_params} configure || die "'waf configure' failed"
}
src_compile() {
./waf build || die "waf build failed"
}
src_install() {
./waf --without-ldconfig --destdir="${D}" install || die "'waf install' failed"
dodoc AUTHORS TODO README
use python && python_need_rebuild
}
pkg_postinst() {
elog "This version is built on experimental development code"
elog "If you encounter any errors report them at http://bugs.xmms2.xmms.se"
elog "and visit #xmms2 at irc://irc.freenode.net"
if use phonehome ; then
einfo ""
einfo "The phone-home client xmms2-et was activated"
einfo "This client sends anonymous usage-statistics to the xmms2"
einfo "developers which may help finding bugs"
einfo "Disable the phonehome useflag if you don't like that"
fi
use python && python_mod_optimize "$(python_get_sitedir)/xmmsclient"
}
pkg_postrm() {
use python && python_mod_cleanup "$(python_get_sitedir)/xmmsclient"
}
06-29-2010, 08:01 PM
Mike Frysinger
RFC: media-sound/xmms2/xmms2-0.7.ebuild (v3)
On Tuesday, June 29, 2010 15:44:56 Sergei Trofimovich wrote:
> Is there way to declare locals directly in 'for' loops?