From d4fc164422b2483b8328744b4b30eed26e2dfce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 23 Sep 2022 18:45:21 +0700 Subject: [PATCH 1/5] renderdoc: update to 1.21. --- .../renderdoc/patches/add-x86-family.patch | 8 +- srcpkgs/renderdoc/patches/atomic.patch | 4 +- srcpkgs/renderdoc/patches/backtrace.patch | 14 +++ .../patches/build-type-none-is-release.patch | 6 +- srcpkgs/renderdoc/patches/c++14-needed.patch | 8 +- .../patches/compressonator-only-x86.patch | 8 +- srcpkgs/renderdoc/patches/dostringise.patch | 4 +- srcpkgs/renderdoc/patches/musl.patch | 98 +++++++++++++++++++ .../renderdoc/patches/ptrace-only-x86.patch | 8 +- srcpkgs/renderdoc/patches/python-3.11.patch | 85 ++++++++++++++++ .../renderdoc/patches/qmake-no-rpath.patch | 4 +- srcpkgs/renderdoc/patches/time_t.patch | 10 ++ .../renderdoc/patches/unvendor-zstd-lz4.patch | 19 ++-- srcpkgs/renderdoc/template | 31 ++++-- 14 files changed, 258 insertions(+), 49 deletions(-) create mode 100644 srcpkgs/renderdoc/patches/backtrace.patch create mode 100644 srcpkgs/renderdoc/patches/musl.patch create mode 100644 srcpkgs/renderdoc/patches/python-3.11.patch create mode 100644 srcpkgs/renderdoc/patches/time_t.patch diff --git a/srcpkgs/renderdoc/patches/add-x86-family.patch b/srcpkgs/renderdoc/patches/add-x86-family.patch index 80e24cd9b7ed..18ba74b5bf90 100644 --- a/srcpkgs/renderdoc/patches/add-x86-family.patch +++ b/srcpkgs/renderdoc/patches/add-x86-family.patch @@ -14,13 +14,11 @@ Signed-off-by: Jordan Justen renderdoc/common/globalconfig.h | 10 ++++++++++ 2 files changed, 18 insertions(+) -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7ee30d4..d2edf3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -89,6 +89,14 @@ set(RENDERDOC_APK_PATH "" CACHE STRING "Path to RenderDoc .apk files after insta - set(LIB_SUFFIX "" CACHE STRING "Suffix for 'lib' folder in target directory structure. E.g. set to '64' to use /usr/local/lib64 instead of /usr/local/lib.") +@@ -98,6 +98,14 @@ set(LIB_SUFFIX "" CACHE STRING "Suffix f set(LIB_SUBFOLDER "" CACHE STRING "Subfolder under the 'lib' folder in target directory structure. E.g. set to 'renderdoc' to use /usr/local/lib/renderdoc instead of /usr/local/lib.") + set(VULKAN_JSON_SUFFIX "" CACHE STRING "Suffix for the vulkan implicit_layer json file. E.g. set to '.x86_64' to use renderdoc_capture.x86_64.json instead of renderdoc_capture.json") +if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR + CMAKE_SYSTEM_PROCESSOR MATCHES "i686") @@ -33,8 +31,6 @@ index 7ee30d4..d2edf3d 100644 if(NOT LIB_SUFFIX STREQUAL "") add_definitions(-DRENDERDOC_LIB_SUFFIX=${LIB_SUFFIX}) endif() -diff --git a/renderdoc/common/globalconfig.h b/renderdoc/common/globalconfig.h -index d266166..d21da15 100644 --- a/renderdoc/common/globalconfig.h +++ b/renderdoc/common/globalconfig.h @@ -125,6 +125,16 @@ diff --git a/srcpkgs/renderdoc/patches/atomic.patch b/srcpkgs/renderdoc/patches/atomic.patch index 1935b1e4d77d..7e454fa369b4 100644 --- a/srcpkgs/renderdoc/patches/atomic.patch +++ b/srcpkgs/renderdoc/patches/atomic.patch @@ -3,11 +3,11 @@ so we can use libatomic on targets without atomic8 support --- a/renderdoc/CMakeLists.txt +++ b/renderdoc/CMakeLists.txt -@@ -55,6 +55,10 @@ elseif(UNIX) +@@ -59,6 +59,10 @@ elseif(UNIX) PRIVATE -ldl PRIVATE -lrt) -+option(NEED_LIBATOMIC "need libatomic" OFF) ++option(NEED_LIBATOMIC "need libatomic" OFF) +if (NEED_LIBATOMIC) +list(APPEND RDOC_LIBRARIES PRIVATE -latomic) +endif() diff --git a/srcpkgs/renderdoc/patches/backtrace.patch b/srcpkgs/renderdoc/patches/backtrace.patch new file mode 100644 index 000000000000..9baf6d353e47 --- /dev/null +++ b/srcpkgs/renderdoc/patches/backtrace.patch @@ -0,0 +1,14 @@ +--- a/renderdoc/CMakeLists.txt ++++ b/renderdoc/CMakeLists.txt +@@ -54,6 +54,11 @@ elseif(UNIX) + find_package(PkgConfig REQUIRED) + find_package(Threads REQUIRED) + ++ option(NEED_LIBEXECINFO "need libexecinfo" OFF) ++ if (NEED_LIBEXECINFO) ++ list(APPEND RDOC_LIBRARIES PRIVATE -lexecinfo) ++ endif() ++ + list(APPEND RDOC_LIBRARIES + PRIVATE -lm + PRIVATE -ldl diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch index 556ec9d13862..edb33d5775b3 100644 --- a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch +++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch @@ -1,12 +1,10 @@ -Index: CMakeLists.txt -=================================================================== --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -315,6 +315,7 @@ set(RELEASE_MODE 0) +@@ -346,6 +346,7 @@ set(RELEASE_MODE 0) if(cmake_build_type_lower STREQUAL "release" OR cmake_build_type_lower STREQUAL "relwithdebinfo" OR + cmake_build_type_lower STREQUAL "none" OR cmake_build_type_lower STREQUAL "minsizerel") - add_definitions(-D_RELEASE) + add_definitions(-DRELEASE) message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}") diff --git a/srcpkgs/renderdoc/patches/c++14-needed.patch b/srcpkgs/renderdoc/patches/c++14-needed.patch index 5899f555a952..17f623ec8dee 100644 --- a/srcpkgs/renderdoc/patches/c++14-needed.patch +++ b/srcpkgs/renderdoc/patches/c++14-needed.patch @@ -1,8 +1,6 @@ -Index: renderdoc-1.12/CMakeLists.txt -=================================================================== ---- renderdoc-1.12.orig/CMakeLists.txt -+++ renderdoc-1.12/CMakeLists.txt -@@ -323,7 +323,7 @@ if(cmake_build_type_lower STREQUAL "rele +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -371,7 +371,7 @@ if(STRIP_ANDROID_LIBRARY AND BUILD_ANDRO endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") diff --git a/srcpkgs/renderdoc/patches/compressonator-only-x86.patch b/srcpkgs/renderdoc/patches/compressonator-only-x86.patch index 9554123ddf9d..aad50bea773a 100644 --- a/srcpkgs/renderdoc/patches/compressonator-only-x86.patch +++ b/srcpkgs/renderdoc/patches/compressonator-only-x86.patch @@ -8,11 +8,9 @@ Signed-off-by: Jordan Justen renderdoc/replay/replay_driver.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt -index e3e8c28..59c8937 100644 --- a/renderdoc/CMakeLists.txt +++ b/renderdoc/CMakeLists.txt -@@ -342,7 +342,7 @@ elseif(UNIX) +@@ -355,7 +355,7 @@ elseif(UNIX) os/posix/posix_specific.h) endif() @@ -21,11 +19,9 @@ index e3e8c28..59c8937 100644 list(APPEND sources 3rdparty/compressonator/BC1_Encode_kernel.cpp 3rdparty/compressonator/BC2_Encode_kernel.cpp -diff --git a/renderdoc/replay/replay_driver.cpp b/renderdoc/replay/replay_driver.cpp -index a704726..7f3387f 100644 --- a/renderdoc/replay/replay_driver.cpp +++ b/renderdoc/replay/replay_driver.cpp -@@ -1430,8 +1430,8 @@ bytebuf GetDiscardPattern(DiscardType type, const ResourceFormat &fmt, uint32_t +@@ -1647,8 +1647,8 @@ bytebuf GetDiscardPattern(DiscardType ty fmt.type == ResourceFormatType::BC5 || fmt.type == ResourceFormatType::BC6 || fmt.type == ResourceFormatType::BC7) { diff --git a/srcpkgs/renderdoc/patches/dostringise.patch b/srcpkgs/renderdoc/patches/dostringise.patch index 637bd2e47c13..db98ec7874a0 100644 --- a/srcpkgs/renderdoc/patches/dostringise.patch +++ b/srcpkgs/renderdoc/patches/dostringise.patch @@ -12,11 +12,9 @@ Signed-off-by: Jordan Justen renderdoc/serialise/serialiser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) -diff --git a/renderdoc/serialise/serialiser.cpp b/renderdoc/serialise/serialiser.cpp -index 460a310..9e53fb1 100644 --- a/renderdoc/serialise/serialiser.cpp +++ b/renderdoc/serialise/serialiser.cpp -@@ -937,6 +937,14 @@ rdcstr DoStringise(const int16_t &el) +@@ -985,6 +985,14 @@ rdcstr DoStringise(const int16_t &el) return StringFormat::Fmt("%hd", el); } diff --git a/srcpkgs/renderdoc/patches/musl.patch b/srcpkgs/renderdoc/patches/musl.patch new file mode 100644 index 000000000000..a39cca6f52bc --- /dev/null +++ b/srcpkgs/renderdoc/patches/musl.patch @@ -0,0 +1,98 @@ +--- a/renderdoc/os/posix/linux/linux_hook.cpp ++++ b/renderdoc/os/posix/linux/linux_hook.cpp +@@ -70,8 +70,10 @@ __attribute__((visibility("default"))) v + + void *ret = passthru(filename, flag); + ++#ifdef __GLIBC__ + if(filename && ret && (flag & RTLD_DEEPBIND)) + plthook_lib(ret); ++#endif + + return ret; + } +@@ -506,8 +508,10 @@ void *intercept_dlopen(const char *filen + if(filename == NULL) + return ret; + ++#ifdef __GLIBC__ + if(flag & RTLD_DEEPBIND) + plthook_lib(ret); ++#endif + + rdcstr base = get_basename(filename); + +--- a/renderdoc/3rdparty/plthook/plthook_elf.c ++++ b/renderdoc/3rdparty/plthook/plthook_elf.c +@@ -62,7 +62,7 @@ + #include + #include "plthook.h" + +-#if defined __UCLIBC__ && !defined RTLD_NOLOAD ++#if !defined(__GLIBC__) && !defined(RTLD_NOLOAD) + #define RTLD_NOLOAD 0 + #endif + +@@ -204,7 +204,7 @@ static int check_elf_header(const Elf_Eh + #endif + static void set_errmsg(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); + +-#if defined __ANDROID__ || defined __UCLIBC__ ++#if defined(__linux__) && !defined(__GLIBC__) + struct dl_iterate_data { + char* addr; + struct link_map lmap; +@@ -249,7 +249,7 @@ int plthook_open(plthook_t **plthook_out + + int plthook_open_by_handle(plthook_t **plthook_out, void *hndl) + { +-#if defined __ANDROID__ || defined __UCLIBC__ ++#if defined (__linux__) && !defined(__GLIBC__) + const static char *symbols[] = { + "__INIT_ARRAY__", + "_end", +@@ -288,7 +288,7 @@ int plthook_open_by_address(plthook_t ** + { + #if defined __FreeBSD__ + return PLTHOOK_NOT_IMPLEMENTED; +-#elif defined __ANDROID__ || defined __UCLIBC__ ++#elif defined(__linux__) && !defined(__GLIBC__) + struct dl_iterate_data data = {0,}; + data.addr = address; + dl_iterate_phdr(dl_iterate_cb, &data); +@@ -312,7 +312,7 @@ int plthook_open_by_address(plthook_t ** + + static int plthook_open_executable(plthook_t **plthook_out) + { +-#if defined __ANDROID__ || defined __UCLIBC__ ++#if defined(__linux__) && !defined(__GLIBC__) + return plthook_open_shared_library(plthook_out, NULL); + #elif defined __linux__ + return plthook_open_real(plthook_out, _r_debug.r_map); +@@ -351,7 +351,7 @@ static int plthook_open_executable(pltho + static int plthook_open_shared_library(plthook_t **plthook_out, const char *filename) + { + void *hndl = dlopen(filename, RTLD_LAZY | RTLD_NOLOAD); +-#if defined __ANDROID__ || defined __UCLIBC__ ++#if defined(__linux__) && !defined(__GLIBC__) + int rv; + #else + struct link_map *lmap = NULL; +@@ -361,7 +361,7 @@ static int plthook_open_shared_library(p + set_errmsg("dlopen error: %s", dlerror()); + return PLTHOOK_FILE_NOT_FOUND; + } +-#if defined __ANDROID__ || defined __UCLIBC__ ++#if defined(__linux__) && !defined(__GLIBC__) + rv = plthook_open_by_handle(plthook_out, hndl); + dlclose(hndl); + return rv; +@@ -553,7 +553,7 @@ static int plthook_open_real(plthook_t * + + #if defined __linux__ + plthook.plt_addr_base = (char*)lmap->l_addr; +-#if defined __ANDROID__ || defined __UCLIBC__ ++#if !defined(__GLIBC__) + dyn_addr_base = (const char*)lmap->l_addr; + #endif + #elif defined __FreeBSD__ || defined __sun diff --git a/srcpkgs/renderdoc/patches/ptrace-only-x86.patch b/srcpkgs/renderdoc/patches/ptrace-only-x86.patch index dce7ef7c730a..84135ffb7095 100644 --- a/srcpkgs/renderdoc/patches/ptrace-only-x86.patch +++ b/srcpkgs/renderdoc/patches/ptrace-only-x86.patch @@ -14,11 +14,9 @@ Signed-off-by: Jordan Justen renderdoc/os/posix/linux/linux_process.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) -diff --git a/renderdoc/os/posix/linux/linux_process.cpp b/renderdoc/os/posix/linux/linux_process.cpp -index 7db273f..491268d 100644 --- a/renderdoc/os/posix/linux/linux_process.cpp +++ b/renderdoc/os/posix/linux/linux_process.cpp -@@ -50,6 +50,8 @@ extern char **environ; +@@ -55,6 +55,8 @@ extern char **environ; #define INITIAL_WAIT_TIME 1 #define MAX_WAIT_TIME 0xfffff @@ -27,7 +25,7 @@ index 7db273f..491268d 100644 char **GetCurrentEnvironment() { return environ; -@@ -150,6 +152,8 @@ int GetIdentPort(pid_t childPid) +@@ -155,6 +157,8 @@ int GetIdentPort(pid_t childPid) return ret; } @@ -36,7 +34,7 @@ index 7db273f..491268d 100644 static bool ptrace_scope_ok() { if(!Linux_PtraceChildProcesses()) -@@ -577,6 +581,23 @@ void ResumeProcess(pid_t childPid, uint32_t delaySeconds) +@@ -617,6 +621,23 @@ void ResumeProcess(pid_t childPid, uint3 } } diff --git a/srcpkgs/renderdoc/patches/python-3.11.patch b/srcpkgs/renderdoc/patches/python-3.11.patch new file mode 100644 index 000000000000..93807f6fe265 --- /dev/null +++ b/srcpkgs/renderdoc/patches/python-3.11.patch @@ -0,0 +1,85 @@ +--- a/qrenderdoc/Code/pyrenderdoc/function_conversion.h ++++ b/qrenderdoc/Code/pyrenderdoc/function_conversion.h +@@ -303,11 +303,19 @@ funcType ConvertFunc(const char *funcnam + + while(frame) + { ++#if PY_VERSION_HEX >= 0x030B0000 ++ global_internal_handle = PyDict_GetItemString(PyFrame_GetGlobals(frame), "_renderdoc_internal"); ++#else + global_internal_handle = PyDict_GetItemString(frame->f_globals, "_renderdoc_internal"); ++#endif + + if(global_internal_handle) + break; ++#if PY_VERSION_HEX >= 0x03090000 ++ frame = PyFrame_GetBack(frame); ++#else + frame = frame->f_back; ++#endif + } + } + +--- a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp ++++ b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp +@@ -85,6 +85,15 @@ extern "C" PyObject *PyInit_qrenderdoc(v + extern "C" PyObject *WrapBareQWidget(QWidget *); + extern "C" QWidget *UnwrapBareQWidget(PyObject *); + ++#if PY_VERSION_HEX <=0x030B0000 ++#define PyFrame_GetGlobals(x) (x)->f_globals ++#endif ++ ++#if PY_VERSION_HEX <=0x03090000 ++#define PyFrame_GetBack(x) (x)->f_back ++#define PyFrame_GetCode(x) (x)->f_code ++#endif ++ + // little utility function to convert a PyObject * that we know is a string to a QString + static inline QString ToQStr(PyObject *value) + { +@@ -1213,7 +1222,7 @@ PyObject *PythonContext::outstream_write + + while(frame) + { +- PyObject *globals = frame->f_globals; ++ PyObject *globals = PyFrame_GetGlobals(frame); + if(globals) + { + OutputRedirector *global = +@@ -1225,7 +1234,7 @@ PyObject *PythonContext::outstream_write + if(context) + break; + +- frame = frame->f_back; ++ frame = PyFrame_GetBack(frame); + } + } + +@@ -1248,7 +1257,7 @@ PyObject *PythonContext::outstream_write + + if(frame) + { +- filename = ToQStr(frame->f_code->co_filename); ++ filename = ToQStr(PyFrame_GetCode(frame)->co_filename); + line = PyFrame_GetLineNumber(frame); + } + +@@ -1278,7 +1287,7 @@ int PythonContext::traceEvent(PyObject * + PythonContext *context = (PythonContext *)thisint; + + PyObject *compiled = PyDict_GetItemString(obj, "compiled"); +- if(compiled == (PyObject *)frame->f_code && what == PyTrace_LINE) ++ if(compiled == (PyObject *)PyFrame_GetCode(frame) && what == PyTrace_LINE) + { + context->location.line = PyFrame_GetLineNumber(frame); + +@@ -1361,7 +1370,7 @@ extern "C" void HandleException(PyObject + + if(frame) + { +- filename = ToQStr(frame->f_code->co_filename); ++ filename = ToQStr(PyFrame_GetCode(frame)->co_filename); + linenum = PyFrame_GetLineNumber(frame); + } + diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch index a80df310b1a4..4daa756a050c 100644 --- a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch +++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch @@ -1,8 +1,6 @@ -Index: qrenderdoc/CMakeLists.txt -=================================================================== --- a/qrenderdoc/CMakeLists.txt +++ b/qrenderdoc/CMakeLists.txt -@@ -144,7 +144,7 @@ endif() +@@ -174,7 +174,7 @@ endif() # and finding dependencies from the cmake build file(WRITE ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri diff --git a/srcpkgs/renderdoc/patches/time_t.patch b/srcpkgs/renderdoc/patches/time_t.patch new file mode 100644 index 000000000000..cbf675e63533 --- /dev/null +++ b/srcpkgs/renderdoc/patches/time_t.patch @@ -0,0 +1,10 @@ +--- a/renderdoc/os/os_specific.h ++++ b/renderdoc/os/os_specific.h +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include "api/replay/rdcarray.h" + #include "api/replay/rdcpair.h" diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch index 2c6d41cd604e..7ab0c79a0e9c 100644 --- a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch +++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch @@ -1,13 +1,16 @@ -Index: renderdoc/CMakeLists.txt -=================================================================== --- a/renderdoc/CMakeLists.txt +++ b/renderdoc/CMakeLists.txt -@@ -213,54 +213,10 @@ set(sources - 3rdparty/pugixml/pugixml.cpp - 3rdparty/pugixml/pugixml.hpp - 3rdparty/pugixml/pugiconfig.hpp +@@ -225,59 +225,12 @@ set(sources + 3rdparty/aosp/android_manifest.h + 3rdparty/catch/catch.cpp + 3rdparty/catch/catch.hpp +- 3rdparty/pugixml/pugixml.cpp +- 3rdparty/pugixml/pugixml.hpp +- 3rdparty/pugixml/pugiconfig.hpp - 3rdparty/lz4/lz4.c - 3rdparty/lz4/lz4.h + 3rdparty/md5/md5.c + 3rdparty/md5/md5.h 3rdparty/miniz/miniz.c 3rdparty/miniz/miniz.h 3rdparty/superluminal/superluminal.cpp @@ -57,11 +60,11 @@ Index: renderdoc/CMakeLists.txt 3rdparty/stb/stb_image.h 3rdparty/stb/stb_image_write.h 3rdparty/stb/stb_image_resize.h -@@ -271,6 +227,8 @@ set(sources +@@ -288,6 +241,8 @@ set(sources 3rdparty/tinyfiledialogs/tinyfiledialogs.c 3rdparty/tinyfiledialogs/tinyfiledialogs.h) -+list(APPEND RDOC_LIBRARIES -llz4 -lzstd) ++list(APPEND RDOC_LIBRARIES -lpugixml -llz4 -lzstd) + if(ANDROID) list(APPEND sources diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template index 59d1061c8647..ac4d1caa6ba6 100644 --- a/srcpkgs/renderdoc/template +++ b/srcpkgs/renderdoc/template @@ -1,26 +1,36 @@ # Template file for 'renderdoc' pkgname=renderdoc -version=1.12 -revision=3 +version=1.21 +_plt_ver=dbadbe14d601913b81a4a7533b284b6ccd7351d8 +revision=1 build_style=cmake configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON + -DBUILD_VERSION_STABLE=ON -DBUILD_VERSION_DIST_NAME=VoidLinux + -DBUILD_VERSION_DIST_CONTACT=https://voidlinux.org -DENABLE_PYRENDERDOC=ON" hostmakedepends="bison autoconf automake pkg-config python3 swig" makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel - libzstd-devel liblz4-devel + libzstd-devel liblz4-devel pugixml-devel qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel" short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL" maintainer="Urs Schulz " license="MIT" homepage="https://github.com/baldurk/renderdoc" -distfiles="https://github.com/baldurk/${pkgname}/archive/v${version}.tar.gz" -checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb +distfiles="https://github.com/baldurk/${pkgname}/archive/v${version}.tar.gz + https://raw.githubusercontent.com/kubo/plthook/${_plt_ver}/plthook.h + https://raw.githubusercontent.com/kubo/plthook/${_plt_ver}/plthook_elf.c + " +checksum="7c12546857ffd4521a859f45161224b0f89aa6f951cfbca2bfbe22db9c2f95a6 + 2a30a118858ba1d5753f365a375cc93020012a35e3f596dcdb490ad70519cdb5 + 68c858dcb829e07bb60d47fbb962b240797dd82960a53c25ac69513e90aff6fa" + +skip_extraction="plthook.h plthook_elf.c" if [ "$XBPS_TARGET_LIBC" = musl ]; then makedepends+=" libexecinfo-devel" - LDLIBS="-lexecinfo" - broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" + configure_args+=" -DNEED_LIBEXECINFO=ON" + # broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" fi if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then @@ -30,6 +40,13 @@ fi nocross="Cross-compilation can't find python3 interpreter" +post_extract() { + for _f in $skip_extraction; do + cp $XBPS_SRCDISTDIR/${pkgname}-${version}/$_f \ + renderdoc/3rdparty/plthook + done +} + post_install() { vlicense LICENSE.md vlicense docs/credits_acknowledgements.rst From 49d6f806e9e448139e9f08c228511f2fd316313b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 23 Sep 2022 18:45:22 +0700 Subject: [PATCH 2/5] shiboken2: patch for Python 3.11 --- srcpkgs/shiboken2/patches/python-3.11.patch | 56 +++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 srcpkgs/shiboken2/patches/python-3.11.patch diff --git a/srcpkgs/shiboken2/patches/python-3.11.patch b/srcpkgs/shiboken2/patches/python-3.11.patch new file mode 100644 index 000000000000..2520f17a0c59 --- /dev/null +++ b/srcpkgs/shiboken2/patches/python-3.11.patch @@ -0,0 +1,56 @@ +--- a/sources/shiboken2/libshiboken/basewrapper.cpp ++++ b/sources/shiboken2/libshiboken/basewrapper.cpp +@@ -64,6 +64,12 @@ + #include + #endif + ++#if PY_VERSION_HEX < 0x03090000 ++void Py_SET_TYPE(PyObject *o, PyTypeObject *type) { ++ Py_TYPE(o) = type; ++} ++#endif ++ + namespace { + void _destroyParentInfo(SbkObject *obj, bool keepReference); + } +@@ -377,7 +383,7 @@ SbkObjectType *SbkObject_TypeF(void) + static PyTypeObject *type = nullptr; + if (!type) { + type = reinterpret_cast(SbkType_FromSpec(&SbkObject_Type_spec)); +- Py_TYPE(type) = SbkObjectType_TypeF(); ++ Py_SET_TYPE(type, SbkObjectType_TypeF()); + Py_INCREF(Py_TYPE(type)); + type->tp_weaklistoffset = offsetof(SbkObject, weakreflist); + type->tp_dictoffset = offsetof(SbkObject, ob_dict); +@@ -1152,7 +1158,7 @@ introduceWrapperType(PyObject *enclosing + typeSpec->slots[0].pfunc = reinterpret_cast(baseType ? baseType : SbkObject_TypeF()); + + PyObject *heaptype = SbkType_FromSpecWithBases(typeSpec, baseTypes); +- Py_TYPE(heaptype) = SbkObjectType_TypeF(); ++ Py_SET_TYPE(heaptype, SbkObjectType_TypeF()); + Py_INCREF(Py_TYPE(heaptype)); + auto *type = reinterpret_cast(heaptype); + #if PY_VERSION_HEX < 0x03000000 +--- a/sources/shiboken2/libshiboken/sbkenum.cpp ++++ b/sources/shiboken2/libshiboken/sbkenum.cpp +@@ -55,6 +55,11 @@ + #define SbkEnumType_Check(o) (Py_TYPE(Py_TYPE(o)) == SbkEnumType_TypeF()) + typedef PyObject *(*enum_func)(PyObject *, PyObject *); + ++#if PY_VERSION_HEX < 0x03090000 ++void Py_SET_TYPE(PyObject *o, PyTypeObject *type) { ++ Py_TYPE(o) = type; ++} ++#endif + extern "C" + { + +@@ -753,7 +758,7 @@ newTypeWithName(const char *name, + PyTuple_SetItem(bases, 0, reinterpret_cast(basetype)); + auto *type = reinterpret_cast(SbkType_FromSpecWithBases(&newspec, bases)); + PyErr_Print(); +- Py_TYPE(type) = SbkEnumType_TypeF(); ++ Py_SET_TYPE(type, SbkEnumType_TypeF()); + + auto *enumType = reinterpret_cast(type); + PepType_SETP(enumType)->cppName = cppName; From 755dfeeb79e6dea2836da1369e9d5d0a74c1ce90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 23 Sep 2022 18:45:22 +0700 Subject: [PATCH 3/5] sigil: patch for Python 3.11 --- srcpkgs/sigil/patches/python-3.11.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 srcpkgs/sigil/patches/python-3.11.patch diff --git a/srcpkgs/sigil/patches/python-3.11.patch b/srcpkgs/sigil/patches/python-3.11.patch new file mode 100644 index 000000000000..ff70aa9074ad --- /dev/null +++ b/srcpkgs/sigil/patches/python-3.11.patch @@ -0,0 +1,11 @@ +--- a/src/EmbedPython/EmbeddedPython.cpp ++++ b/src/EmbedPython/EmbeddedPython.cpp +@@ -480,7 +480,7 @@ QVariant EmbeddedPython::PyObjectToQVari + + if (kind == PyUnicode_1BYTE_KIND) { + // latin 1 according to PEP 393 +- res = QVariant(QString::fromLatin1(reinterpret_castPyUnicode_1BYTE_DATA(po), -1)); ++ res = QVariant(QString::fromLatin1(reinterpret_cast(PyUnicode_1BYTE_DATA(po)), -1)); + + } else if (kind == PyUnicode_2BYTE_KIND) { + #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) From 3cf2763ebef5b4def3998aff10afab836cd8cb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 23 Sep 2022 18:45:23 +0700 Subject: [PATCH 4/5] uwsgi: backport patch for Python 3.11 --- srcpkgs/uwsgi/patches/python-3.11.patch | 188 ++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 srcpkgs/uwsgi/patches/python-3.11.patch diff --git a/srcpkgs/uwsgi/patches/python-3.11.patch b/srcpkgs/uwsgi/patches/python-3.11.patch new file mode 100644 index 000000000000..99a03a9afa29 --- /dev/null +++ b/srcpkgs/uwsgi/patches/python-3.11.patch @@ -0,0 +1,188 @@ +From 2768aea6cb20d6e8d171618f2217e29f5ded4ab5 Mon Sep 17 00:00:00 2001 +From: Victor Stinner +Date: Thu, 30 Jun 2022 11:59:54 +0200 +Subject: [PATCH] Add Python 3.11 support + +Link: https://github.com/unbit/uwsgi/pull/2453 + +* Use PyFrame_GetCode(). +* Add PyFrame_GetCode() for Python 3.8 and older. +* Add UWSGI_PY311 macro: defined on Python 3.11 and newer. +* struct uwsgi_python: "current_recursion_depth" becomes + "current_recursion_remaining" and current_frame type becomes + _PyCFrame** on Python 3.11. + +Related Python 3.11 changes: + +* https://docs.python.org/dev/whatsnew/3.11.html#id6 +* The PyFrameObject structure became opaque. +* PyThreadState.frame (PyFrameObject) became PyThreadState.cframe + (_PyCFrame) in Python 3.11. +* PyThreadState: recursion_depth was replaced with + recursion_remaining + recursion_limit. +--- + plugins/python/profiler.c | 25 ++++++++++++++++++++----- + plugins/python/python_plugin.c | 26 +++++++++++++++++++++++++- + plugins/python/uwsgi_python.h | 12 ++++++++++++ + 3 files changed, 57 insertions(+), 6 deletions(-) + +--- a/plugins/python/profiler.c ++++ b/plugins/python/profiler.c +@@ -13,6 +13,14 @@ int PyFrame_GetLineNumber(PyFrameObject + } + #endif + ++#if PY_VERSION_HEX < 0x030900B1 ++PyCodeObject* PyFrame_GetCode(PyFrameObject *frame) ++{ ++ Py_INCREF(frame->f_code); ++ return frame->f_code; ++} ++#endif ++ + #ifdef PYTHREE + #undef PyString_AsString + static char *PyString_AsString(PyObject *o) { +@@ -27,27 +35,32 @@ int uwsgi_python_profiler_call(PyObject + static uint64_t last_ts = 0; + uint64_t now = uwsgi_micros(); + uint64_t delta = 0; ++ PyCodeObject *code; + + switch(what) { + case PyTrace_CALL: + if (last_ts == 0) delta = 0; + else delta = now - last_ts; + last_ts = now; ++ code = PyFrame_GetCode(frame); + uwsgi_log("[uWSGI Python profiler %llu] CALL: %s (line %d) -> %s %d args, stacksize %d\n", + (unsigned long long) delta, +- PyString_AsString(frame->f_code->co_filename), ++ PyString_AsString(code->co_filename), + PyFrame_GetLineNumber(frame), +- PyString_AsString(frame->f_code->co_name), frame->f_code->co_argcount, frame->f_code->co_stacksize); ++ PyString_AsString(code->co_name), code->co_argcount, code->co_stacksize); ++ Py_DECREF(code); + break; + case PyTrace_C_CALL: + if (last_ts == 0) delta = 0; + else delta = now - last_ts; + last_ts = now; ++ code = PyFrame_GetCode(frame); + uwsgi_log("[uWSGI Python profiler %llu] C CALL: %s (line %d) -> %s %d args, stacksize %d\n", + (unsigned long long) delta, +- PyString_AsString(frame->f_code->co_filename), ++ PyString_AsString(code->co_filename), + PyFrame_GetLineNumber(frame), +- PyEval_GetFuncName(arg), frame->f_code->co_argcount, frame->f_code->co_stacksize); ++ PyEval_GetFuncName(arg), code->co_argcount, code->co_stacksize); ++ Py_DECREF(code); + break; + } + +@@ -68,7 +81,9 @@ int uwsgi_python_tracer(PyObject *obj, P + delta = now - last_ts; + } + last_ts = now; +- uwsgi_log("[uWSGI Python profiler %llu] file %s line %d: %s argc:%d\n", (unsigned long long)delta, PyString_AsString(frame->f_code->co_filename), PyFrame_GetLineNumber(frame), PyString_AsString(frame->f_code->co_name), frame->f_code->co_argcount); ++ PyCodeObject *code = PyFrame_GetCode(frame); ++ uwsgi_log("[uWSGI Python profiler %llu] file %s line %d: %s argc:%d\n", (unsigned long long)delta, PyString_AsString(code->co_filename), PyFrame_GetLineNumber(frame), PyString_AsString(code->co_name), code->co_argcount); ++ Py_DECREF(code); + } + + return 0; +--- a/plugins/python/python_plugin.c ++++ b/plugins/python/python_plugin.c +@@ -1138,8 +1138,12 @@ void uwsgi_python_init_apps() { + + // prepare for stack suspend/resume + if (uwsgi.async > 1) { ++#ifdef UWSGI_PY311 ++ up.current_recursion_remaining = uwsgi_malloc(sizeof(int)*uwsgi.async); ++#else + up.current_recursion_depth = uwsgi_malloc(sizeof(int)*uwsgi.async); +- up.current_frame = uwsgi_malloc(sizeof(struct _frame)*uwsgi.async); ++#endif ++ up.current_frame = uwsgi_malloc(sizeof(up.current_frame[0])*uwsgi.async); + } + + // setup app loaders +@@ -1530,12 +1534,22 @@ void uwsgi_python_suspend(struct wsgi_re + PyGILState_Release(pgst); + + if (wsgi_req) { ++#ifdef UWSGI_PY311 ++ up.current_recursion_remaining[wsgi_req->async_id] = tstate->recursion_remaining; ++ up.current_frame[wsgi_req->async_id] = tstate->cframe; ++#else + up.current_recursion_depth[wsgi_req->async_id] = tstate->recursion_depth; + up.current_frame[wsgi_req->async_id] = tstate->frame; ++#endif + } + else { ++#ifdef UWSGI_PY311 ++ up.current_main_recursion_remaining = tstate->recursion_remaining; ++ up.current_main_frame = tstate->cframe; ++#else + up.current_main_recursion_depth = tstate->recursion_depth; + up.current_main_frame = tstate->frame; ++#endif + } + + } +@@ -1763,12 +1777,22 @@ void uwsgi_python_resume(struct wsgi_req + PyGILState_Release(pgst); + + if (wsgi_req) { ++#ifdef UWSGI_PY311 ++ tstate->recursion_remaining = up.current_recursion_remaining[wsgi_req->async_id]; ++ tstate->cframe = up.current_frame[wsgi_req->async_id]; ++#else + tstate->recursion_depth = up.current_recursion_depth[wsgi_req->async_id]; + tstate->frame = up.current_frame[wsgi_req->async_id]; ++#endif + } + else { ++#ifdef UWSGI_PY311 ++ tstate->recursion_remaining = up.current_main_recursion_remaining; ++ tstate->cframe = up.current_main_frame; ++#else + tstate->recursion_depth = up.current_main_recursion_depth; + tstate->frame = up.current_main_frame; ++#endif + } + + } +--- a/plugins/python/uwsgi_python.h ++++ b/plugins/python/uwsgi_python.h +@@ -18,6 +18,10 @@ + #define UWSGI_PYTHON_OLD + #endif + ++#if (PY_VERSION_HEX >= 0x030b0000) ++# define UWSGI_PY311 ++#endif ++ + #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 7 + #define HAS_NOT_PyMemoryView_FromBuffer + #endif +@@ -165,11 +169,19 @@ struct uwsgi_python { + + char *callable; + ++#ifdef UWSGI_PY311 ++ int *current_recursion_remaining; ++ _PyCFrame **current_frame; ++ ++ int current_main_recursion_remaining; ++ _PyCFrame *current_main_frame; ++#else + int *current_recursion_depth; + struct _frame **current_frame; + + int current_main_recursion_depth; + struct _frame *current_main_frame; ++#endif + + void (*swap_ts)(struct wsgi_request *, struct uwsgi_app *); + void (*reset_ts)(struct wsgi_request *, struct uwsgi_app *); From cd4ba7247b22b447acc1ccd1e2f2d412ad44af84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 23 Sep 2022 18:45:23 +0700 Subject: [PATCH 5/5] DarkRadiant: unvendor pybind11 --- srcpkgs/DarkRadiant/template | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/srcpkgs/DarkRadiant/template b/srcpkgs/DarkRadiant/template index 53e86a849d83..233d7d270b4a 100644 --- a/srcpkgs/DarkRadiant/template +++ b/srcpkgs/DarkRadiant/template @@ -7,7 +7,7 @@ build_helper=cmake-wxWidgets-gtk3 hostmakedepends="pkg-config ruby-asciidoctor" makedepends="ftgl-devel glew-devel libjpeg-turbo-devel libsigc++-devel libvorbis-devel libxml2-devel wxWidgets-gtk3-devel python3-devel - eigen libglib-devel freealut-devel libgit2-devel" + eigen libglib-devel freealut-devel libgit2-devel python3-pybind11" checkdepends="gtest-devel" short_desc="Map editor for The Dark Mod and other idTech4/Doom3-based games" maintainer="John " @@ -17,6 +17,11 @@ distfiles="https://github.com/codereader/DarkRadiant/archive/${version}.tar.gz" checksum=cc7802cb362c6b66d0dbd4a5798ebe8d0e069d0e7a05b6f4ab679c167a1d7621 CXXFLAGS="-I${XBPS_CROSS_BASE}/usr/lib/wx/include/gtk3-unicode-3.0" +CXXFLAGS="$CXXFLAGS -I${XBPS_CROSS_BASE}/${py3_sitelib}/pybind11/include" + +post_extract() { + rm -rf libs/pybind +} do_check() { :