summaryrefslogtreecommitdiff
blob: 82b386e7aadeb98f3f8d25a1598171cd3502662d (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
84
85
86
87
88
89
90
# Copyright 1999-2007 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.3 2007/01/30 20:23:02 aballier Exp $

inherit toolchain-funcs

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

WANT_ATUOMAKE=1.8
WANT_AUTOCONF=2.5

inherit eutils autotools

DESCRIPTION="GNUsound is a sound editor for Linux/x86"
HOMEPAGE="http://gnusound.sourceforge.net/"
SRC_URI="mirror://gnu/${PN}/${P}.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"
	rm -f doc/Makefile || die "could not remove doc Makefile"
	rm -f modules/Makefile || die "could not remove modules Makefile"
	sed -i "s:docrootdir:datadir:" doc/Makefile.in

	epatch "${FILESDIR}/${P}-destdir.patch"
	epatch "${FILESDIR}/${P}-amd64.patch"
	epatch "${FILESDIR}/${P}-ffmpeg-struct.patch"
	epatch "${FILESDIR}/${P}-automagic.patch"
	epatch "${FILESDIR}/${P}-flac-1.1.3.patch"
	epatch "${FILESDIR}/${P}-ffmpeg.patch"

	AT_M4DIR="config" eaclocal
	eautoconf
}

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() {
	make DESTDIR="${D}" install || die "make install failed"
	dodoc README NOTES TODO CHANGES
}