sys-process/glances: revbump 3.1.4.1, add missing doc dep
[gentoo.git] / games-fps / quakeforge / quakeforge-0.7.2-r1.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit eutils flag-o-matic autotools
6
7 DESCRIPTION="New 3d engine based off of id Softwares's Quake and QuakeWorld game engine"
8 HOMEPAGE="http://www.quakeforge.net/"
9 SRC_URI="mirror://sourceforge/quake/${P}.tar.bz2"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="alsa cdinstall debug dga fbcon flac ipv6 ncurses oss png sdl vorbis wildmidi X xdg xv zlib"
15 RESTRICT="userpriv"
16
17 RDEPEND="
18         media-libs/libsamplerate
19         net-misc/curl
20         virtual/opengl
21         alsa? ( media-libs/alsa-lib )
22         dga? ( x11-libs/libXxf86dga )
23         flac? ( media-libs/flac )
24         ncurses? ( sys-libs/ncurses:0 )
25         png? ( media-libs/libpng:0 )
26         sdl? ( media-libs/libsdl[video] )
27         vorbis? (
28                 media-libs/libogg
29                 media-libs/libvorbis
30         )
31         wildmidi? ( media-sound/wildmidi )
32         X? (
33                 x11-libs/libX11
34                 x11-libs/libXext
35                 x11-libs/libXxf86vm
36         )
37         xv? (
38                 x11-libs/libX11
39                 x11-libs/libXext
40                 x11-libs/libXxf86vm
41         )
42         zlib? ( sys-libs/zlib )"
43 DEPEND="${RDEPEND}
44         cdinstall? ( games-fps/quake1-data )
45         >=sys-devel/bison-2.6
46         sys-devel/flex
47         virtual/pkgconfig"
48
49 PATCHES=(
50         "${FILESDIR}"/${P}-gentoo.patch
51 )
52
53 src_prepare() {
54         default
55         eautoreconf
56         append-cflags -std=gnu89 # build with gcc5 (bug #570392)
57 }
58
59 src_configure() {
60         local debugopts
61         use debug \
62                 && debugopts="--enable-debug --disable-optimize --enable-profile" \
63                 || debugopts="--disable-debug --disable-profile"
64
65         local clients=${QF_CLIENTS}
66         use fbcon && clients="${clients},fbdev"
67         use sdl && clients="${clients},sdl"
68         use X && clients="${clients},x11"
69         [ "${clients:0:1}" == "," ] && clients=${clients:1}
70
71         local servers=${QF_SERVERS:-master,nq,qw,qtv}
72
73         local tools=${QF_TOOLS:-all}
74
75         econf \
76                 --enable-dependency-tracking \
77                 $(use_enable ncurses curses) \
78                 $(use_enable vorbis) \
79                 $(use_enable png) \
80                 $(use_enable zlib) \
81                 $(use_with ipv6) \
82                 $(use_with fbcon fbdev) \
83                 $(use_with X x) \
84                 $(use_enable xv vidmode) \
85                 $(use_enable dga) \
86                 $(use_enable sdl) \
87                 --disable-xmms \
88                 $(use_enable alsa) \
89                 $(use_enable flac) \
90                 $(use_enable oss) \
91                 $(use_enable xdg) \
92                 $(use_enable wildmidi) \
93                 --enable-sound \
94                 --disable-optimize \
95                 --disable-Werror \
96                 --without-svga \
97                 ${debugopts} \
98                 --with-global-cfg=/etc/quakeforge.conf \
99                 --with-sharepath=/usr/share/quake1 \
100                 --with-clients=${clients} \
101                 --with-servers=${servers} \
102                 --with-tools=${tools}
103 }
104
105 src_install() {
106         emake -j1 DESTDIR="${D}" install
107         dodoc ChangeLog NEWS TODO
108 }
109
110 pkg_postinst() {
111         # same warning used in quake1 / quakeforge / nprquake-sdl
112         echo
113         elog "Before you can play, you must make sure"
114         elog "${PN} can find your Quake .pak files"
115         elog
116         elog "You have 2 choices to do this"
117         elog "1 Copy pak*.pak files to /usr/share/quake1/id1"
118         elog "2 Symlink pak*.pak files in /usr/share/quake1/id1"
119         elog
120         elog "Example:"
121         elog "my pak*.pak files are in /mnt/secondary/Games/Quake/Id1/"
122         elog "ln -s /mnt/secondary/Games/Quake/Id1/pak0.pak /usr/share/quake1/id1/pak0.pak"
123         elog
124         elog "You only need pak0.pak to play the demo version,"
125         elog "the others are needed for registered version"
126 }