games-strategy/liquidwar6: amd64 stable wrt bug #568584
[gentoo.git] / games-strategy / liquidwar6 / liquidwar6-0.4.3681.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit autotools eutils toolchain-funcs games
8
9 MY_PV=${PV/_beta/beta}
10 MY_P=${PN}-${MY_PV}
11
12 DESCRIPTION="Unique multiplayer wargame between liquids"
13 HOMEPAGE="https://www.gnu.org/software/liquidwar6/"
14 SRC_URI="http://www.ufoot.org/download/liquidwar/v6/${MY_PV}/${MY_P}.tar.gz
15         maps? ( http://www.ufoot.org/download/liquidwar/v6/${MY_PV}/${PN}-extra-maps-${MY_PV}.tar.gz )"
16
17 LICENSE="GPL-3+"
18 SLOT="0"
19 KEYWORDS="amd64 x86"
20 IUSE="doc gles2 gtk libcaca +maps nls +ogg openmp readline test"
21
22 # yes, cunit is rdep
23 # Drop the libtool dep once libltdl goes stable.
24 RDEPEND="dev-db/sqlite:3
25         dev-libs/expat
26         dev-scheme/guile
27         dev-util/cunit
28         media-libs/freetype:2
29         media-libs/libpng:0
30         media-libs/libsdl[X,opengl,video]
31         media-libs/sdl-image[jpeg,png]
32         media-libs/sdl-ttf
33         net-misc/curl
34         || ( dev-libs/libltdl:0 <sys-devel/libtool-2.4.3-r2:2 )
35         sys-libs/zlib
36         virtual/glu
37         virtual/jpeg
38         virtual/opengl
39         libcaca? ( media-libs/libcaca )
40         gles2? ( media-libs/mesa[gles2] )
41         gtk? ( x11-libs/gtk+:2 )
42         nls? ( virtual/libintl
43                 virtual/libiconv )
44         ogg? (
45                 media-libs/libsdl[X,sound,opengl,video]
46                 media-libs/sdl-mixer[vorbis]
47         )
48         readline? ( sys-libs/ncurses
49                 sys-libs/readline )"
50 DEPEND="${RDEPEND}
51         dev-lang/perl
52         nls? ( sys-devel/gettext )"
53
54 S=${WORKDIR}/${MY_P}
55 S_MAPS=${WORKDIR}/${PN}-extra-maps-${MY_PV}
56
57 pkg_setup() {
58         if use openmp; then
59                 if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp ; then
60                         ewarn "OpenMP is not available in your current selected gcc"
61                         die "need openmp capable gcc"
62                 fi
63         fi
64         games_pkg_setup
65 }
66
67 src_prepare() {
68         epatch \
69                 "${FILESDIR}"/${P}-{ldconfig,paths}.patch \
70                 "${FILESDIR}"/${P}-check-headers.patch
71
72         sed -i \
73                 -e 's/-Werror//' \
74                 configure.ac || die
75         eautoreconf
76 }
77
78 src_configure() {
79         # configure fails with cunit disabled
80         egamesconf \
81                 $(use_enable nls) \
82                 --enable-cunit \
83                 $(use_enable gtk) \
84                 --enable-mod-gl1 \
85                 $(use_enable gles2 mod-gles2) \
86                 $(use_enable libcaca mod-caca) \
87                 $(use_enable openmp) \
88                 $(use_enable ogg mod-ogg) \
89                 $(use_enable !ogg silent) \
90                 $(use_enable readline console) \
91                 --disable-static \
92                 --datarootdir=/usr/share \
93                 --mandir=/usr/share/man \
94                 --docdir=/usr/share/doc/${PF} \
95                 --htmldir=/usr/share/doc/${PF}/html
96
97         if use maps; then
98                 cd "${S_MAPS}" || die
99                 egamesconf
100         fi
101 }
102
103 src_compile() {
104         default
105         use doc && emake html
106         use maps && emake -C "${S_MAPS}"
107 }
108
109 src_install() {
110         emake DESTDIR="${D}" install
111         use maps && emake -C "${S_MAPS}" DESTDIR="${D}" install
112         prune_libtool_files --all
113         prepgamesdirs
114 }