summaryrefslogtreecommitdiff
blob: 0ad7abd73123bf4306dec8f833837c5dac63b615 (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
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit autotools desktop toolchain-funcs

DESCRIPTION="Re-Write of the game Drug Wars"
HOMEPAGE="http://dopewars.sourceforge.net/"
SRC_URI="https://github.com/benmwebb/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="nls ncurses gtk gnome sdl"

RDEPEND="
	ncurses? ( >=sys-libs/ncurses-5.2:0= )
	gtk? ( x11-libs/gtk+:2 )
	dev-libs/glib:2
	nls? ( virtual/libintl )
	sdl? (
		media-libs/libsdl
		media-libs/sdl-mixer
	)
"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	nls? ( sys-devel/gettext )
"

DOCS=( AUTHORS NEWS README.md TODO doc/example-cfg doc/example-igneous )

src_prepare() {
	default
	eautoreconf
	sed -i -e 's:index.html:html/index.html:' \
		src/dopewars.c || die
	sed -i -e "s/\-lncurses/$($(tc-getPKG_CONFIG) --libs ncurses)/g" \
		configure || die
}

src_configure() {
	local myservconf

	if ! use gtk ; then
		myservconf="--disable-gui-client --disable-gui-server --disable-glibtest --disable-gtktest"
	fi

	econf \
		$(use_enable ncurses curses-client) \
		$(use_enable nls) \
		$(use_with sdl) \
		--without-esd \
		--enable-networking \
		--enable-plugins \
		${myservconf}
}

src_install() {
	emake DESTDIR="${D}" install
	rm -r "${ED}"/usr/share/gnome || die
	rm -r "${ED}"/usr/share/doc || die
	make_desktop_entry "${PN}" "Dopewars" /usr/share/pixmaps/dopewars-weed.png
	HTML_DOCS="doc/*html doc/help/"
	einstalldocs
}