From 7b7730cc229ccc36099c5b013f8ec8ea5d21ca9e Mon Sep 17 00:00:00 2001 From: SpidFightFR Date: Sun, 11 Feb 2024 14:07:35 +0100 Subject: [PATCH] New package: vkdoom-0.9 --- srcpkgs/vkdoom/patches/vkdoom-fix-build.patch | 15 +++ .../patches/vkdoom-fix-musl-build.patch | 110 ++++++++++++++++++ srcpkgs/vkdoom/patches/vkdoom-fix-pk3.patch | 22 ++++ srcpkgs/vkdoom/template | 18 +++ 4 files changed, 165 insertions(+) create mode 100755 srcpkgs/vkdoom/patches/vkdoom-fix-build.patch create mode 100644 srcpkgs/vkdoom/patches/vkdoom-fix-musl-build.patch create mode 100755 srcpkgs/vkdoom/patches/vkdoom-fix-pk3.patch create mode 100755 srcpkgs/vkdoom/template diff --git a/srcpkgs/vkdoom/patches/vkdoom-fix-build.patch b/srcpkgs/vkdoom/patches/vkdoom-fix-build.patch new file mode 100755 index 00000000000000..f25d3971684f6a --- /dev/null +++ b/srcpkgs/vkdoom/patches/vkdoom-fix-build.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 76c3584..d933da6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -277,7 +277,9 @@ else() + include ( FindPkgConfig ) + pkg_check_modules( MUSL_FTS musl-fts ) + if ( MUSL_FTS_FOUND ) +- set ( ALL_C_FLAGS "${ALL_C_FLAGS} ${MUSL_FTS_LDFLAGS}" ) ++ foreach(flags IN LISTS MUSL_FTS_LDFLAGS) ++ set ( ALL_C_FLAGS "${ALL_C_FLAGS} ${flags}" ) ++ endforeach() + else ( MUSL_FTS_FOUND ) + message (ERROR "fts_* functions not found in the system" ) + endif ( MUSL_FTS_FOUND ) diff --git a/srcpkgs/vkdoom/patches/vkdoom-fix-musl-build.patch b/srcpkgs/vkdoom/patches/vkdoom-fix-musl-build.patch new file mode 100644 index 00000000000000..edbfed395f6ae6 --- /dev/null +++ b/srcpkgs/vkdoom/patches/vkdoom-fix-musl-build.patch @@ -0,0 +1,110 @@ +diff --git a/libraries/lzma/C/Threads.c b/libraries/lzma/C/Threads.c +index cf52bd3..86a5cee 100644 +--- a/libraries/lzma/C/Threads.c ++++ b/libraries/lzma/C/Threads.c +@@ -67,12 +67,12 @@ WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param) + + DWORD threadId; + *p = CreateThread(NULL, 0, func, param, 0, &threadId); +- ++ + #else +- ++ + unsigned threadId; + *p = (HANDLE)(_beginthreadex(NULL, 0, func, param, 0, &threadId)); +- ++ + #endif + + /* maybe we must use errno here, but probably GetLastError() is also OK. */ +@@ -86,9 +86,9 @@ WRes Thread_Create_With_Affinity(CThread *p, THREAD_FUNC_TYPE func, LPVOID param + + UNUSED_VAR(affinity) + return Thread_Create(p, func, param); +- ++ + #else +- ++ + /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */ + HANDLE h; + WRes wres; +@@ -245,7 +245,7 @@ WRes Thread_Create_With_CpuSet(CThread *p, THREAD_FUNC_TYPE func, LPVOID param, + if (cpuSet) + { + #ifdef Z7_AFFINITY_SUPPORTED +- ++ + /* + printf("\n affinity :"); + unsigned i; +@@ -265,13 +265,13 @@ WRes Thread_Create_With_CpuSet(CThread *p, THREAD_FUNC_TYPE func, LPVOID param, + */ + + // ret2 = +- pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet); ++ pthread_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet); + // if (ret2) ret = ret2; + #endif + } +- ++ + ret = pthread_create(&p->_tid, &attr, func, param); +- ++ + if (!ret) + { + p->_created = 1; +@@ -324,7 +324,7 @@ WRes Thread_Close(CThread *p) + int ret; + if (!p->_created) + return 0; +- ++ + ret = pthread_detach(p->_tid); + p->_tid = 0; + p->_created = 0; +@@ -384,7 +384,7 @@ WRes Event_Reset(CEvent *p) + p->_state = False; + return pthread_mutex_unlock(&p->_mutex); + } +- ++ + WRes Event_Wait(CEvent *p) + { + RINOK(pthread_mutex_lock(&p->_mutex)) +diff --git a/libraries/lzma/C/Threads.h b/libraries/lzma/C/Threads.h +index 4028464..86b0687 100644 +--- a/libraries/lzma/C/Threads.h ++++ b/libraries/lzma/C/Threads.h +@@ -4,6 +4,10 @@ + #ifndef ZIP7_INC_THREADS_H + #define ZIP7_INC_THREADS_H + ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE /* Required for musl to expose cpu_set_t */ ++#endif ++ + #ifdef _WIN32 + #include "7zWindows.h" + +@@ -108,15 +112,15 @@ typedef UInt64 CCpuSet; + But only root function main() contains instructions that + set 16-byte alignment for stack pointer. And another functions + just keep alignment, if it was set in some parent function. +- ++ + The problem: + if we create new thread in MinGW (GCC) 32-bit x86 via _beginthreadex() or CreateThread(), + the root function of thread doesn't set 16-byte alignment. + And stack frames in all child functions also will be unaligned in that case. +- ++ + Here we set (force_align_arg_pointer) attribute for root function of new thread. + Do we need (force_align_arg_pointer) also for another systems? */ +- ++ + #define THREAD_FUNC_ATTRIB_ALIGN_ARG __attribute__((force_align_arg_pointer)) + // #define THREAD_FUNC_ATTRIB_ALIGN_ARG // for debug : bad alignment in SSE functions + #else diff --git a/srcpkgs/vkdoom/patches/vkdoom-fix-pk3.patch b/srcpkgs/vkdoom/patches/vkdoom-fix-pk3.patch new file mode 100755 index 00000000000000..08494c1ba5a690 --- /dev/null +++ b/srcpkgs/vkdoom/patches/vkdoom-fix-pk3.patch @@ -0,0 +1,22 @@ +diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp +index a054d59..6fe82e1 100644 +--- a/src/gameconfigfile.cpp ++++ b/src/gameconfigfile.cpp +@@ -123,6 +123,8 @@ FGameConfigFile::FGameConfigFile () + SetValueForKey ("Path", "/usr/local/share/doom", true); + SetValueForKey ("Path", "/usr/local/share/games/doom", true); + SetValueForKey ("Path", "/usr/share/doom", true); ++ // Adds the correct locations of the pk3file for Voidlinux ++ SetValueForKey ("Path", "/usr/share/vkdoom", true); + SetValueForKey ("Path", "/usr/share/games/doom", true); + #endif + } +@@ -145,6 +147,8 @@ FGameConfigFile::FGameConfigFile () + SetValueForKey ("Path", "/usr/local/share/doom", true); + SetValueForKey ("Path", "/usr/local/share/games/doom", true); + SetValueForKey ("Path", "/usr/share/doom", true); ++ // Adds the correct locations of the pk3file for Voidlinux ++ SetValueForKey ("Path", "/usr/share/vkdoom", true); + SetValueForKey ("Path", "/usr/share/games/doom", true); + #endif + SetValueForKey ("Path", "$DOOMWADDIR", true); diff --git a/srcpkgs/vkdoom/template b/srcpkgs/vkdoom/template new file mode 100755 index 00000000000000..7120c1e1d10bf4 --- /dev/null +++ b/srcpkgs/vkdoom/template @@ -0,0 +1,18 @@ +# Template file for 'vkdoom' +pkgname=vkdoom +version=0.9 +revision=1 +_dev_tag=nightly +archs="~i686* ~arm*" +build_style=cmake +configure_args="-DINSTALL_PK3_PATH=share/vkdoom -DDYN_GTK=OFF -DDYN_OPENAL=OFF" +hostmakedepends="pkg-config tar xz" +makedepends="SDL2-devel gtk+3-devel libgomp-devel ZMusic-devel libopenal-devel libvpx-devel libwebp-devel" +short_desc="Advanced Doom source port focused around Vulkan and modern computers" +maintainer="SpidFightFR " +license="GPL-3.0-or-later" +homepage="https://vkdoom.org/" +distfiles="https://github.com/dpjudas/VkDoom/archive/${_dev_tag}.tar.gz" +checksum="469c4374ee15375cc107252def94cda30bd6b01b220c1dae878530c3112e206e" +conflicts="gzdoom" +nocross=yes