dev-python/agate: Bump to 1.13.0
[gentoo/gentoo.git] / games-strategy / endless-sky / endless-sky-0.10.8.ebuild
blobd1f1437b24c214648b551ddcd1bd8d6c6f9bbba4
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit cmake prefix xdg
8 DESCRIPTION="Space exploration, trading & combat in the tradition of Terminal Velocity"
9 HOMEPAGE="https://endless-sky.github.io/"
10 SRC_URI="
11         https://github.com/endless-sky/endless-sky/archive/refs/tags/v${PV}.tar.gz
12                 -> ${P}.tar.gz
15 LICENSE="
16         GPL-3+
17         CC-BY-2.0 CC-BY-3.0 CC-BY-4.0
18         CC-BY-SA-3.0 CC-BY-SA-4.0
19         CC0-1.0 public-domain
21 SLOT="0"
22 KEYWORDS="~amd64 ~x86"
23 IUSE="gles2-only test"
24 RESTRICT="!test? ( test )"
26 RDEPEND="
27         media-libs/libglvnd
28         media-libs/libjpeg-turbo:=
29         media-libs/libmad
30         media-libs/libpng:=
31         media-libs/libsdl2[video]
32         media-libs/openal
33         sys-apps/util-linux
34         gles2-only? ( media-libs/libsdl2[gles2] )
35         !gles2-only? (
36                 media-libs/glew:0=
37                 media-libs/libsdl2[opengl]
38         )
40 DEPEND="${RDEPEND}"
42 src_prepare() {
43         cmake_src_prepare
45         # no /usr/*games/ on Gentoo, adjust docdir, install even if != Release,
46         # and GLEW is unused if USE=gles2-only (using sed for less rebasing)
47         sed -e '/install(/s: games: bin:' \
48                 -e '/install(/s: share/games: share:' \
49                 -e "/install(/s: share/doc/endless-sky: share/doc/${PF}:" \
50                 -e '/install(/s: CONFIGURATIONS Release::' \
51                 -e 's:GLEW REQUIRED:GLEW:' \
52                 -i CMakeLists.txt || die
53         sed -i '/PATH/s:share/games:share:' source/Files.cpp || die
55         hprefixify -w /PATH/ source/Files.cpp
58 src_configure() {
59         local mycmakeargs=(
60                 -DBUILD_TESTING=$(usex test)
61                 -DES_GLES=$(usex gles2-only)
62                 -DES_USE_SYSTEM_LIBRARIES=yes
63                 -DES_USE_VCPKG=no
64         )
66         cmake_src_configure
69 src_install() {
70         cmake_src_install
72         gzip -d -- "${ED}"/usr/share/man/man6/${PN}.6.gz || die
73         rm -- "${ED}"/usr/share/doc/${PF}/{copyright,license.txt} || die
76 pkg_postinst() {
77         xdg_pkg_postinst
79         if [[ ! ${REPLACING_VERSIONS} ]]; then
80                 elog "Endless Sky provides high-res sprites for high-dpi screens."
81                 elog "If you want to use them, download:"
82                 elog
83                 elog "   https://github.com/endless-sky/endless-sky-high-dpi/releases"
84                 elog
85                 elog "and extract it to ~/.local/share/endless-sky/plugins/"
86         fi