041955f0f1f66cf074e5c467f8226b8ed20f8693
[gentoo.git] / sci-astronomy / stellarium / stellarium-0.19.0.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 inherit cmake-utils desktop flag-o-matic xdg virtualx
7
8 DESCRIPTION="3D photo-realistic skies in real time"
9 HOMEPAGE="https://www.stellarium.org/"
10 SRC_URI="
11         https://github.com/Stellarium/stellarium/releases/download/v${PV}/${P}.tar.gz
12         stars? (
13                 https://github.com/Stellarium/stellarium-data/releases/download/stars-2.0/stars_4_1v0_2.cat
14                 https://github.com/Stellarium/stellarium-data/releases/download/stars-2.0/stars_5_2v0_1.cat
15                 https://github.com/Stellarium/stellarium-data/releases/download/stars-2.0/stars_6_2v0_1.cat
16                 https://github.com/Stellarium/stellarium-data/releases/download/stars-2.0/stars_7_2v0_1.cat
17                 https://github.com/Stellarium/stellarium-data/releases/download/stars-2.0/stars_8_2v0_1.cat
18         )"
19
20 LICENSE="GPL-2+"
21 SLOT="0"
22 KEYWORDS="amd64 ppc ~ppc64 x86 ~amd64-linux ~x86-linux"
23 IUSE="debug gps media nls stars test"
24
25 BDEPEND="
26         nls? ( dev-qt/linguist-tools:5 )
27 "
28
29 RDEPEND="
30         dev-qt/qtcore:5
31         dev-qt/qtgui:5
32         dev-qt/qtnetwork:5
33         dev-qt/qtopengl:5
34         dev-qt/qtprintsupport:5
35         dev-qt/qtscript:5
36         dev-qt/qtserialport:5
37         dev-qt/qtwidgets:5
38         media-fonts/dejavu
39         sys-libs/zlib
40         virtual/opengl
41         gps? ( dev-qt/qtpositioning:5 )
42         media? ( dev-qt/qtmultimedia:5[widgets] )
43 "
44 DEPEND="${RDEPEND}
45         dev-qt/qtconcurrent:5
46         test? ( dev-qt/qttest:5 )
47 "
48
49 PATCHES=(
50         "${FILESDIR}"/${P}-static.patch
51 )
52
53 src_prepare() {
54         xdg_environment_reset
55         cmake-utils_src_prepare
56         use debug || append-cppflags -DQT_NO_DEBUG #415769
57 }
58
59 src_configure() {
60         local mycmakeargs=(
61                 -DENABLE_GPS="$(usex gps)"
62                 -DENABLE_MEDIA="$(usex media)"
63                 -DENABLE_NLS="$(usex nls)"
64                 -DENABLE_TESTING="$(usex test)"
65         )
66         cmake-utils_src_configure
67 }
68
69 src_test() {
70         virtx cmake-utils_src_test
71 }
72
73 src_install() {
74         cmake-utils_src_install
75
76         # use the more up-to-date system fonts
77         rm "${ED}"/usr/share/stellarium/data/DejaVuSans{Mono,}.ttf || die
78         dosym ../../fonts/dejavu/DejaVuSans.ttf /usr/share/stellarium/data/DejaVuSans.ttf
79         dosym ../../fonts/dejavu/DejaVuSansMono.ttf /usr/share/stellarium/data/DejaVuSansMono.ttf
80
81         if use stars ; then
82                 insinto /usr/share/${PN}/stars/default
83                 doins "${DISTDIR}"/stars_4_1v0_2.cat
84                 doins "${DISTDIR}"/stars_{5,6,7,8}_2v0_1.cat
85         fi
86         newicon doc/images/stellarium-logo.png ${PN}.png
87 }