ports: Add SuperTux port

This commit is contained in:
Bananymous 2025-11-02 21:15:59 +02:00
parent 7b4d349574
commit 00e5749e20
3 changed files with 95 additions and 0 deletions

32
ports/SuperTux/build.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash ../install.sh
NAME='SuperTux'
VERSION='0.6.3'
DOWNLOAD_URL="https://github.com/SuperTux/supertux/releases/download/v$VERSION/SuperTux-v$VERSION-Source.tar.gz#f7940e6009c40226eb34ebab8ffb0e3a894892d891a07b35d0e5762dd41c79f6"
TAR_CONTENT="SuperTux-v$VERSION-Source"
DEPENDENCIES=('boost' 'SDL2' 'SDL2_image' 'curl' 'openal-soft' 'libvorbis' 'freetype' 'physfs' 'glm')
configure() {
mkdir -p build
pushd build
$BANAN_CMAKE \
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
-G Ninja --fresh .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DINSTALL_SUBDIR_BIN=bin \
-DBUILD_DOCUMENTATION=OFF \
-DENABLE_OPENGL=OFF \
-DENABLE_BOOST_STATIC_LIBS=ON \
|| exit 1
popd
# crashes in `std::ostream::sentry::sentry(std::ostream&)` with shared boost
}
build() {
$BANAN_CMAKE --build build || exit 1
}
install() {
$BANAN_CMAKE --install build || exit 1
}

View File

@ -0,0 +1,52 @@
diff -ruN SuperTux-0.6.3/CMakeLists.txt SuperTux-0.6.3-banan_os/CMakeLists.txt
--- SuperTux-0.6.3/CMakeLists.txt 2021-12-23 01:01:57.000000000 +0200
+++ SuperTux-0.6.3-banan_os/CMakeLists.txt 2025-11-02 20:57:03.725932455 +0200
@@ -171,7 +171,7 @@
else(ENABLE_BOOST_STATIC_LIBS)
set(Boost_USE_STATIC_LIBS FALSE)
endif(ENABLE_BOOST_STATIC_LIBS)
-find_package(Boost REQUIRED COMPONENTS filesystem system date_time locale)
+find_package(Boost REQUIRED COMPONENTS filesystem date_time locale)
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})
@@ -507,6 +507,7 @@
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX}
+ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DINSTALL_INC_DIR=include
-DCMAKE_POSITION_INDEPENDENT_CODE=ON)
@@ -966,7 +967,7 @@
endif()
endif()
target_include_directories(supertux2_lib SYSTEM PUBLIC ${SDL_TTF_PREFIX}/include/SDL2)
-target_link_libraries(supertux2_lib PUBLIC SDL_ttf_lib)
+target_link_libraries(supertux2_lib PUBLIC libSDL2_ttf.a)
if(VCPKG_BUILD)
target_link_libraries(supertux2_lib PUBLIC freetype)
else()
@@ -977,9 +978,10 @@
target_link_libraries(supertux2_lib PUBLIC ${HARFBUZZ_LIBRARY} ${FRIBIDI_LIBRARY} ${RAQM_LIBRARY})
endif()
-target_link_libraries(supertux2_lib PUBLIC squirrel_lib)
-target_link_libraries(supertux2_lib PUBLIC sqstdlib_lib)
-target_link_libraries(supertux2_lib PUBLIC tinygettext_lib)
+target_link_libraries(supertux2_lib PUBLIC libsquirrel_static.a)
+target_link_libraries(supertux2_lib PUBLIC libsqstdlib_static.a)
+target_link_libraries(supertux2_lib PUBLIC libtinygettext.a)
+
target_link_libraries(supertux2_lib PUBLIC sexp)
target_link_libraries(supertux2_lib PUBLIC savepng)
target_link_libraries(supertux2_lib PUBLIC partio_zip_lib)
@@ -1025,7 +1027,7 @@
if(VCPKG_BUILD)
target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARIES})
else()
- target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARY})
+ target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARY} ssl crypto zstd z)
endif()
endif(HAVE_LIBCURL)
endif(NOT EMSCRIPTEN)

View File

@ -0,0 +1,11 @@
diff -ruN SuperTux-0.6.3/external/partio_zip/zip_manager.hpp SuperTux-0.6.3-banan_os/external/partio_zip/zip_manager.hpp
--- SuperTux-0.6.3/external/partio_zip/zip_manager.hpp 2021-12-23 01:01:58.000000000 +0200
+++ SuperTux-0.6.3-banan_os/external/partio_zip/zip_manager.hpp 2025-11-02 20:16:29.691656288 +0200
@@ -44,6 +44,7 @@
#include <fstream>
#include <iostream>
#include <map>
+#include <memory>
#include <string>
#include <stdexcept>
#include <vector>