]> Pileus Git - ~andy/sunrise/blob - games-arcade/clonekeenplus/clonekeenplus-9999.ebuild
dev-db/dabo: Add ~amd64 keyword, EAPI bump
[~andy/sunrise] / games-arcade / clonekeenplus / clonekeenplus-9999.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=3
6
7 EGIT_REPO_URI="git://${PN}.git.sourceforge.net/gitroot/${PN}/${PN}"
8
9 inherit cmake-utils eutils git-2 toolchain-funcs games
10
11 DESCRIPTION="Open Source Commander Keen clone"
12 HOMEPAGE="http://clonekeenplus.sourceforge.ne"
13
14 LICENSE="|| ( GPL-1 GPL-2 GPL-3 )
15         LGPL-2"
16 SLOT="0"
17 KEYWORDS=""
18 IUSE="tremor"
19
20 RDEPEND="media-libs/libogg
21         media-libs/libsdl[X,audio,opengl,video]
22         virtual/opengl
23         x11-libs/libX11
24         x11-libs/libXau
25         x11-libs/libXdmcp
26         x11-libs/libXext
27         x11-libs/libxcb
28         !tremor? ( media-libs/libvorbis )
29         tremor? ( media-libs/tremor )"
30 DEPEND="${RDEPEND}
31         virtual/pkgconfig"
32
33 CMAKE_IN_SOURCE_BUILD=1
34
35 src_prepare() {
36         epatch "${FILESDIR}"/{cmake,findfile}.patch
37
38         sed \
39                 -e "/SYSTEM_DATA_DIR/s#/usr/share#${GAMES_DATADIR}#" \
40                 -i src/FindFile.h || die
41 }
42
43 src_configure() {
44         local mycmakeargs arch
45         arch=$(tc-arch)
46
47         case $arch in
48                 amd64)
49                         mycmakeargs=(
50                                 -DBUILD_TYPE=LINUX64
51                                 -DHAVE_64_BIT=1
52                                 )
53                         ;;
54                 x86)
55                         mycmakeargs=(
56                                 -DBUILD_TYPE=LINUX32
57                                 -DHAVE_64_BIT=0
58                                 )
59                         ;;
60                 *)
61                         die "unsopported architecture"
62                         ;;
63         esac
64
65         mycmakeargs+=(
66                 -DAPPDIR="${GAMES_BINDIR}"
67                 -DSHAREDIR="${GAMES_DATADIR}"/CommanderGenius
68                 -DDOCDIR="/usr/share/${PF}/doc"
69                 $(cmake-utils_use !tremor OGG)
70                 $(cmake-utils_use tremor TREMOR)
71                 )
72
73         cmake-utils_src_configure
74 }
75
76 src_install() {
77         mv vfsroot/cglogo512.png ${PN}.png || die
78         cmake-utils_src_install
79         doicon  ${PN}.png || die
80         make_desktop_entry CGenius ${PN} ${PN}
81         prepgamesdirs
82 }
83
84 pkg_postinst() {
85         games_pkg_postinst
86         elog "Check your settings in ~/.CommanderGenius/cgenius.cfg"
87         elog "after you have first started the game. You may need to"
88         elog "set \"OpenGL = true\" and adjust other settings."
89 }