build tools and run tests

This commit is contained in:
Dominik 'Rathann' Mierzejewski 2025-10-08 16:13:02 +02:00
commit fb80656b28
4 changed files with 156 additions and 13 deletions

View file

@ -0,0 +1,36 @@
diff -up ags-3.6.2.13/Common/CMakeLists.txt.cxx14 ags-3.6.2.13/Common/CMakeLists.txt
--- ags-3.6.2.13/Common/CMakeLists.txt.cxx14 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/Common/CMakeLists.txt 2025-09-05 00:52:47.300264039 +0200
@@ -241,7 +241,7 @@ if(AGS_TESTS)
test/version_test.cpp
)
set_target_properties(common_test PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 14
CXX_EXTENSIONS NO
C_STANDARD 11
C_EXTENSIONS NO
diff -up ags-3.6.2.13/Compiler/CMakeLists.txt.cxx14 ags-3.6.2.13/Compiler/CMakeLists.txt
--- ags-3.6.2.13/Compiler/CMakeLists.txt.cxx14 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/Compiler/CMakeLists.txt 2025-09-05 00:54:51.632435890 +0200
@@ -92,7 +92,7 @@ if(AGS_TESTS)
test/cc_test_helper.h
)
set_target_properties(compiler_test PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 14
CXX_EXTENSIONS NO
C_STANDARD 11
C_EXTENSIONS NO
diff -up ags-3.6.2.13/Engine/CMakeLists.txt.cxx14 ags-3.6.2.13/Engine/CMakeLists.txt
--- ags-3.6.2.13/Engine/CMakeLists.txt.cxx14 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/Engine/CMakeLists.txt 2025-09-05 00:55:12.224488252 +0200
@@ -649,7 +649,7 @@ if(AGS_TESTS)
test/systemimports_test.cpp
)
set_target_properties(engine_test PROPERTIES
- CXX_STANDARD 11
+ CXX_STANDARD 14
CXX_EXTENSIONS NO
C_STANDARD 11
C_EXTENSIONS NO

View file

@ -0,0 +1,11 @@
diff -up ags-3.6.2.13/Common/util/string_compat.c.orig ags-3.6.2.13/Common/util/string_compat.c
--- ags-3.6.2.13/Common/util/string_compat.c.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/Common/util/string_compat.c 2025-10-08 13:38:06.444603269 +0200
@@ -16,6 +16,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include "core/platform.h"
#include "debug/assert.h"

View file

@ -1,6 +1,6 @@
diff -up ags-3.6.2.12/CMake/FindLocalOpenAL.cmake.orig ags-3.6.2.12/CMake/FindLocalOpenAL.cmake
--- ags-3.6.2.12/CMake/FindLocalOpenAL.cmake.orig 2025-07-18 23:24:38.000000000 +0200
+++ ags-3.6.2.12/CMake/FindLocalOpenAL.cmake 2025-07-19 14:03:42.772659440 +0200
diff -up ags-3.6.2.13/CMake/FindLocalOpenAL.cmake.orig ags-3.6.2.13/CMake/FindLocalOpenAL.cmake
--- ags-3.6.2.13/CMake/FindLocalOpenAL.cmake.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/CMake/FindLocalOpenAL.cmake 2025-10-08 14:38:31.897433814 +0200
@@ -1,6 +1,6 @@
# Grab system openAL or use embedded mojoAL
@ -9,20 +9,50 @@ diff -up ags-3.6.2.12/CMake/FindLocalOpenAL.cmake.orig ags-3.6.2.12/CMake/FindLo
set(AGS_USE_MOJO_AL TRUE)
endif()
diff -up ags-3.6.2.12/CMakeLists.txt.orig ags-3.6.2.12/CMakeLists.txt
--- ags-3.6.2.12/CMakeLists.txt.orig 2025-07-18 23:24:38.000000000 +0200
+++ ags-3.6.2.12/CMakeLists.txt 2025-07-20 13:18:35.622533999 +0200
@@ -18,6 +18,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
diff -up ags-3.6.2.13/CMakeLists.txt.orig ags-3.6.2.13/CMakeLists.txt
--- ags-3.6.2.13/CMakeLists.txt.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/CMakeLists.txt 2025-10-08 14:38:31.897433814 +0200
@@ -18,9 +18,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
option(AGS_USE_LOCAL_ALL_LIBRARIES "Use a locally installed libraries" OFF)
option(AGS_USE_LOCAL_SDL2 "Use a locally installed SDL2" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_USE_LOCAL_SDL2_SOUND "Use a locally installed SDL2 Sound" ${AGS_USE_LOCAL_ALL_LIBRARIES})
+option(AGS_USE_LOCAL_GLM "Use a locally installed GLM" ${AGS_USE_LOCAL_ALL_LIBRARIES})
+option(AGS_USE_LOCAL_MINIZ "Use a locally installed Miniz" ${AGS_USE_LOCAL_ALL_LIBRARIES})
+option(AGS_USE_LOCAL_TINYXML "Use a locally installed TinyXML" ${AGS_USE_LOCAL_ALL_LIBRARIES})
+option(AGS_USE_LOCAL_TINYXML2 "Use a locally installed TinyXML2" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_USE_LOCAL_OGG "Use a locally installed OGG" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_USE_LOCAL_THEORA "Use a locally installed Theora" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_USE_LOCAL_VORBIS "Use a locally installed Vorbis" ${AGS_USE_LOCAL_ALL_LIBRARIES})
@@ -313,9 +316,22 @@ endif()
+option(AGS_USE_LOCAL_GTEST "Use a locally installed GTest" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_TESTS "Build tests" OFF)
option(AGS_BUILD_ENGINE "Build Engine" ON)
@@ -37,9 +41,13 @@ message("------- AGS dependencies option
message(" AGS_USE_LOCAL_ALL_LIBRARIES: ${AGS_USE_LOCAL_ALL_LIBRARIES}")
message(" AGS_USE_LOCAL_SDL2: ${AGS_USE_LOCAL_SDL2}")
message(" AGS_USE_LOCAL_SDL2_SOUND: ${AGS_USE_LOCAL_SDL2_SOUND}")
+message(" AGS_USE_LOCAL_GLM: ${AGS_USE_LOCAL_GLM}")
+message(" AGS_USE_LOCAL_MINIZ: ${AGS_USE_LOCAL_MINIZ}")
+message(" AGS_USE_LOCAL_TINYXML2: ${AGS_USE_LOCAL_TINYXML2}")
message(" AGS_USE_LOCAL_OGG: ${AGS_USE_LOCAL_OGG}")
message(" AGS_USE_LOCAL_THEORA: ${AGS_USE_LOCAL_THEORA}")
message(" AGS_USE_LOCAL_VORBIS: ${AGS_USE_LOCAL_VORBIS}")
+message(" AGS_USE_LOCAL_GTEST: ${AGS_USE_LOCAL_GTEST}")
message("------ AGS selected CMake options ------")
message(" AGS_TESTS: ${AGS_TESTS}")
message(" AGS_BUILD_ENGINE: ${AGS_BUILD_ENGINE}")
@@ -265,7 +273,11 @@ find_package(PkgConfig)
find_package(Threads)
if(AGS_TESTS)
+ if(NOT AGS_USE_LOCAL_GTEST)
include(FetchGoogleTest)
+ else()
+ find_package(GTest REQUIRED)
+ endif()
enable_testing()
endif()
@@ -313,9 +325,23 @@ endif()
include(FindLocalOpenAL)
include(FindLocalAllegro)
@ -35,6 +65,7 @@ diff -up ags-3.6.2.12/CMakeLists.txt.orig ags-3.6.2.12/CMakeLists.txt
add_subdirectory(libsrc/tinyxml2 EXCLUDE_FROM_ALL)
+else()
+ find_package(tinyxml2 REQUIRED)
+ add_library(TinyXML2::TinyXML2 ALIAS tinyxml2::tinyxml2)
+endif()
+if (NOT AGS_USE_LOCAL_MINIZ)
add_subdirectory(libsrc/miniz EXCLUDE_FROM_ALL)
@ -45,9 +76,9 @@ diff -up ags-3.6.2.12/CMakeLists.txt.orig ags-3.6.2.12/CMakeLists.txt
add_subdirectory(Common/libsrc/aastr-0.1.1 EXCLUDE_FROM_ALL)
diff -up ags-3.6.2.12/CMAKE.md.orig ags-3.6.2.12/CMAKE.md
--- ags-3.6.2.12/CMAKE.md.orig 2025-07-18 23:24:38.000000000 +0200
+++ ags-3.6.2.12/CMAKE.md 2025-07-20 13:16:13.775985811 +0200
diff -up ags-3.6.2.13/CMAKE.md.orig ags-3.6.2.13/CMAKE.md
--- ags-3.6.2.13/CMAKE.md.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/CMAKE.md 2025-10-08 14:38:31.898433823 +0200
@@ -97,6 +97,9 @@ The available flags are:
- `AGS_USE_LOCAL_SDL2` : Find SDL2 locally
@ -58,3 +89,36 @@ diff -up ags-3.6.2.12/CMAKE.md.orig ags-3.6.2.12/CMAKE.md
- `AGS_USE_LOCAL_OGG` : Find OGG locally
- `AGS_USE_LOCAL_THEORA` : Find Theora locally
- `AGS_USE_LOCAL_VORBIS` : Find Vorbis locally
diff -up ags-3.6.2.13/Common/CMakeLists.txt.orig ags-3.6.2.13/Common/CMakeLists.txt
--- ags-3.6.2.13/Common/CMakeLists.txt.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/Common/CMakeLists.txt 2025-10-08 14:38:31.900433840 +0200
@@ -250,6 +250,7 @@ if(AGS_TESTS)
target_link_libraries(common_test
common
gtest_main
+ gtest
)
include(GoogleTest)
diff -up ags-3.6.2.13/Compiler/CMakeLists.txt.orig ags-3.6.2.13/Compiler/CMakeLists.txt
--- ags-3.6.2.13/Compiler/CMakeLists.txt.orig 2025-10-08 14:38:31.900433840 +0200
+++ ags-3.6.2.13/Compiler/CMakeLists.txt 2025-10-08 15:00:07.456886639 +0200
@@ -102,6 +102,7 @@ if(AGS_TESTS)
compiler_test
compiler
gtest_main
+ gtest
)
include(GoogleTest)
diff -up ags-3.6.2.13/Engine/CMakeLists.txt.orig ags-3.6.2.13/Engine/CMakeLists.txt
--- ags-3.6.2.13/Engine/CMakeLists.txt.orig 2025-10-08 14:38:31.901433848 +0200
+++ ags-3.6.2.13/Engine/CMakeLists.txt 2025-10-08 15:01:10.681457075 +0200
@@ -660,6 +660,7 @@ if(AGS_TESTS)
engine
common
gtest_main
+ gtest
)
include(GoogleTest)

View file

@ -8,9 +8,11 @@ Name: ags
Summary: Engine for creating and running videogames of adventure (quest) genre
Version: 3.6.2.13
URL: http://www.adventuregamestudio.co.uk/site/ags/
Release: 1%{?dist}
Release: 2%{?dist}
Source0: https://github.com/adventuregamestudio/ags/archive/%{fver}/ags-%{fver}.tar.gz
Patch0: ags-use-system-libraries.patch
Patch1: ags-build-tests-with-cxx14.patch
Patch2: ags-missing-includes.patch
# Most code is under Artistic-2.0, except:
# Common/libsrc/aastr-0.1.1: LicenseRef-Fedora-UltraPermissive
# Common/libsrc/alfont-2.0.9: FTL
@ -34,6 +36,7 @@ BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: glad
BuildRequires: glm-devel
BuildRequires: gtest-devel
# for KHR/khrplatform.h
BuildRequires: libglvnd-devel
BuildRequires: libogg-devel
@ -66,9 +69,18 @@ limited, support for other genres as well.
Originally created by Chris Jones back in 1999, AGS was opensourced in 2011 and
since continued to be developed by contributors.
%package tools
Summary: Tools for Adventure Game Studio engine game development
Requires: %{name}%{_isa} = %{version}-%{release}
%description tools
This package contains the AGS engine game development tools.
%prep
%setup -q
%patch 0 -p1 -b .orig
%patch 1 -p1 -b .cxx14
%patch 2 -p1 -b .incl
# delete unused bundled stuff
pushd Common/libinclude
rm -r ogg
@ -101,6 +113,8 @@ mv Changes.txt.utf-8 Changes.txt
%build
%cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DAGS_BUILD_TOOLS=TRUE \
-DAGS_TESTS=TRUE \
-DAGS_USE_LOCAL_SDL2=TRUE \
-DAGS_USE_LOCAL_SDL2_SOUND=TRUE \
-DAGS_USE_LOCAL_OGG=TRUE \
@ -109,18 +123,36 @@ mv Changes.txt.utf-8 Changes.txt
-DAGS_USE_LOCAL_GLM=TRUE \
-DAGS_USE_LOCAL_TINYXML2=TRUE \
-DAGS_USE_LOCAL_MINIZ=TRUE \
-DAGS_USE_LOCAL_GTEST=TRUE \
%cmake_build
%install
%cmake_install
%check
%ctest
%files
%license License.txt
%doc Changes.txt Copyright.txt OPTIONS.md README.md
%{_bindir}/ags
%files tools
%{_bindir}/agscc
%{_bindir}/agf2dlgasc
%{_bindir}/agfexport
%{_bindir}/agspak
%{_bindir}/agsunpak
%{_bindir}/crm2ash
%{_bindir}/crmpak
%{_bindir}/trac
%{_bindir}/ags
%changelog
* Fri Sep 05 2025 Dominik Mierzejewski <dominik@greysector.net> - 3.6.2.13-2
- build tools and run tests
* Thu Sep 04 2025 Dominik Mierzejewski <dominik@greysector.net> - 3.6.2.13-1
- update to 3.6.2.13 (resolves rhbz#2393079)