]> Pileus Git - ~andy/sunrise/blob - games-arcade/tuxanci/tuxanci-0.20.ebuild
dev-embedded/s51dude: New ebuild for s51dude. Bug 241662
[~andy/sunrise] / games-arcade / tuxanci / tuxanci-0.20.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit games cmake-utils
6
7 DESCRIPTION="Tuxanci is first cushion shooter based on well-known Czech game Bulanci."
8 HOMEPAGE="http://www.tuxanci.org/"
9 SRC_URI="http://download.${PN}.org/${PV}/${P}-src.tar.bz2"
10 LICENSE="GPL-2"
11
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86 ~x86-fbsd"
14 IUSE="alsa dedicated"
15 # alsa is used only when building client
16
17 DEPEND="!dedicated? (
18                         >=media-libs/libsdl-1.2.10
19                         >=media-libs/sdl-ttf-2.0.7
20                         >=media-libs/sdl-image-1.2.6-r1
21                         alsa? (
22                                 >=media-libs/sdl-mixer-1.2.7
23                         )
24                 )"
25
26 S="${WORKDIR}/pkgs/${P}-src/"
27
28 pkg_setup() {
29         games_pkg_setup
30
31         if ! built_with_use media-libs/sdl-image png ; then
32                 eerror "media-libs/sdl-image is missing png support."
33                 die "Recompile media-libs/sdl-image with USE=\"png\""
34         fi
35
36         if ! built_with_use media-libs/sdl-mixer vorbis ; then
37                 eerror "media-libs/sdl-mixer is missing vorbis support."
38                 die "Recompile media-libs/sdl-mixer with USE=\"vorbis\""
39         fi
40 }
41
42 src_unpack() {
43         unpack ${A}
44         cd "${S}"
45         # setting proper prefix
46         sed -i \
47                 -e "s:PATH_DIR\tPREFIX:PATH_DIR:" src/base/path.h \
48                 || die "sed config.h failed!"
49         sed -i \
50                 -e "s:share/tuxanci:"${GAMES_DATADIR}"/"${PN}":" src/base/path.h \
51                 || die "sed config.h failed!"
52         sed -i \
53                 -e "s:CMAKE_INSTALL_DATADIR share/:CMAKE_INSTALL_DATADIR /usr/share/games/:" CMakeLists.txt \
54                 || die "sed CMakeLists.txt failed!"
55 }
56
57 src_compile() {
58         local mycmakeargs
59         use alsa || mycmakeargs="${mycmakeargs} -DNO_Audio=1"
60         use dedicated && mycmakeargs="${mycmakeargs} -DServer=1"
61         mycmakeargs="${mycmakeargs} -DPREFIX=\\\"/usr/games\\\" -DCMAKE_INSTALL_PREFIX:PATH=/usr/games"
62         cmake-utils_src_compile
63 }
64
65 src_install() {
66         cmake-utils_src_install
67         prepgamesdirs
68 }