diff options
author | Jeremy Huddleston <eradicator@gentoo.org> | 2004-10-21 04:38:25 +0000 |
---|---|---|
committer | Jeremy Huddleston <eradicator@gentoo.org> | 2004-10-21 04:38:25 +0000 |
commit | 288b5709b32269e9e00fff40ad0adaca3077193a (patch) | |
tree | 3e8251833ea5c288440dd194450201eea301e0c3 /eclass | |
parent | Marked stable x86 (Manifest recommit) (diff) | |
download | gentoo-2-288b5709b32269e9e00fff40ad0adaca3077193a.tar.gz gentoo-2-288b5709b32269e9e00fff40ad0adaca3077193a.tar.bz2 gentoo-2-288b5709b32269e9e00fff40ad0adaca3077193a.zip |
Cleaned up src_unpack and variable setup.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/xmms-plugin.eclass | 172 |
1 files changed, 95 insertions, 77 deletions
diff --git a/eclass/xmms-plugin.eclass b/eclass/xmms-plugin.eclass index f3b060d98319..4acad261cbc3 100644 --- a/eclass/xmms-plugin.eclass +++ b/eclass/xmms-plugin.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/xmms-plugin.eclass,v 1.6 2004/10/20 02:39:44 eradicator Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/xmms-plugin.eclass,v 1.7 2004/10/21 04:38:25 eradicator Exp $ # # Jeremy Huddleston <eradicator@gentoo.org> # @@ -65,95 +65,119 @@ inherit eutils libtool gnuconfig ECLASS=xmms-plugin INHERITED="${INHERITED} ${ECLASS}" -IUSE="${IUSE} xmms bmp" - -DEPEND="bmp? ( >=media-sound/beep-media-player-0.9.7_rc2-r2 ) - xmms? ( media-sound/xmms )" -RDEPEND="bmp? ( >=media-sound/beep-media-player-0.9.7_rc2-r2 ) - xmms? ( media-sound/xmms )" +if [ "${NOXMMS}" != "1" ]; then + IUSE="${IUSE} xmms" + DEPEND="${DEPEND} + xmms? ( media-sound/xmms )" + + RDEPEND="${RDEPEND} + xmms? ( media-sound/xmms )" + + if [ -n "${BMP2XMMS_PATCH}" ]; then + SRC_URI="${SRC_URI} + xmms? ( ${XMMS_SRC_URI} + ${BMP_SRC_URI} )" + elif [ -n "${XMMS_SRC_URI}" ]; then + SRC_URI="${SRC_URI} + xmms? ( ${XMMS_SRC_URI} )" + fi -XMMS_WORKDIR="${WORKDIR}/xmms" -BMP_WORKDIR="${WORKDIR}/bmp" + XMMS_WORKDIR="${WORKDIR}/xmms" + if [ -z "${XMMS_S}" ]; then + XMMS_S="${XMMS_WORKDIR}/${P}" + fi +fi -# We don't use ${S} -S="${WORKDIR}" +if [ "${NOBMP}" != "1" ]; then + IUSE="${IUSE} bmp" + DEPEND="${DEPEND} + bmp? ( >=media-sound/beep-media-player-0.9.7_rc2-r2 + dev-util/pkgconfig )" + + RDEPEND="${RDEPEND} + bmp? ( >=media-sound/beep-media-player-0.9.7_rc2-r2 )" + + if [ -n "${XMMS2BMP_PATCH}" ]; then + SRC_URI="${SRC_URI} + bmp? ( ${XMMS_SRC_URI} + ${BMP_SRC_URI} )" + elif [ -n "${BMP_SRC_URI}" ]; then + SRC_URI="${SRC_URI} + bmp? ( ${BMP_SRC_URI} )" + fi -if [ -z "${XMMS_S}" ]; then - XMMS_S="${XMMS_WORKDIR}/${P}" + BMP_WORKDIR="${WORKDIR}/bmp" + if [ -z "${BMP_S}" ]; then + BMP_S="${BMP_WORKDIR}/${P}" + fi fi -if [ -z "${BMP_S}" ]; then - BMP_S="${BMP_WORKDIR}/${P}" -fi +SRC_URI="${BASE_SRC_URI} ${SRC_URI}" -if [ -n "${BMP_SRC_URI}" -a -n "${XMMS_SRC_URI}" ]; then - SRC_URI="${BASE_SRC_URI} - bmp? ( ${BMP_SRC_URI} ) - xmms? ( ${XMMS_SRC_URI} )" -fi +# Set S to something which exists +S="${WORKDIR}" xmms-plugin_src_unpack() { - do_xmms && mkdir ${XMMS_WORKDIR} - do_bmp && mkdir ${BMP_WORKDIR} - - if [ -n "${BMP_SRC_URI}" -a -n "${XMMS_SRC_URI}" ]; then - if do_xmms; then - cd ${XMMS_WORKDIR} - for f in ${XMMS_SRC_URI} ${BASE_SRC_URI}; do + if do_xmms; then + mkdir ${XMMS_WORKDIR} + cd ${XMMS_WORKDIR} + + XMMS_A="" + if [ -z "${BASE_SRC_URI}${XMMS_SRC_URI}${BMP_SRC_URI}" ]; then + XMMS_A=${A} + elif [ -n "${BMP2XMMS_PATCH}" ]; then + for f in ${XMMS_SRC_URI} ${BMP_SRC_URI} ${BASE_SRC_URI}; do XMMS_A="${XMMS_A} `basename ${f}`" done - unpack ${XMMS_A} - fi - - if do_bmp; then - cd ${BMP_WORKDIR} - for f in ${BMP_SRC_URI} ${BASE_SRC_URI}; do - BMP_A="${BMP_A} `basename ${f}`" + else + for f in ${XMMS_SRC_URI} ${BASE_SRC_URI}; do + XMMS_A="${XMMS_A} `basename ${f}`" done - unpack ${BMP_A} - fi - else - if do_xmms; then - cd ${XMMS_WORKDIR} - unpack ${A} fi + + unpack ${XMMS_A} - if do_bmp; then - cd ${BMP_WORKDIR} - unpack ${A} - - if [ -n "${XMMS2BMP_PATCH}" ]; then - cd ${BMP_S} - epatch ${XMMS2BMP_PATCH} - else - cd ${BMP_S} - xmms2bmp_automate - fi - fi - fi - - if [ -n "${PATCHES}" ]; then - if do_xmms; then - cd ${XMMS_S} + cd ${XMMS_S} + if [ -n "${PATCHES}" ]; then epatch ${PATCHES} fi - - if do_bmp; then - cd ${BMP_S} - epatch ${PATCHES} + if [ -n "${BMP2XMMS_PATCH}" ]; then + epatch ${BMP2XMMS_PATCH} fi - fi - if do_xmms; then - cd ${XMMS_S} - S="${XMMS_S}" elibtoolize gnuconfig_update fi if do_bmp; then + mkdir ${BMP_WORKDIR} + cd ${BMP_WORKDIR} + + BMP_A="" + if [ -z "${BASE_SRC_URI}${XMMS_SRC_URI}${BMP_SRC_URI}" ]; then + BMP_A=${A} + elif [ -n "${XMMS2BMP_PATCH}" ]; then + for f in ${XMMS_SRC_URI} ${BMP_SRC_URI} ${BASE_SRC_URI}; do + BMP_A="${BMP_A} `basename ${f}`" + done + else + for f in ${BMP_SRC_URI} ${BASE_SRC_URI}; do + BMP_A="${BMP_A} `basename ${f}`" + done + fi + + unpack ${BMP_A} + cd ${BMP_S} - S="${BMP_S}" + if [ -n "${PATCHES}" ]; then + epatch ${PATCHES} + fi + if [ -n "${XMMS2BMP_PATCH}" ]; then + epatch ${XMMS2BMP_PATCH} + elif [ -z "${BMP_SRC_URI}" ]; then + xmms2bmp_automate + fi + elibtoolize gnuconfig_update fi @@ -171,7 +195,7 @@ xmms-plugin_src_compile() { if do_bmp; then cd ${BMP_S} export FAKE_XMMS_VERSION=1.2.10 - econf ${myconf} ${bmp_myconf}|| die + econf ${myconf} ${bmp_myconf} || die emake || die fi } @@ -229,21 +253,15 @@ xmms-plugin_src_install() { fi } -xmms-plugin_pkg_postinst() { - if use bmp && [ "${NOBMP}" = "1" ]; then - ewarn "You have bmp in your USE flags, but this xmms plugin" - ewarn "does not support bmp, sorry." - fi -} - xmms2bmp_automate() { find . -name Makefile -o -name Makefile.in -o -name configure | xargs sed -i -e 's:xmms-config:beep-config:g' \ - -e 's:libdir)/xmms:libdir)/bmp:g' + -e 's:libdir)/xmms:libdir)/bmp:g' \ + -e 's:-lxmms:-lbeep:g' } do_xmms() { - use xmms + use xmms && [ "${NOXMMS}" != "1" ] } do_bmp() { |