Use https by default
[gentoo.git] / games-strategy / freeorion / freeorion-0.4.5_pre.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://dev.gentoo.org/~tomka/files/${P}.tar.bz2"
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_prepare() {
48
49         epatch "${FILESDIR}/${P}-boost-1.57.patch"
50         epatch "${FILESDIR}/${P}-boost-1.58.patch"
51
52         # parse subdir sets -O3
53         sed -e "s:-O3::" -i parse/CMakeLists.txt
54
55         # set revision for display in game -- update on bump!
56         sed -i -e 's/???/8051/' CMakeLists.txt
57 }
58
59 src_configure() {
60         local mycmakeargs=(
61                 -DRELEASE_COMPILE_FLAGS=""
62                 -DCMAKE_SKIP_RPATH=ON
63                 )
64
65         cmake-utils_src_configure
66 }
67
68 src_compile() {
69         cmake-utils_src_compile
70 }
71
72 src_install() {
73         # data files
74         rm "${CMAKE_USE_DIR}"/default/COPYING || die
75         insinto "${GAMES_DATADIR}"/${PN}
76         doins -r "${CMAKE_USE_DIR}"/default || die
77
78         # bin
79         dogamesbin "${CMAKE_BUILD_DIR}"/${PN}{ca,d} || die
80         newgamesbin "${CMAKE_BUILD_DIR}"/${PN} ${PN}.bin || die
81         games_make_wrapper ${PN} \
82                 "${GAMES_BINDIR}/${PN}.bin --resource-dir ${GAMES_DATADIR}/${PN}/default" \
83                 "${GAMES_DATADIR}/${PN}"
84
85         # lib
86         dogameslib "${CMAKE_BUILD_DIR}"/libfreeorion{common,parse}.so || die
87         dogameslib "${CMAKE_BUILD_DIR}"/libGiGi*.so || die
88
89         # other
90         dodoc "${CMAKE_USE_DIR}"/changelog.txt || die
91         newicon "${CMAKE_USE_DIR}"/default/data/art/icons/FO_Icon_32x32.png \
92                 ${PN}.png || die
93         make_desktop_entry ${PN} ${PN} ${PN}
94
95         # permissions
96         prepgamesdirs
97 }