5bf1f6f4f99a86e3297a8bb694795fce8c20d5d5
[gentoo.git] / games-strategy / freeorion / freeorion-0.4.8_p20190501-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 )
7 inherit cmake-utils python-single-r1 xdg
8
9 DESCRIPTION="A free turn-based space empire and galactic conquest game"
10 HOMEPAGE="https://www.freeorion.org"
11
12 if [[ ${PV} == 9999 ]]; then
13         inherit git-r3
14         EGIT_REPO_URI="https://github.com/freeorion/freeorion.git"
15 else
16         KEYWORDS="~amd64"
17         if [[ ${PV} = *_p* ]]; then
18                 COMMIT="2a49c05796f1c92b96ce9b2aeaf0124fc8be7a77"
19                 SRC_URI="https://github.com/${PN}/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
20                 S="${WORKDIR}/${PN}-${COMMIT}"
21         else
22                 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
23                 S="${WORKDIR}/${PN}-${PV/_/-}"
24         fi
25 fi
26
27 LICENSE="GPL-2 LGPL-2.1 CC-BY-SA-3.0"
28 SLOT="0"
29 IUSE="dedicated"
30
31 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
32
33 BDEPEND="
34         virtual/pkgconfig
35 "
36 RDEPEND="
37         $(python_gen_cond_dep '
38                 >=dev-libs/boost-1.58:=[python,threads,${PYTHON_MULTI_USEDEP}]
39         ')
40         !dedicated? (
41                 media-libs/freealut
42                 >=media-libs/freetype-2.5.5
43                 media-libs/glew:=
44                 >=media-libs/libogg-1.1.3
45                 media-libs/libpng:0=
46                 media-libs/libsdl2[X,opengl,video]
47                 >=media-libs/libvorbis-1.1.2
48                 media-libs/openal
49                 sci-physics/bullet
50                 virtual/opengl
51         )
52         sys-libs/zlib
53         ${PYTHON_DEPS}
54 "
55 DEPEND="${RDEPEND}"
56
57 pkg_setup() {
58         # build system is using FindPythonLibs.cmake which needs python:2
59         python-single-r1_pkg_setup
60 }
61
62 src_prepare() {
63         sed -e "s/-O3//" -i CMakeLists.txt || die
64
65         cmake-utils_src_prepare
66 }
67
68 src_configure() {
69         local mycmakeargs=(
70                 -DCMAKE_BUILD_TYPE=Release
71                 -DCMAKE_SKIP_RPATH=ON
72                 -DBUILD_HEADLESS="$(usex dedicated)"
73         )
74
75         cmake-utils_src_configure
76 }
77
78 src_install() {
79         cmake-utils_src_install
80
81         newenvd "${FILESDIR}/${PN}.envd" 99${PN}
82 }