diff --git a/ports/butterscotch/build.sh b/ports/butterscotch/build.sh new file mode 100755 index 00000000..90779cf3 --- /dev/null +++ b/ports/butterscotch/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash ../install.sh + +NAME='butterscotch' +VERSION='git' +DOWNLOAD_URL="https://github.com/ButterscotchRunner/Butterscotch.git#b95f61c1aa84d9dd4a7b589b2a3331ab28dfa2ea" +DEPENDENCIES=('SDL2' 'openal-soft') + +configure() { + cmake --fresh -B build -S . -G Ninja \ + --toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DPLATFORM='desktop' \ + -DAUDIO_BACKEND='openal' \ + -DDESKTOP_BACKEND='sdl2' \ + . || exit 1 +} + +build() { + cmake --build build || exit 1 +} + +install() { + mkdir -p "$DESTDIR/usr/bin" || exit 1 + cp -vf build/butterscotch "$DESTDIR/usr/bin/" || exit 1 +} diff --git a/ports/butterscotch/patches/0001-include-alloca.h.patch b/ports/butterscotch/patches/0001-include-alloca.h.patch new file mode 100644 index 00000000..ff2c6e5a --- /dev/null +++ b/ports/butterscotch/patches/0001-include-alloca.h.patch @@ -0,0 +1,41 @@ +From 1ae068333558eec65a11e575d3c08111efd85938 Mon Sep 17 00:00:00 2001 +From: Oskari Alaranta +Date: Mon, 22 Jun 2026 21:21:36 +0300 +Subject: [PATCH] include alloca.h + +--- + src/runner.c | 4 ++++ + vendor/stb/vorbis/stb_vorbis.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/runner.c b/src/runner.c +index 411ccf5..24110c1 100644 +--- a/src/runner.c ++++ b/src/runner.c +@@ -17,6 +17,10 @@ + #include "gettime.h" + #include "stb_ds.h" + ++#ifdef __banan_os__ ++#include ++#endif ++ + // ===[ Runtime Layer Teardown Helpers ]=== + void Runner_freeRuntimeLayer(RuntimeLayer* runtimeLayer) { + free(runtimeLayer->dynamicName); +diff --git a/vendor/stb/vorbis/stb_vorbis.c b/vendor/stb/vorbis/stb_vorbis.c +index 0af6406..d35822e 100644 +--- a/vendor/stb/vorbis/stb_vorbis.c ++++ b/vendor/stb/vorbis/stb_vorbis.c +@@ -588,7 +588,7 @@ enum STBVorbisError + #if defined(_MSC_VER) || defined(__MINGW32__) + #include + #endif +- #if defined(__linux__) || defined(__linux) || defined(__sun__) || defined(__EMSCRIPTEN__) || defined(__NEWLIB__) ++ #if defined(__linux__) || defined(__linux) || defined(__sun__) || defined(__EMSCRIPTEN__) || defined(__NEWLIB__) || defined(__banan_os__) + #include + #endif + #else // STB_VORBIS_NO_CRT +-- +2.54.0 + diff --git a/ports/butterscotch/patches/0002-fix-maybe-used-uninitialized-error.patch b/ports/butterscotch/patches/0002-fix-maybe-used-uninitialized-error.patch new file mode 100644 index 00000000..4d4b0484 --- /dev/null +++ b/ports/butterscotch/patches/0002-fix-maybe-used-uninitialized-error.patch @@ -0,0 +1,25 @@ +From 98fffc5330e51a0dbe25017653d46e15c185dc4b Mon Sep 17 00:00:00 2001 +From: Oskari Alaranta +Date: Mon, 22 Jun 2026 21:24:07 +0300 +Subject: [PATCH] fix maybe used uninitialized error + +--- + src/desktop/backends/sdl2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/desktop/backends/sdl2.c b/src/desktop/backends/sdl2.c +index 91029a6..34716f8 100644 +--- a/src/desktop/backends/sdl2.c ++++ b/src/desktop/backends/sdl2.c +@@ -50,7 +50,7 @@ bool platformGetScaledWindowSize(int32_t* outW, int32_t* outH) { + + static void platformGetWindowScale(float *scale_x, float *scale_y) { + if (!scale_x || !scale_y) return; +- int32_t draw_w, draw_h; ++ int32_t draw_w = 0, draw_h = 0; + int logical_w, logical_h; + platformGetWindowSize(&draw_w, &draw_h); + SDL_GetWindowSize(window, &logical_w, &logical_h); +-- +2.54.0 +