blob: 484af536d278740baa27f0f657ae7e022fdd91b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake flag-o-matic xdg
DESCRIPTION="Space exploration, trading & combat in the tradition of Terminal Velocity"
HOMEPAGE="https://endless-sky.github.io/"
SRC_URI="
https://github.com/endless-sky/endless-sky/archive/refs/tags/v${PV}.tar.gz
-> ${P}.tar.gz
"
LICENSE="
GPL-3+
CC-BY-2.0 CC-BY-3.0 CC-BY-4.0
CC-BY-SA-3.0 CC-BY-SA-4.0
CC0-1.0 Unsplash public-domain
"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="gles2-only test"
RESTRICT="!test? ( test )"
RDEPEND="
media-libs/libglvnd
media-libs/libjpeg-turbo:=
media-libs/libmad
media-libs/libpng:=
media-libs/libsdl2[video]
media-libs/openal
sys-apps/util-linux
gles2-only? ( media-libs/libsdl2[gles2] )
!gles2-only? (
media-libs/glew:0=
media-libs/libsdl2[opengl]
)
"
DEPEND="
${RDEPEND}
test? ( dev-cpp/catch:0 )
"
src_prepare() {
cmake_src_prepare
# no /usr/*games/ on Gentoo, adjust docdir, install even if != Release,
# and GLEW is unused if USE=gles2-only (using sed for less rebasing)
sed -e '/install(/s: games: libexec:' \
-e '/install(/s: share/games: share:' \
-e "/install(/s: share/doc/endless-sky: share/doc/${PF}:" \
-e '/install(/s: CONFIGURATIONS Release::' \
-e 's:GLEW REQUIRED:GLEW:' \
-i CMakeLists.txt || die
# do not use sanitizers for tests
sed -i '/SANITIZER_OPTS/d' tests/CMakeLists.txt || die
# source/Files.cpp has odd logic to find resources, make a wrapper
# rather than try to modify it
printf '#!/usr/bin/env sh\nexec %q --resources %q "$@"\n' \
"${EPREFIX}"/usr/libexec/${PN} \
"${EPREFIX}"/usr/share/${PN} > "${T}"/${PN} || die
}
src_configure() {
filter-lto # -Werror=odr issues
local mycmakeargs=(
-DBUILD_TESTING=$(usex test)
-DES_GLES=$(usex gles2-only)
-DES_USE_SYSTEM_LIBRARIES=yes
-DES_USE_VCPKG=no
)
cmake_src_configure
}
src_install() {
cmake_src_install
dobin "${T}"/${PN}
gzip -d -- "${ED}"/usr/share/man/man6/${PN}.6.gz || die
rm -- "${ED}"/usr/share/doc/${PF}/{copyright,license.txt} || die
}
pkg_postinst() {
xdg_pkg_postinst
if [[ ! ${REPLACING_VERSIONS} ]]; then
elog "Endless Sky provides high-res sprites for high-dpi screens."
elog "If you want to use them, download:"
elog
elog " https://github.com/endless-sky/endless-sky-high-dpi/releases"
elog
elog "and extract it to ~/.local/share/endless-sky/plugins/"
fi
}
|