ports: Add butterscotch port

This commit is contained in:
2026-06-22 21:25:04 +03:00
parent e19414a64e
commit aa1b1e1af9
3 changed files with 92 additions and 0 deletions

26
ports/butterscotch/build.sh Executable file
View File

@@ -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
}

View File

@@ -0,0 +1,41 @@
From 1ae068333558eec65a11e575d3c08111efd85938 Mon Sep 17 00:00:00 2001
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
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 <alloca.h>
+#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 <malloc.h>
#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 <alloca.h>
#endif
#else // STB_VORBIS_NO_CRT
--
2.54.0

View File

@@ -0,0 +1,25 @@
From 98fffc5330e51a0dbe25017653d46e15c185dc4b Mon Sep 17 00:00:00 2001
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
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