summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2024-03-29 20:50:10 +0300
committerDmitry Marakasov <amdmi3@FreeBSD.org>2025-01-18 20:32:22 +0300
commit15f93866a01c86585af58df4759fac10f7e37c56 (patch)
tree6dd76a0fce83e0a919da2e6c79f48ea5cbf2fbd4
parentgraphics/py-pyglet: update 2.0.20 → 2.0.21 (diff)
games/endless-sky: update 0.10.4 → 0.10.10
- Fix test build depends PR: 277487 Tested by: alster@vinterdalen.se Reported by: alster@vinterdalen.se
-rw-r--r--games/endless-sky/Makefile14
-rw-r--r--games/endless-sky/distinfo6
-rw-r--r--games/endless-sky/files/patch-source_Audio.cpp63
-rw-r--r--games/endless-sky/files/patch-tests_unit_src_test__weightedList.cpp11
4 files changed, 25 insertions, 69 deletions
diff --git a/games/endless-sky/Makefile b/games/endless-sky/Makefile
index cb34395669b4..29ac088b20f7 100644
--- a/games/endless-sky/Makefile
+++ b/games/endless-sky/Makefile
@@ -1,5 +1,5 @@
PORTNAME= endless-sky
-PORTVERSION= 0.10.4
+PORTVERSION= 0.10.10
DISTVERSIONPREFIX= v
CATEGORIES= games
@@ -21,18 +21,26 @@ USE_GITHUB= yes
USES= cmake compiler:c++11-lang gl jpeg openal sdl
USE_SDL= sdl2
USE_GL= gl glew
-CMAKE_OFF= ES_USE_VCPKG
+CMAKE_OFF= ES_USE_VCPKG CMAKE_CXX_SCAN_FOR_MODULES
CMAKE_ARGS= -DCMAKE_INSTALL_DOCDIR="${DOCSDIR}"
+# https://github.com/endless-sky/endless-sky/issues/10714#issuecomment-2448722018
+TEST_ENV= ASAN_OPTIONS=detect_container_overflow=0
LDFLAGS_i386= -Wl,-znotext
PORTDATA= *
PORTDOCS= *
-OPTIONS_DEFINE= DOCS
+OPTIONS_DEFINE= DOCS TEST
+
+TEST_CMAKE_BOOL= BUILD_TESTING
+TEST_BUILD_DEPENDS= catch2>=0:devel/catch2
post-build:
@${REINPLACE_CMD} -e 's|/usr/local/|${PREFIX}/|; s|share/games|share|' \
${WRKSRC}/source/Files.cpp
+do-test-TEST-on:
+ @cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${LOCALBASE}/bin/ctest -V
+
.include <bsd.port.mk>
diff --git a/games/endless-sky/distinfo b/games/endless-sky/distinfo
index e71e8b0d24f5..ae550bf55eac 100644
--- a/games/endless-sky/distinfo
+++ b/games/endless-sky/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1698072980
-SHA256 (endless-sky-endless-sky-v0.10.4_GH0.tar.gz) = baeaa462315587788d81c58847d600f66f1ced063cdfb4cf108d6a26fe75e175
-SIZE (endless-sky-endless-sky-v0.10.4_GH0.tar.gz) = 255144369
+TIMESTAMP = 1730149437
+SHA256 (endless-sky-endless-sky-v0.10.10_GH0.tar.gz) = 2d3cce20335f151f401a617624a4914a08911f4a424aae84bdf6eb8984f3c085
+SIZE (endless-sky-endless-sky-v0.10.10_GH0.tar.gz) = 271561866
diff --git a/games/endless-sky/files/patch-source_Audio.cpp b/games/endless-sky/files/patch-source_Audio.cpp
deleted file mode 100644
index e89a03aaa292..000000000000
--- a/games/endless-sky/files/patch-source_Audio.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
---- source/Audio.cpp.orig 2023-10-21 20:01:54 UTC
-+++ source/Audio.cpp
-@@ -82,7 +82,7 @@ namespace {
- // This queue keeps track of sounds that have been requested to play. Each
- // added sound is "deferred" until the next audio position update to make
- // sure that all sounds from a given frame start at the same time.
-- map<const Sound *, QueueEntry> queue;
-+ map<const Sound *, QueueEntry> queue_;
- map<const Sound *, QueueEntry> deferred;
- thread::id mainThreadID;
-
-@@ -249,7 +249,7 @@ void Audio::Update(const Point &listenerPosition)
- listener = listenerPosition;
-
- for(const auto &it : deferred)
-- queue[it.first].Add(it.second);
-+ queue_[it.first].Add(it.second);
- deferred.clear();
- }
-
-@@ -273,7 +273,7 @@ void Audio::Play(const Sound *sound, const Point &posi
- // Place sounds from the main thread directly into the queue. They are from
- // the UI, and the Engine may not be running right now to call Update().
- if(this_thread::get_id() == mainThreadID)
-- queue[sound].Add(position - listener);
-+ queue_[sound].Add(position - listener);
- else
- {
- unique_lock<mutex> lock(audioMutex);
-@@ -317,12 +317,12 @@ void Audio::Step()
- {
- if(source.GetSound()->IsLooping())
- {
-- auto it = queue.find(source.GetSound());
-- if(it != queue.end())
-+ auto it = queue_.find(source.GetSound());
-+ if(it != queue_.end())
- {
- source.Move(it->second);
- newSources.push_back(source);
-- queue.erase(it);
-+ queue_.erase(it);
- }
- else
- {
-@@ -367,7 +367,7 @@ void Audio::Step()
-
- // Now, what is left in the queue is sounds that want to play, and that do
- // not correspond to an existing source.
-- for(const auto &it : queue)
-+ for(const auto &it : queue_)
- {
- // Use a recycled source if possible. Otherwise, create a new one.
- unsigned source = 0;
-@@ -396,7 +396,7 @@ void Audio::Step()
- sources.back().Move(it.second);
- alSourcePlay(source);
- }
-- queue.clear();
-+ queue_.clear();
-
- // Queue up new buffers for the music, if necessary.
- int buffersDone = 0;
diff --git a/games/endless-sky/files/patch-tests_unit_src_test__weightedList.cpp b/games/endless-sky/files/patch-tests_unit_src_test__weightedList.cpp
new file mode 100644
index 000000000000..76d617098781
--- /dev/null
+++ b/games/endless-sky/files/patch-tests_unit_src_test__weightedList.cpp
@@ -0,0 +1,11 @@
+--- tests/unit/src/test_weightedList.cpp.orig 2024-10-26 19:04:44 UTC
++++ tests/unit/src/test_weightedList.cpp
+@@ -348,7 +348,7 @@ SCENARIO( "Obtaining a random value", "[WeightedList][
+ REQUIRE( list.empty() );
+ THEN( "an informative runtime exception is thrown" ) {
+ CHECK_THROWS_AS( list.Get(), std::runtime_error );
+-#ifndef __APPLE__
++#if !defined(__APPLE__) && !defined(__FreeBSD__)
+ CHECK_THROWS_WITH( list.Get(), Catch::Matchers::ContainsSubstring("empty weighted list") );
+ #endif
+ }