games-strategy/colobot-data: Remove redundant version
[gentoo.git] / games-strategy / freeorion / freeorion-9999.ebuild
1 # Copyright 1999-2019 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         >=dev-libs/boost-1.58:=[python,threads,${PYTHON_USEDEP}]
38         !dedicated? (
39                 media-libs/freealut
40                 >=media-libs/freetype-2.5.5
41                 media-libs/glew:=
42                 >=media-libs/libogg-1.1.3
43                 media-libs/libpng:0=
44                 media-libs/libsdl2[X,opengl,video]
45                 >=media-libs/libvorbis-1.1.2
46                 media-libs/openal
47                 sci-physics/bullet
48                 virtual/opengl
49         )
50         sys-libs/zlib
51         ${PYTHON_DEPS}
52 "
53 DEPEND="${RDEPEND}"
54
55 pkg_setup() {
56         # build system is using FindPythonLibs.cmake which needs python:2
57         python-single-r1_pkg_setup
58 }
59
60 src_prepare() {
61         sed -e "s/-O3//" -i CMakeLists.txt || die
62
63         cmake-utils_src_prepare
64 }
65
66 src_configure() {
67         local mycmakeargs=(
68                 -DCMAKE_BUILD_TYPE=Release
69                 -DCMAKE_SKIP_RPATH=ON
70                 -DBUILD_HEADLESS="$(usex dedicated)"
71         )
72
73         cmake-utils_src_configure
74 }
75
76 src_install() {
77         cmake-utils_src_install
78
79         newenvd "${FILESDIR}/${PN}.envd" 99${PN}
80 }