| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/media-sound/xwax/xwax-1.2.ebuild,v 1.5 2012/08/23 19:10:03 xmw Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
inherit toolchain-funcs
|
| 7 |
|
| 8 |
DESCRIPTION="Digital vinyl emulation software"
|
| 9 |
HOMEPAGE="http://www.xwax.co.uk/"
|
| 10 |
SRC_URI="http://www.xwax.co.uk/releases/${P}.tar.gz"
|
| 11 |
|
| 12 |
LICENSE="GPL-2"
|
| 13 |
SLOT="0"
|
| 14 |
KEYWORDS="amd64 ppc ppc64 x86"
|
| 15 |
IUSE="alsa jack oss cdda mp3 +fallback"
|
| 16 |
REQUIRED_USE="|| ( cdda mp3 fallback )
|
| 17 |
|| ( alsa jack oss )"
|
| 18 |
|
| 19 |
RDEPEND="sys-libs/glibc
|
| 20 |
media-libs/libsdl
|
| 21 |
media-libs/sdl-ttf
|
| 22 |
media-fonts/dejavu
|
| 23 |
alsa? ( media-libs/alsa-lib )
|
| 24 |
jack? ( media-sound/jack-audio-connection-kit )
|
| 25 |
cdda? ( media-sound/cdparanoia )
|
| 26 |
mp3? ( || ( media-sound/mpg123 media-sound/mpg321 ) )
|
| 27 |
fallback? ( virtual/ffmpeg )"
|
| 28 |
DEPEND="${RDEPEND}"
|
| 29 |
|
| 30 |
DOCS="README CHANGES"
|
| 31 |
|
| 32 |
src_prepare() {
|
| 33 |
# Remove the forced optimization from 'CFLAGS' and 'LDFLAGS' in
|
| 34 |
# the Makefile
|
| 35 |
# Also remove the dependency on the .version target so we don't need
|
| 36 |
# git just to build
|
| 37 |
sed -i -e 's/\(^\(LD\|C\)FLAGS.*\)-O[0-9]\(.*\)/\1\3/g' \
|
| 38 |
-e 's/^xwax\.o:.*\.version//' \
|
| 39 |
Makefile || die "sed failed"
|
| 40 |
|
| 41 |
# Replace any decoder commands in the import script, if necessary
|
| 42 |
if [[ `use mp3` ]]; then
|
| 43 |
# mpg123 is upstream's default
|
| 44 |
if has_version media-sound/mpg123; then
|
| 45 |
TO="mpg123"
|
| 46 |
FROM="mpg321"
|
| 47 |
# Otherwise, use mpg321
|
| 48 |
else
|
| 49 |
TO="mpg321"
|
| 50 |
FROM="mpg123"
|
| 51 |
fi
|
| 52 |
debug-print "found ${TO}"
|
| 53 |
sed -i -e "s:${FROM}:${TO}:g" import || \
|
| 54 |
die "problem converting xwax-import to use ${TO}"
|
| 55 |
fi
|
| 56 |
}
|
| 57 |
|
| 58 |
src_configure() {
|
| 59 |
tc-export CC
|
| 60 |
econf \
|
| 61 |
--prefix "${EROOT}usr" \
|
| 62 |
$(use_enable alsa) \
|
| 63 |
$(use_enable jack) \
|
| 64 |
$(use_enable oss)
|
| 65 |
}
|
| 66 |
|
| 67 |
src_compile() {
|
| 68 |
# EXECDIR is the default directory in which xwax will look for
|
| 69 |
# the 'xwax-import' and 'xwax-scan' scripts
|
| 70 |
emake EXECDIR="\$(BINDIR)" VERSION="${PV}"
|
| 71 |
}
|
| 72 |
|
| 73 |
src_install() {
|
| 74 |
# This is easier than setting all the environment variables
|
| 75 |
# needed, running the sed script required to get the man directory
|
| 76 |
# correct, and removing the GPL-2 after a 'make install' run
|
| 77 |
dobin xwax || die "failed to install xwax"
|
| 78 |
newbin import xwax-import || die "failed to install xwax-import"
|
| 79 |
newbin scan xwax-scan || die "failed to install xwax-scan"
|
| 80 |
doman xwax.1 || die "failed to install man page"
|
| 81 |
|
| 82 |
dodoc ${DOCS} || die "failed to install docs"
|
| 83 |
}
|