summaryrefslogtreecommitdiff
blob: 52d5c857c7aa38e7d31c9142488cd3a5f54e2de3 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/playmidi/playmidi-2.5.ebuild,v 1.5 2004/05/10 07:21:30 mr_bones_ Exp $

inherit eutils

DESCRIPTION="Command Line and GUI based MIDI Player"
HOMEPAGE="http://sourceforge.net/projects/playmidi/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ~amd64 ~ppc ~sparc"
IUSE="svga X gtk"

DEPEND="sys-libs/ncurses
	svga? ( media-libs/svgalib )
	gtk? ( =dev-libs/glib-1*
		=x11-libs/gtk+-1* )
	X? ( virtual/x11 )"


S="${WORKDIR}/${P/2.5/2.4}"

src_unpack() {
	unpack ${A}
	cd ${S}
	epatch "${FILESDIR}/${P}.patch"
}

src_compile() {
	local targets="playmidi"
	local LIBGTK=

	use svga && targets="$targets splaymidi"
	use X && targets="$targets xplaymidi"
	if use gtk ; then
		targets="$targets gtkplaymidi"
		CFLAGS="${CFLAGS} $(/usr/bin/gtk-config --cflags)"
		LIBGTK="$(gtk-config --libs)"
	fi

	echo "5" | ./Configure

	emake -j1 CFLAGS="${CFLAGS}" depend clean
	emake LIBGTK="${LIBGTK}" CFLAGS="${CFLAGS}" ${targets} \
		|| die "emake failed"
}

src_install() {
	dobin playmidi || die "dobin failed"
	if use svga ; then
		dobin splaymidi || die "dobin failed (svga)"
	fi
	if use gtk ; then
		dobin gtkplaymidi || die "dobin failed (gtk)"
	fi
	if use X ; then
		dobin xplaymidi || die "dobin failed (X)"
	fi

	dodoc BUGS QuickStart README.1ST

	docinto techref
	dodoc techref/*
}