Merge remote-tracking branch 'github/pr/372'.
[gentoo.git] / games-strategy / freeorion / freeorion-0.4.5.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 PYTHON_COMPAT=( python2_7 )
8 inherit cmake-utils python-any-r1 games
9
10 DESCRIPTION="A free turn-based space empire and galactic conquest game"
11 HOMEPAGE="http://www.freeorion.org"
12 SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/FreeOrion_v0.4.5_2015-09-01.f203162_Source.tar.gz -> ${P}.tar.gz"
13
14 LICENSE="GPL-2 LGPL-2.1 CC-BY-SA-3.0"
15 SLOT="0"
16 KEYWORDS="~amd64"
17 IUSE="cg"
18
19 # Needs it's own version of GG(dev-games/gigi) which it ships.
20 # The split version dev-games/gigi is not used anymore as of 0.4.3
21 RDEPEND="
22         !dev-games/gigi
23         media-libs/libsdl2
24         >=dev-libs/boost-1.47[python]
25         media-libs/freealut
26         media-libs/glew
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         ${PYTHON_DEPS}
36         virtual/pkgconfig"
37
38 CMAKE_USE_DIR="${S}"
39 CMAKE_VERBOSE="1"
40
41 pkg_setup() {
42         # build system is using FindPythonLibs.cmake which needs python:2
43         python-any-r1_pkg_setup
44         games_pkg_setup
45 }
46
47 src_unpack() {
48         default
49         mv src-tarball "${P}" || die
50         }
51
52 src_prepare() {
53         # parse subdir sets -O3
54         sed -e "s:-O3::" -i parse/CMakeLists.txt
55
56         # For snapshots, the following can be used to the set revision
57         # for display in game -- update on bump!
58         # sed -i -e 's/???/8051/' CMakeLists.txt
59 }
60
61 src_configure() {
62         local mycmakeargs=(
63                 -DRELEASE_COMPILE_FLAGS=""
64                 -DCMAKE_SKIP_RPATH=ON
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 ${GAMES_DATADIR}/${PN}/default" \
85                 "${GAMES_DATADIR}/${PN}"
86
87         # lib
88         dogameslib "${CMAKE_BUILD_DIR}"/libfreeorion{common,parse}.so || die
89         dogameslib "${CMAKE_BUILD_DIR}"/libGiGi*.so || die
90
91         # other
92         dodoc "${CMAKE_USE_DIR}"/changelog.txt || die
93         newicon "${CMAKE_USE_DIR}"/default/data/art/icons/FO_Icon_32x32.png \
94                 ${PN}.png || die
95         make_desktop_entry ${PN} ${PN} ${PN}
96
97         # permissions
98         prepgamesdirs
99 }