From 03500d7e10105f08e97cd78838b276f138bb4c98 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 17 Feb 2023 12:29:43 -0500 Subject: [PATCH] imhex: update to 1.27.1. --- srcpkgs/imhex/patches/musl-no-execinfo.patch | 74 ++++++++++++++++++++ srcpkgs/imhex/patches/no-update-check.patch | 12 ++-- srcpkgs/imhex/template | 11 ++- 3 files changed, 88 insertions(+), 9 deletions(-) create mode 100644 srcpkgs/imhex/patches/musl-no-execinfo.patch diff --git a/srcpkgs/imhex/patches/musl-no-execinfo.patch b/srcpkgs/imhex/patches/musl-no-execinfo.patch new file mode 100644 index 00000000000..1f98ef37e0a --- /dev/null +++ b/srcpkgs/imhex/patches/musl-no-execinfo.patch @@ -0,0 +1,74 @@ +From 09b7794d7155d7c285ec8c0939a309a0221c9b34 Mon Sep 17 00:00:00 2001 +From: WerWolv +Date: Fri, 17 Feb 2023 17:52:10 +0100 +Subject: [PATCH] build: Added option to disable stack traces + +--- + CMakeLists.txt | 1 + + cmake/build_helpers.cmake | 42 ++++++++++++++++++++------------------- + 2 files changed, 23 insertions(+), 20 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 94655a8fc698..fc5c0e73d3ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,7 @@ option(IMHEX_IGNORE_BAD_CLONE "Disable the bad clone prevention checks" OFF) + option(IMHEX_PATTERNS_PULL_MASTER "Download latest files from master branch of the ImHex-Patterns repo" OFF) + option(IMHEX_IGNORE_BAD_COMPILER "Allow compiling with an unsupported compiler" OFF) + option(IMHEX_USE_GTK_FILE_PICKER "Use GTK file picker instead of xdg-desktop-portals" OFF) ++option(IMHEX_DISABLE_STACKTRACE "Disables support for printing stack traces" OFF) + + # Basic compiler and cmake configurations + set(CMAKE_CXX_STANDARD 23) +diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake +index 13a08ecc7514..ec258a8e3439 100644 +--- a/cmake/build_helpers.cmake ++++ b/cmake/build_helpers.cmake +@@ -515,25 +515,27 @@ macro(addBundledLibraries) + set(MAGIC_INCLUDE_DIRS ${MAGIC_INCLUDEDIR}) + endif() + +- if (WIN32) +- message(STATUS "StackWalk enabled!") +- set(LIBBACKTRACE_LIBRARIES DbgHelp.lib) +- else () +- find_package(Backtrace) +- if (${Backtrace_FOUND}) +- message(STATUS "Backtrace enabled! Header: ${Backtrace_HEADER}") +- +- if (Backtrace_HEADER STREQUAL "execinfo.h") +- set(LIBBACKTRACE_LIBRARIES) +- set(LIBBACKTRACE_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR}) +- add_compile_definitions(BACKTRACE_HEADER=\"${Backtrace_HEADER}\") +- add_compile_definitions(HEX_HAS_EXECINFO) +- elseif (Backtrace_HEADER STREQUAL "backtrace.h") +- set(LIBBACKTRACE_LIBRARIES backtrace) +- set(LIBBACKTRACE_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR}) +- add_compile_definitions(BACKTRACE_HEADER=\"${Backtrace_HEADER}\") +- add_compile_definitions(HEX_HAS_BACKTRACE) +- endif () +- endif() ++ if (NOT IMHEX_DISABLE_STACKTRACE) ++ if (WIN32) ++ message(STATUS "StackWalk enabled!") ++ set(LIBBACKTRACE_LIBRARIES DbgHelp.lib) ++ else () ++ find_package(Backtrace) ++ if (${Backtrace_FOUND}) ++ message(STATUS "Backtrace enabled! Header: ${Backtrace_HEADER}") ++ ++ if (Backtrace_HEADER STREQUAL "execinfo.h") ++ set(LIBBACKTRACE_LIBRARIES) ++ set(LIBBACKTRACE_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR}) ++ add_compile_definitions(BACKTRACE_HEADER=\"${Backtrace_HEADER}\") ++ add_compile_definitions(HEX_HAS_EXECINFO) ++ elseif (Backtrace_HEADER STREQUAL "backtrace.h") ++ set(LIBBACKTRACE_LIBRARIES backtrace) ++ set(LIBBACKTRACE_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR}) ++ add_compile_definitions(BACKTRACE_HEADER=\"${Backtrace_HEADER}\") ++ add_compile_definitions(HEX_HAS_BACKTRACE) ++ endif () ++ endif() ++ endif () + endif () + endmacro() diff --git a/srcpkgs/imhex/patches/no-update-check.patch b/srcpkgs/imhex/patches/no-update-check.patch index c600bceac07..520247b965e 100644 --- a/srcpkgs/imhex/patches/no-update-check.patch +++ b/srcpkgs/imhex/patches/no-update-check.patch @@ -1,7 +1,7 @@ running the internal update checker is pointless when updates are managed by xbps ---- a/ImHex/plugins/builtin/source/content/welcome_screen.cpp -+++ b/ImHex/plugins/builtin/source/content/welcome_screen.cpp +--- a/plugins/builtin/source/content/welcome_screen.cpp ++++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -517,20 +517,6 @@ loadDefaultLayout(); }); @@ -23,8 +23,8 @@ running the internal update checker is pointless when updates are managed by xbp ContentRegistry::Interface::addMenuItem("hex.builtin.menu.file", 1075, [&] { if (ImGui::BeginMenu("hex.builtin.menu.file.open_recent"_lang, !s_recentProvidersUpdating && !s_recentProviders.empty())) { ---- a/ImHex/plugins/builtin/source/content/settings_entries.cpp -+++ b/ImHex/plugins/builtin/source/content/settings_entries.cpp +--- a/plugins/builtin/source/content/settings_entries.cpp ++++ b/plugins/builtin/source/content/settings_entries.cpp @@ -35,21 +35,6 @@ /* General */ @@ -47,8 +47,8 @@ running the internal update checker is pointless when updates are managed by xbp ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.show_tips", 1, [](auto name, nlohmann::json &setting) { static bool enabled = static_cast(setting); ---- a/ImHex/main/source/init/tasks.cpp -+++ b/ImHex/main/source/init/tasks.cpp +--- a/main/source/init/tasks.cpp ++++ b/main/source/init/tasks.cpp @@ -24,30 +24,6 @@ using namespace std::literals::string_literals; diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template index 37c80f2ff78..8e5f01f5055 100644 --- a/srcpkgs/imhex/template +++ b/srcpkgs/imhex/template @@ -1,6 +1,6 @@ # Template file for 'imhex' pkgname=imhex -version=1.26.2 +version=1.27.1 revision=1 build_wrksrc="ImHex" build_style=cmake @@ -20,13 +20,18 @@ homepage="https://imhex.werwolv.net/" changelog="https://github.com/WerWolv/ImHex/releases" distfiles="https://github.com/WerWolv/ImHex/releases/download/v${version}/Full.Sources.tar.gz>imhex-${version}.tar.gz https://github.com/WerWolv/ImHex-Patterns/archive/refs/tags/ImHex-v${version}.tar.gz>imhex-patterns-${version}.tar.gz" -checksum="3cafd153c8b2c3d283242b13d73a87494acff40194bb160077af4f9493facda8 - bf7222495ea595b1eb1350196da1dd1f720e7cd5544542fa8cd7a48dc0b4d562" +checksum="66ce038024dbd5f0d09fd9359915340efd79bc8b51698e62277a8e88236965ca + 0be0ab3d3cce35874a48aececc79af4136e32cf4c7eb3f45b1a1863264111229" +patch_args="-Np1 -d $build_wrksrc" if [ "$XBPS_TARGET_WORDSIZE" = 32 ]; then broken="uses i128" fi +if [ "$XBPS_TARGET_LIBC" = musl ]; then + configure_args+=" -DIMHEX_DISABLE_STACKTRACE=ON" +fi + do_check() { cd build ninja ${makejobs} unit_tests