summaryrefslogtreecommitdiff
blob: f397848a0143c7dcef10a26173373ddbd364d18a (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
91
92
93
94
95
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-board/gnubg/gnubg-0.13.0-r1.ebuild,v 1.2 2003/09/30 07:23:12 mr_bones_ Exp $

inherit games

WPV=0.13
DESCRIPTION="GNU BackGammon"
HOMEPAGE="http://www.gnu.org/software/gnubg/gnubg.html"
SRC_URI="ftp://alpha.gnu.org/gnu/gnubg/${P}.tar.gz
	ftp://alpha.gnu.org/gnu/gnubg/${PN}.weights-${WPV}.gz
	ftp://alpha.gnu.org/gnu/gnubg/${PN}.bd.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="gtk gtk2 readline guile X gdbm truetype nls png esd arts nas"

# FIXME does this need to DEPEND on netpbm?
RDEPEND="guile? ( dev-util/guile )
	truetype? ( =media-libs/freetype-1* )
	|| (
		gtk2? ( =x11-libs/gtk+-2* =dev-libs/glib-2* )
		gtk? ( =x11-libs/gtk+-1.2* =dev-libs/glib-1* )
	)
	readline? ( sys-libs/readline )
	X? ( virtual/x11 )
	gdbm? ( sys-libs/gdbm )
	esd? ( media-sound/esound )
	arts? ( kde-base/arts )
	nas? ( media-libs/nas )
	png? ( media-libs/libpng )"
DEPEND="${RDEPEND}
	nas? ( >=sys-apps/sed-4 )"

src_unpack() {
	unpack ${A}
	cd ${S}
	mv ../${PN}.weights-${WPV} ${S}/${PN}.weights
	mv ../${PN}.bd ${S}
	if  [ `use nas` ] ; then
		# couldn't find -laudio without this.  Very odd.
		sed -i \
			-e "s:-laudio:-L/usr/X11R6/lib/ -laudio:" configure.in || \
				die "sed configure.in failed"
	fi
}

src_compile() {
	local myconf=""
	if [ -n "`use gtk`" -o -n "`use gtk2`" ] ; then
		# doesn't make any sense to add this without gtk or gtk2
		if [ -n "`best_version x11-libs/gtk+extra`" ] ; then
			myconf="--with-gtkextra"
		else
			myconf="--without-gtkextra"
		fi
		# --with-gtk doesn't mean what you think it means for configuring gnubg.
		if [ `use gtk2` ] ; then
			myconf="${myconf} --with-gtk --with-gtk2"
		else
			myconf="${myconf} --with-gtk --without-gtk2"
		fi
	else
		myconf="${myconf} --disable-gtktest"
	fi
	if [ -n "`use esd`" -o -n "`use arts`" -o -n "`use nas`" ] ; then
		myconf="${myconf} --with-sound"
	else
		myconf="${myconf} --without-sound --disable-esdtest --disable-artsc-test"
	fi

	# configure script doesn't handle this option correctly.
	#	`use_with guile` \
	egamesconf \
		`use_enable esd` \
		`use_enable arts artsc` \
		`use_enable nas` \
		`use_with readline` \
		`use_with X x` \
		`use_with gdbm` \
		`use_with truetype freetype` \
		`use_enable nls` \
		${myconf} \
		|| die
	emake || die "emake failed"
}

src_install() {
	make DESTDIR=${D} install || die "make install failed"
	insinto ${GAMES_DATADIR}/${PN}
	doins ${PN}.weights
	dodoc AUTHORS README NEWS
	prepgamesdirs
}