From fd41a136548690243bc684b5e974832182061f45 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sun, 9 Apr 2023 21:46:38 -0400 Subject: [PATCH] imhex: update to 1.28.0. --- srcpkgs/imhex/patches/musl-no-execinfo.patch | 74 -------------------- srcpkgs/imhex/patches/no-update-check.patch | 38 +++++++--- srcpkgs/imhex/template | 12 ++-- 3 files changed, 33 insertions(+), 91 deletions(-) delete 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 deleted file mode 100644 index 1f98ef37e0a..00000000000 --- a/srcpkgs/imhex/patches/musl-no-execinfo.patch +++ /dev/null @@ -1,74 +0,0 @@ -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 520247b965e..134ec4625c0 100644 --- a/srcpkgs/imhex/patches/no-update-check.patch +++ b/srcpkgs/imhex/patches/no-update-check.patch @@ -49,39 +49,55 @@ running the internal update checker is pointless when updates are managed by xbp static bool enabled = static_cast(setting); --- a/main/source/init/tasks.cpp +++ b/main/source/init/tasks.cpp -@@ -24,30 +24,6 @@ +@@ -29,46 +29,6 @@ using namespace std::literals::string_literals; - static bool checkForUpdates() { -- // documentation of the value above the setting definition - int showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2); +- +- // Check if we should check for updates - if (showCheckForUpdates == 1){ -- hex::Net net; +- HttpRequest request("GET", GitHubApiURL + "/releases/latest"s); +- request.setTimeout(2000); - -- auto releases = net.getJson(GitHubApiURL + "/releases/latest"s, 2000).get(); -- if (releases.code != 200) +- // Query the GitHub API for the latest release version +- auto response = request.execute().get(); +- if (response.getStatusCode() != 200) - return false; - -- if (!releases.body.contains("tag_name") || !releases.body["tag_name"].is_string()) +- nlohmann::json releases; +- try { +- releases = nlohmann::json::parse(response.getData()); +- } catch (std::exception &e) { +- return false; +- } +- +- // Check if the response is valid +- if (!releases.contains("tag_name") || !releases["tag_name"].is_string()) - return false; - +- // Convert the current version string to a format that can be compared to the latest release - auto versionString = std::string(IMHEX_VERSION); - size_t versionLength = std::min(versionString.find_first_of('-'), versionString.length()); - auto currVersion = "v" + versionString.substr(0, versionLength); -- auto latestVersion = releases.body["tag_name"].get(); - +- // Get the latest release version string +- auto latestVersion = releases["tag_name"].get(); +- +- // Check if the latest release is different from the current version - if (latestVersion != currVersion) - ImHexApi::System::impl::addInitArgument("update-available", latestVersion.data()); - - } - return true; - } +- + bool setupEnvironment() { + hex::log::debug("Using romfs: '{}'", romfs::name()); - bool createDirectories() { - bool result = true; -@@ -283,7 +283,6 @@ - { "Creating directories", createDirectories, false }, +@@ -479,7 +439,6 @@ + #endif { "Loading settings", loadSettings, false }, { "Loading plugins", loadPlugins, false }, - { "Checking for updates", checkForUpdates, true }, diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template index bddb4845e12..e826e62967d 100644 --- a/srcpkgs/imhex/template +++ b/srcpkgs/imhex/template @@ -1,7 +1,7 @@ # Template file for 'imhex' pkgname=imhex -version=1.27.1 -revision=2 +version=1.28.0 +revision=1 build_wrksrc="ImHex" build_style=cmake build_helper=qemu @@ -10,18 +10,18 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON" hostmakedepends="pkg-config clang-tools-extra" -makedepends="libcurl-devel fmt-devel llvm12 jansson-devel yara-devel json-c++ +makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++ freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel clang-tools-extra" short_desc="Hex editor for reverse engineers and programmers" -maintainer="classabbyamp " +maintainer="classabbyamp " license="GPL-2.0-or-later" 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="66ce038024dbd5f0d09fd9359915340efd79bc8b51698e62277a8e88236965ca - 0be0ab3d3cce35874a48aececc79af4136e32cf4c7eb3f45b1a1863264111229" +checksum="6ee6f85dfa58e8bfb8008d1b9794cf38fed0bcc975df24bef3674abbda609d98 + bccfb8fbaa1dfcef8b38a132fa540be672fcaaadef7e5e97aabddfa620e87f1c" patch_args="-Np1 -d $build_wrksrc" if [ "$XBPS_TARGET_WORDSIZE" = 32 ]; then