commit:     09816994d59a1ac07de4e5dbbd25c4693b01dff9
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 22 22:55:22 2025 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Feb 23 00:09:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09816994

games-strategy/endless-sky: add 0.10.12

This started searching in /usr/bin for resources ignoring the
RESOURCES_PATH logic, and attempting to change that messed with
tests instead. Ultimately probably simpler to not modify the
sources and just make a wrapper.

Hopefully this odd install logic will be improved upstream
eventually (haven't looked if there is already a bug).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-strategy/endless-sky/Manifest                |   1 +
 .../endless-sky/endless-sky-0.10.12.ebuild         | 100 +++++++++++++++++++++
 2 files changed, 101 insertions(+)

diff --git a/games-strategy/endless-sky/Manifest 
b/games-strategy/endless-sky/Manifest
index 91f070301e73..fbe45f42e31e 100644
--- a/games-strategy/endless-sky/Manifest
+++ b/games-strategy/endless-sky/Manifest
@@ -1 +1,2 @@
+DIST endless-sky-0.10.12.tar.gz 360083301 BLAKE2B 
e62911494e4824adeaee6aee8722afa0e7339d3f51186b6d60b05704131911cd262ffd750bff4eeeee15b61edbf63cfde2a03cd1728166121f04ac8afc2451f6
 SHA512 
908751e4d0f6df5bfdfc0be99326a3a9e6ef4585e7968b4576c338c9b7904b462628ebec329b1246c7c2edec5a281f28ff389ae754ec92f11743cac5e20d260a
 DIST endless-sky-0.10.8.tar.gz 257381131 BLAKE2B 
ea6fe5e4240b9744a9e1d64137a731c8a67f88acbd688fad13f3beab2bb6d16e46b3c85fd1288350917eff18264b5a477ed964729edaa098eff07fef10ca81ee
 SHA512 
d6cfb3efba6214a42b112d315dda945085f6a9f915a22bd3fe0ff78cb628a242aa8c0613165a2e1c67d81f5c32f937c2b73a7851efe3984ebe94af4e456df547

diff --git a/games-strategy/endless-sky/endless-sky-0.10.12.ebuild 
b/games-strategy/endless-sky/endless-sky-0.10.12.ebuild
new file mode 100644
index 000000000000..0a0a880a13d0
--- /dev/null
+++ b/games-strategy/endless-sky/endless-sky-0.10.12.ebuild
@@ -0,0 +1,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 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
+}

Reply via email to