summaryrefslogtreecommitdiff
blob: f6cf58879406d3d67acdb7e93586de6f1d38ded1 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/playmidi/playmidi-2.5-r1.ebuild,v 1.3 2006/01/27 22:11:28 ticho Exp $

IUSE="svga X gtk"

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="amd64 ~ppc sparc x86"

RDEPEND="sys-libs/ncurses
	svga? ( media-libs/svgalib )
	gtk? ( =dev-libs/glib-1*
		=x11-libs/gtk+-1* )
	X? ( || ( ( x11-libs/libX11
				x11-libs/libSM
				x11-libs/libXaw )
			virtual/x11 ) )"
DEPEND="${RDEPEND}
	X? ( || ( x11-proto/xextproto virtual/x11 ) )"

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

src_unpack() {
	unpack ${A}
	cd ${S}
	epatch "${FILESDIR}/${P}.patch"
	epatch "${FILESDIR}/CAN-2005-0020.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/*
}