diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 18b35cfaa36..b82c2ea31e7 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -40,7 +40,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`chocolate-doom`](chocolate-doom/) | Chocolate Doom | 3.0.1 | https://www.chocolate-doom.org/ | | [`chromaprint`](chromaprint/) | chromaprint | 1.5.1 | https://acoustid.org/ | | [`citron`](citron/) | Citron Programming Language | 0.0.9.3 | https://github.com/alimpfard/citron | -| [`ClassiCube`](ClassiCube/) | ClassiCube | 1.3.3 | https://github.com/UnknownShadow200/ClassiCube | +| [`ClassiCube`](ClassiCube/) | ClassiCube | 1.3.6 | https://github.com/UnknownShadow200/ClassiCube | | [`cmake`](cmake/) | CMake | 3.26.4 | https://cmake.org/ | | [`cmatrix`](cmatrix/) | cmatrix | 3112b12 | https://github.com/abishekvashok/cmatrix | | [`composer`](composer/) | Composer | 2.5.8 | https://getcomposer.org/ | diff --git a/Ports/ClassiCube/package.sh b/Ports/ClassiCube/package.sh index 9e1b3f4fec8..99a8d76b47b 100755 --- a/Ports/ClassiCube/package.sh +++ b/Ports/ClassiCube/package.sh @@ -1,11 +1,11 @@ #!/usr/bin/env -S bash ../.port_include.sh port='ClassiCube' -version='1.3.3' +version='1.3.6' files=( - "https://github.com/UnknownShadow200/ClassiCube/archive/refs/tags/${version}.tar.gz#f90acfeb82fd440ead6e086694d99bd1583b0174da1801687c4c3d0fcb21d83d" + "https://github.com/UnknownShadow200/ClassiCube/archive/refs/tags/${version}.tar.gz#fab780f4dcf0669a0f94683c9b6596f40cb83e09727a3b91aaae5e934a9740b0" ) -workdir="${port}-${version}/src/" +workdir="${port}-${version}/" depends=( 'SDL2' 'curl' @@ -15,11 +15,10 @@ launcher_name='ClassiCube' launcher_category='Games' launcher_workdir='/home/anon/Games/ClassiCube' launcher_command='/usr/local/bin/ClassiCube' -icon_file='../misc/CCicon.ico' +icon_file='misc/CCicon.ico' makeopts+=( - 'ClassiCube' - 'PLAT=serenity' + 'PLAT=serenityos' ) install() { diff --git a/Ports/ClassiCube/patches/0001-Add-support-for-SerenityOS.patch b/Ports/ClassiCube/patches/0001-Add-support-for-SerenityOS.patch deleted file mode 100644 index fae8cb315bf..00000000000 --- a/Ports/ClassiCube/patches/0001-Add-support-for-SerenityOS.patch +++ /dev/null @@ -1,161 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: cflip -Date: Fri, 14 Oct 2022 21:28:37 -0600 -Subject: [PATCH] Add support for SerenityOS - ---- - Core.h | 8 ++++++++ - Drawer2D.c | 1 + - Http_Worker.c | 3 +++ - Logger.c | 19 ++++++++++++++++++- - Makefile | 9 ++++++++- - Platform_Posix.c | 6 +++++- - 6 files changed, 43 insertions(+), 3 deletions(-) - -diff --git a/Core.h b/Core.h -index bdefce2fb420bc1d30ab7d1448d2501d6ba247ee..29eb2973727cb4b98bb01fdf02c65240017f86f5 100644 ---- a/Core.h -+++ b/Core.h -@@ -239,6 +239,14 @@ Thus it is **NOT SAFE** to allocate a string on the stack. */ - #define CC_BUILD_CURL - #define CC_BUILD_OPENAL - #define CC_BUILD_SDL -+#elif defined __serenity__ -+#define CC_BUILD_SERENITY -+#define CC_BUILD_POSIX -+#define CC_BUILD_GL -+#define CC_BUILD_GL11 -+#define CC_BUILD_CURL -+#define CC_BUILD_OPENAL -+#define CC_BUILD_SDL - #elif defined __EMSCRIPTEN__ - #define CC_BUILD_WEB - #define CC_BUILD_GL -diff --git a/Drawer2D.c b/Drawer2D.c -index f66b9024aa2b27ea87cf332873d9156fccdc63fe..5bfbdd030c72f2ee9471c7b5444f6499b91ca64b 100644 ---- a/Drawer2D.c -+++ b/Drawer2D.c -@@ -811,6 +811,7 @@ static cc_string font_candidates[] = { - String_FromConst(""), /* replaced with font_default */ - String_FromConst("Arial"), /* preferred font on all platforms */ - String_FromConst("Liberation Sans"), /* ice looking fallbacks for linux */ -+ String_FromConst("Liberation Serif"), - String_FromConst("Nimbus Sans"), - String_FromConst("Bitstream Charter"), - String_FromConst("Cantarell"), -diff --git a/Http_Worker.c b/Http_Worker.c -index 936361eb04a8a5e56820ca827a8e72020da17451..514494fc516960fc17824406a2c49d72cf31f7f4 100644 ---- a/Http_Worker.c -+++ b/Http_Worker.c -@@ -254,6 +254,9 @@ static const cc_string curlAlt = String_FromConst("/usr/pkg/lib/libcurl.so"); - #elif defined CC_BUILD_BSD - static const cc_string curlLib = String_FromConst("libcurl.so"); - static const cc_string curlAlt = String_FromConst("libcurl.so"); -+#elif defined CC_BUILD_SERENITY -+static const cc_string curlLib = String_FromConst("/usr/local/lib/libcurl.so"); -+static const cc_string curlAlt = String_FromConst("/usr/local/lib/libcurl.so"); - #else - static const cc_string curlLib = String_FromConst("libcurl.so.4"); - static const cc_string curlAlt = String_FromConst("libcurl.so.3"); -diff --git a/Logger.c b/Logger.c -index 14ff7d6ab8455294b83bb36fb29ea6994a883c25..4eb3d1d4ad63a24d9030a98c1fc02816369ef728 100644 ---- a/Logger.c -+++ b/Logger.c -@@ -16,7 +16,7 @@ - #define NOIME - #include - #include --#elif defined CC_BUILD_OPENBSD || defined CC_BUILD_HAIKU -+#elif defined CC_BUILD_OPENBSD || defined CC_BUILD_HAIKU || defined CC_BUILD_SERENITY - #include - /* OpenBSD doesn't provide sys/ucontext.h */ - #elif defined CC_BUILD_LINUX || defined CC_BUILD_ANDROID -@@ -343,6 +343,10 @@ void Logger_Backtrace(cc_string* trace, void* ctx) { - } - String_AppendConst(trace, _NL); - } -+#elif defined CC_BUILD_SERENITY -+void Logger_Backtrace(cc_string* trace, void* ctx) { -+ /* FIXME: Implement */ -+} - #elif defined CC_BUILD_POSIX - #include - void Logger_Backtrace(cc_string* trace, void* ctx) { -@@ -667,6 +671,19 @@ static void PrintRegisters(cc_string* str, void* ctx) { - #error "Unknown CPU architecture" - #endif - } -+#elif defined CC_BUILD_SERENITY -+static void PrintRegisters(cc_string* str, void* ctx) { -+ mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext; -+#if defined __i386__ -+ #define REG_GET(reg, ign) &r.e##reg -+ Dump_X86() -+#elif defined __x86_64__ -+ #define REG_GET(reg, ign) &r.r##reg -+ Dump_X64() -+#else -+ #error "Unknown CPU architecture" -+#endif -+} - #endif - static void DumpRegisters(void* ctx) { - cc_string str; char strBuffer[768]; -diff --git a/Makefile b/Makefile -index 6c7152071c94116b4cf3d175fa8bd0c0652b77ff..73d6e386dedd38b9ffd558aa13ce3f0390bd601e 100644 ---- a/Makefile -+++ b/Makefile -@@ -4,7 +4,6 @@ OBJECTS:=$(C_OBJECTS) - ENAME=ClassiCube - DEL=rm - JOBS=1 --CC=cc - CFLAGS=-g -pipe -fno-math-errno - LDFLAGS=-g -rdynamic - -@@ -92,6 +91,12 @@ LDFLAGS=-g - LIBS=-lm -lexecinfo -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker - endif - -+ifeq ($(PLAT),serenity) -+CFLAGS=-g -pipe -fno-math-errno -+LDFLAGS=-g -+LIBS=-lgl -lSDL2 -+endif -+ - ifeq ($(OS),Windows_NT) - DEL=del - endif -@@ -120,6 +125,8 @@ dragonfly: - $(MAKE) $(ENAME) PLAT=dragonfly -j$(JOBS) - haiku: - $(MAKE) $(ENAME) PLAT=haiku -j$(JOBS) -+serenity: -+ $(MAKE) $(ENAME) PLAT=serenity -j$(JOBS) - - clean: - $(DEL) $(OBJECTS) -diff --git a/Platform_Posix.c b/Platform_Posix.c -index 2a410f00d96460decb16bd703caa5163d4e2ff63..31f9cc7e3e60a31e336e025bfefa0865984dc7b8 100644 ---- a/Platform_Posix.c -+++ b/Platform_Posix.c -@@ -445,6 +445,10 @@ void Platform_LoadSysFonts(void) { - static const cc_string dirs[] = { - String_FromConst("/system/data/fonts") - }; -+#elif defined CC_BUILD_SERENITY -+ static const cc_string dirs[] = { -+ String_FromConst("/res/fonts") -+ }; - #elif defined CC_BUILD_DARWIN - static const cc_string dirs[] = { - String_FromConst("/System/Library/Fonts"), -@@ -700,7 +704,7 @@ static cc_result Process_RawGetExePath(char* path, int* len) { - *len = String_CalcLen(path, NATIVE_STR_LEN); - return 0; - } --#elif defined CC_BUILD_LINUX -+#elif defined CC_BUILD_LINUX || defined CC_BUILD_SERENITY - static cc_result Process_RawGetExePath(char* path, int* len) { - *len = readlink("/proc/self/exe", path, NATIVE_STR_LEN); - return *len == -1 ? errno : 0; diff --git a/Ports/ClassiCube/patches/0001-Ignore-warning-with-using-SDL-backend.patch b/Ports/ClassiCube/patches/0001-Ignore-warning-with-using-SDL-backend.patch new file mode 100644 index 00000000000..20854dfc563 --- /dev/null +++ b/Ports/ClassiCube/patches/0001-Ignore-warning-with-using-SDL-backend.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: cflip +Date: Fri, 20 Oct 2023 10:46:47 -0600 +Subject: [PATCH] Ignore warning with using SDL backend + +--- + src/Window_SDL.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/Window_SDL.c b/src/Window_SDL.c +index f1ff58f8550f3546ad14ec2a7311b60a4bfd3faa..6a56bc687cf1fe7bf1f9c42018593ea5fd84e359 100644 +--- a/src/Window_SDL.c ++++ b/src/Window_SDL.c +@@ -9,8 +9,6 @@ + #include + static SDL_Window* win_handle; + +-#error "Some features are missing from the SDL backend. If possible, it is recommended that you use a native windowing backend instead" +- + static void RefreshWindowBounds(void) { + SDL_GetWindowSize(win_handle, &WindowInfo.Width, &WindowInfo.Height); + } diff --git a/Ports/ClassiCube/patches/0002-HACK-Disable-interrupt-hooks.patch b/Ports/ClassiCube/patches/0002-HACK-Disable-interrupt-hooks.patch deleted file mode 100644 index 374054eff0c..00000000000 --- a/Ports/ClassiCube/patches/0002-HACK-Disable-interrupt-hooks.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: cflip -Date: Sat, 15 Oct 2022 15:29:44 -0600 -Subject: [PATCH] HACK: Disable interrupt hooks - -This allows crashes to be handled by Serenity's crash handler, which -automatically displays debugging information such as the backtrace. ---- - Program.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/Program.c b/Program.c -index 3b210522036a51a8f4a9fece8b5b2e20be79a7aa..f3c9fd895ef163cad75dce4b566676bc83546767 100644 ---- a/Program.c -+++ b/Program.c -@@ -55,7 +55,6 @@ CC_NOINLINE static void WarnMissingArgs(int argsCount, const cc_string* args) { - static void SetupProgram(int argc, char** argv) { - static char ipBuffer[STRING_SIZE]; - cc_result res; -- Logger_Hook(); - Platform_Init(); - res = Platform_SetDefaultCurrentDirectory(argc, argv); - diff --git a/Ports/ClassiCube/patches/ReadMe.md b/Ports/ClassiCube/patches/ReadMe.md index 4e949329b84..e2075b17bb5 100644 --- a/Ports/ClassiCube/patches/ReadMe.md +++ b/Ports/ClassiCube/patches/ReadMe.md @@ -1,14 +1,7 @@ # Patches for ClassiCube on SerenityOS -## `0001-Add-support-for-SerenityOS.patch` +## `0001-Ignore-warning-with-using-SDL-backend.patch` -Add support for SerenityOS +Ignore warning with using SDL backend -## `0002-HACK-Disable-interrupt-hooks.patch` - -HACK: Disable interrupt hooks - -This allows crashes to be handled by Serenity's crash handler, which -automatically displays debugging information such as the backtrace. -