]> Pileus Git - ~andy/sunrise/blob - games-strategy/freeorion/freeorion-0.3.17_p4823.ebuild
Use pkgconfig virtual.
[~andy/sunrise] / games-strategy / freeorion / freeorion-0.3.17_p4823.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 PYTHON_DEPEND="2"
8
9 inherit cmake-utils python subversion games
10
11 DESCRIPTION="A free and open source clone of Master Of Orion"
12 HOMEPAGE="http://www.freeorion.org"
13 ESVN_REPO_URI="https://${PN}.svn.sourceforge.net/svnroot/${PN}/trunk"
14 ESVN_PROJECT="${PN}"
15 ESVN_REVISION="${PV#*_p}"
16
17 LICENSE="GPL-2 CCPL-Attribution-ShareAlike-3.0"
18 SLOT="0"
19 KEYWORDS="" # dependency gigi unkeyworded and potentially broken
20 IUSE="cg"
21
22 RDEPEND="
23         dev-games/gigi[ogre,ois]
24         dev-games/ogre[cg?,opengl]
25         >=dev-libs/boost-1.47[python]
26         media-libs/freealut
27         media-libs/libogg
28         media-libs/libsdl[X,opengl,video]
29         media-libs/libvorbis
30         media-libs/openal
31         sci-physics/bullet
32         sys-libs/zlib
33         virtual/opengl"
34 DEPEND="${RDEPEND}
35         virtual/pkgconfig"
36
37 CMAKE_USE_DIR="${S}"/FreeOrion
38 CMAKE_VERBOSE="1"
39
40 src_unpack() {
41         subversion_src_unpack
42 }
43
44 src_prepare() {
45         # set OGRE plugin-dir
46         sed \
47                 -e "s:PluginFolder=.:PluginFolder=$(pkg-config --variable=plugindir OGRE):" \
48                 -i "${CMAKE_USE_DIR}"/ogre_plugins.cfg || die
49
50         # set revision number
51         sed \
52                 -e "/svn_revision_number/s:???:${ESVN_REVISION}:" \
53                 -i "${CMAKE_USE_DIR}"/CMakeLists.txt || die
54
55         if use cg ; then
56                 # add cg ogre plugin to config
57                 echo "Plugin=Plugin_CgProgramManager" \
58                         >> "${CMAKE_USE_DIR}"/ogre_plugins.cfg || die
59         fi
60 }
61
62 src_configure() {
63         local mycmakeargs=(
64                 -DRELEASE_COMPILE_FLAGS=""
65                 )
66
67         cmake-utils_src_configure
68 }
69
70 src_compile() {
71         cmake-utils_src_compile
72 }
73
74 src_install() {
75         # data files
76         rm "${CMAKE_USE_DIR}"/default/COPYING || die
77         insinto "${GAMES_DATADIR}"/${PN}
78         doins -r "${CMAKE_USE_DIR}"/default || die
79
80         # bin
81         dogamesbin "${CMAKE_BUILD_DIR}"/${PN}{ca,d} || die
82         newgamesbin "${CMAKE_BUILD_DIR}"/${PN} ${PN}.bin || die
83         games_make_wrapper ${PN} \
84                 "${GAMES_BINDIR}/${PN}.bin --resource-dir ./default" \
85                 "${GAMES_DATADIR}/${PN}"
86
87         # config
88         insinto "${GAMES_SYSCONFDIR}"/${PN}
89         doins "${CMAKE_USE_DIR}"/{OISInput,ogre_plugins}.cfg || die
90         # game uses relative paths
91         dosym "${GAMES_SYSCONFDIR}"/${PN}/ogre_plugins.cfg \
92                 "${GAMES_DATADIR}"/${PN}/ogre_plugins.cfg || die
93         dosym "${GAMES_SYSCONFDIR}"/${PN}/OISInput.cfg \
94                 "${GAMES_DATADIR}"/${PN}/OISInput.cfg || die
95
96         # other
97         dodoc "${CMAKE_USE_DIR}"/changelog.txt || die
98         newicon "${CMAKE_USE_DIR}"/default/data/art/icons/FO_Icon_32x32.png \
99                 ${PN}.png || die
100         make_desktop_entry ${PN} ${PN} ${PN}
101
102         # permissions
103         prepgamesdirs
104 }