games-strategy/freeorion: Bumped live ebuild to EAPI-7
[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="http://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         MY_PV="${PV/_/-}"
17         SRC_URI="https://github.com/${PN}/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
18         KEYWORDS="~amd64"
19         S="${WORKDIR}/${PN}-${MY_PV}"
20 fi
21
22 LICENSE="GPL-2 LGPL-2.1 CC-BY-SA-3.0"
23 SLOT="0"
24 IUSE=""
25
26 RDEPEND="
27         >=dev-libs/boost-1.56:=[python,threads,${PYTHON_USEDEP}]
28         media-libs/freealut
29         media-libs/freetype
30         media-libs/glew:=
31         media-libs/libsdl2
32         >=media-libs/libogg-1.1.3
33         media-libs/libpng:0
34         media-libs/libsdl2[X,opengl,video]
35         >=media-libs/libvorbis-1.1.2
36         media-libs/openal
37         sci-physics/bullet
38         sys-libs/zlib
39         virtual/opengl
40         !dev-games/gigi"
41         # Use bundled gigi as of freeorion-0.4.3
42
43 DEPEND="${RDEPEND}"
44 BDEPEND="
45         ${PYTHON_DEPS}
46         virtual/pkgconfig"
47
48 pkg_setup() {
49         # build system is using FindPythonLibs.cmake which needs python:2
50         python-single-r1_pkg_setup
51 }
52
53 src_prepare() {
54         sed -e "s/-O3//" -i CMakeLists.txt || die
55
56         cmake-utils_src_prepare
57 }
58
59 src_configure() {
60         local mycmakeargs=(
61                 -DCMAKE_BUILD_TYPE=Release
62                 -DCMAKE_SKIP_RPATH=ON
63         )
64
65         #append-cppflags -DBOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
66
67         cmake-utils_src_configure
68 }
69
70 src_install() {
71         cmake-utils_src_install
72         dodoc ChangeLog.md
73
74         newenvd "${FILESDIR}/${PN}.envd" 99${PN}
75 }
76
77 pkg_preinst() {
78         xdg_pkg_preinst
79 }
80
81 pkg_postinst() {
82         xdg_pkg_postinst
83 }
84
85 pkg_postrm() {
86         xdg_pkg_postrm
87 }