From 4425755cf5c8a9fce54ecf76da2f5058bbb77745 Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 22 Sep 2026 02:02:05 -0300 Subject: [PATCH] classicube: port --- patches/classicube/jinx-working-patch.patch | 39 +++++++++++++++++++++ recipes/classicube | 22 ++++++++++++ source-recipes/classicube | 4 +++ 3 files changed, 65 insertions(+) create mode 100644 patches/classicube/jinx-working-patch.patch create mode 100644 recipes/classicube create mode 100644 source-recipes/classicube diff --git a/patches/classicube/jinx-working-patch.patch b/patches/classicube/jinx-working-patch.patch new file mode 100644 index 00000000..fc03d263 --- /dev/null +++ b/patches/classicube/jinx-working-patch.patch @@ -0,0 +1,39 @@ +diff --git classicube-clean/misc/makefiles/linux.mk classicube-workdir/misc/makefiles/linux.mk +index a3e3e068..676adcca 100644 +--- classicube-clean/misc/makefiles/linux.mk ++++ classicube-workdir/misc/makefiles/linux.mk +@@ -10,6 +10,13 @@ TARGET := ClassiCube + DIST_NAME := ClassiCube + + CFLAGS := -fvisibility=hidden -fno-ident ++CFLAGS += -DCC_BUILD_ASTRAL -DCC_BUILD_LINUX -DCC_BUILD_POSIX -DCC_BUILD_XINPUT2 \ ++ -DDEFAULT_NET_BACKEND=CC_NET_BACKEND_BUILTIN \ ++ -DDEFAULT_SSL_BACKEND=CC_SSL_BACKEND_BEARSSL \ ++ -DDEFAULT_CRT_BACKEND=CC_CRT_BACKEND_OPENSSL \ ++ -DDEFAULT_AUD_BACKEND=CC_AUD_BACKEND_OPENAL \ ++ -DDEFAULT_GFX_BACKEND=CC_GFX_BACKEND_GL1 \ ++ -DDEFAULT_WIN_BACKEND=CC_WIN_BACKEND_X11 + LDFLAGS := -rdynamic + # -lm may be needed for __builtin_sqrtf (in cases where it isn't replaced by a CPU instruction intrinsic) + LIBS := -lX11 -lXi -lpthread -lGL -ldl -lm +diff --git classicube-clean/src/Platform_Posix.c classicube-workdir/src/Platform_Posix.c +index 614de99a..94af4e8e 100644 +--- classicube-clean/src/Platform_Posix.c ++++ classicube-workdir/src/Platform_Posix.c +@@ -1055,7 +1055,15 @@ cc_result Process_StartOpen(const cc_string* args) { + #endif + + /* Retrieving exe path is completely OS dependant */ +-#if defined CC_BUILD_MACOS ++#if defined CC_BUILD_ASTRAL ++static cc_result Process_RawGetExePath(char* path, int* len) { ++ static const char exePath[] = "/usr/bin/classicube"; ++ ++ *len = sizeof(exePath) - 1; ++ Mem_Copy(path, exePath, *len); ++ return 0; ++} ++#elif defined CC_BUILD_MACOS + static cc_result Process_RawGetExePath(char* path, int* len) { + Mem_Set(path, '\0', NATIVE_STR_LEN); + cc_uint32 size = NATIVE_STR_LEN; diff --git a/recipes/classicube b/recipes/classicube new file mode 100644 index 00000000..23023573 --- /dev/null +++ b/recipes/classicube @@ -0,0 +1,22 @@ +name=classicube +revision=2 +from_source=classicube +imagedeps="build-essential" +hostdeps="xgcc xbinutils pkgconfig" +deps="base sdl2 mesa openal" + +configure() { + cp -rp ${source_dir}/* . +} + +build() { + make -j${parallelism} sdl2 \ + CC=x86_64-astral-gcc \ + EXTRA_CFLAGS="-Wno-error=implicit-function-declaration" \ + RELEASE=1 +} + +package() { + mkdir -p ${dest_dir}/usr/bin + cp -f ClassiCube ${dest_dir}/usr/bin/classicube +} diff --git a/source-recipes/classicube b/source-recipes/classicube new file mode 100644 index 00000000..4ddb17b4 --- /dev/null +++ b/source-recipes/classicube @@ -0,0 +1,4 @@ +name=classicube +version=abae0c0c0239198db475620ccfbd5590129fcde8 +git_url="https://github.com/ClassiCube/ClassiCube.git" +commit=abae0c0c0239198db475620ccfbd5590129fcde8