summaryrefslogtreecommitdiff
blob: 2ee6193d49b16e9b587c5d88e2b8063a0c820196 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/gnusound/gnusound-0.7.4.ebuild,v 1.8 2008/06/20 23:45:25 aballier Exp $

WANT_ATUOMAKE=1.8
WANT_AUTOCONF=2.5

inherit toolchain-funcs eutils autotools

IUSE="3dnow alsa audiofile cpudetection flac ffmpeg jack lame libsamplerate mmx
ogg oss sse vorbis"

PATCHLEVEL="2"
M4TARBALL_REV="1"
DESCRIPTION="GNUsound is a sound editor for Linux/x86"
HOMEPAGE="http://gnusound.sourceforge.net/"
SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2
	mirror://gentoo/${P}-patches-${PATCHLEVEL}.tar.bz2
	mirror://gentoo/${P}-m4-${M4TARBALL_REV}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 -sparc ~x86"

DEPEND=">=gnome-base/libglade-2.0.1
	>=gnome-base/libgnomeui-2.2.0.1
	audiofile? ( >=media-libs/audiofile-0.2.3 )
	flac? ( media-libs/flac )
	ffmpeg? ( media-video/ffmpeg )
	ogg? ( media-libs/libogg )
	lame? ( media-sound/lame )
	media-libs/libsndfile
	vorbis? ( media-libs/libvorbis )
	libsamplerate? ( media-libs/libsamplerate )"

pkg_setup() {
	required_audio_drivers="alsa jack oss"
	ok=false
	for i in $required_audio_drivers; do
		use $i && ok=true
	done
	if test "$ok" = "false"; then
		die "In order to run ${PN}, you must enable at least one of those use flags: ${required_audio_drivers}"
	fi
}
src_unpack() {
	unpack ${A} || die "unpack failure"
	cd "${S}" || die "workdir not found"

	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
	cp "${WORKDIR}"/m4/* config/
	AT_M4DIR="config" eautoreconf
}

src_compile() {
	myconf="--disable-fastmemcpy"
	use mmx && use sse && use 3dnow && myconf="--enable-fastmemcpy"
	# Doesnt detect gnome2 if sndfile is off
	econf \
		$(use_enable audiofile) \
		$(use_enable lame) \
		--enable-sndfile \
		$(use_enable ogg) \
		$(use_enable vorbis) \
		$(use_enable ffmpeg) \
		--disable-gmerlin \
		$(use_enable flac) \
		$(use_enable oss) \
		$(use_enable alsa) \
		$(use_enable jack) \
		$(use_with libsamplerate) \
		$(use_enable cpudetection) \
		$(use_enable mmx fastminmax) \
		${myconf} \
		--with-gnome2 \
		|| die "Configure failure"
	emake CC="$(tc-getCC)" || die "Make failure"
}

src_install() {
	emake DESTDIR="${D}" install || die "make install failed"
	dodoc README NOTES TODO CHANGES
}