git: 714d30ce9a6a - main - editors/imhex: Update to 1.14.0

From: MANTANI Nobutaka <nobutaka_at_FreeBSD.org>
Date: Thu, 03 Feb 2022 12:05:20 UTC
The branch main has been updated by nobutaka:

URL: https://cgit.FreeBSD.org/ports/commit/?id=714d30ce9a6a72a515e6e3a243450c7a576e8e2a

commit 714d30ce9a6a72a515e6e3a243450c7a576e8e2a
Author:     MANTANI Nobutaka <nobutaka@FreeBSD.org>
AuthorDate: 2022-02-03 12:04:00 +0000
Commit:     MANTANI Nobutaka <nobutaka@FreeBSD.org>
CommitDate: 2022-02-03 12:04:47 +0000

    editors/imhex: Update to 1.14.0
---
 editors/imhex/Makefile                             | 22 +++++++------
 editors/imhex/distinfo                             | 12 ++++---
 editors/imhex/files/patch-CMakeLists.txt           | 20 ++++++++----
 .../imhex/files/patch-cmake_build__helpers.cmake   | 37 ++++++----------------
 ...ternal_libromfs_generator_include_embedder.hpp} |  4 +--
 ...tch-lib_libimhex_include_hex_api_keybinding.hpp | 11 +++++++
 ...b_libimhex_include_hex_helpers_disassembler.hpp | 15 +++++++++
 ...ch-lib_libimhex_include_hex_helpers_socket.hpp} |  4 +--
 ...tch-lib_libimhex_include_hex_helpers_utils.hpp} | 10 +++---
 ...ex_include_hex_pattern__language_ast__node.hpp} |  8 ++---
 .../patch-lib_libimhex_source_helpers_crypto.cpp   | 26 +++++++++++++++
 ... => patch-lib_libimhex_source_helpers_file.cpp} | 28 ++++++++--------
 ...=> patch-lib_libimhex_source_helpers_paths.cpp} |  4 +--
 .../files/patch-main_source_window_window.cpp      | 10 ++++++
 ...iltin_source_content_pl__builtin__functions.cpp | 12 +++----
 ...tin_source_content_providers_disk__provider.cpp |  4 +--
 ...plugins_libimhex_include_hex_api_keybinding.hpp | 11 -------
 ...atch-plugins_libimhex_source_helpers_crypto.cpp | 26 ---------------
 editors/imhex/files/patch-source_window_window.cpp | 10 ------
 19 files changed, 141 insertions(+), 133 deletions(-)

diff --git a/editors/imhex/Makefile b/editors/imhex/Makefile
index d85a3f7a7330..ddbd893b841d 100644
--- a/editors/imhex/Makefile
+++ b/editors/imhex/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	imhex
-PORTVERSION=	1.13.2
+PORTVERSION=	1.14.0
 DISTVERSIONPREFIX=	v
-PORTREVISION=	1
 CATEGORIES=	editors
 MASTER_SITES=	https://git.sr.ht/~danyspin97/xdgpp/blob/f01f810714443d0f10c333d4d1d9c0383be41375/:xdg
 DISTFILES=	xdg.hpp:xdg
@@ -17,14 +16,14 @@ NOT_FOR_ARCHS=	i386 powerpc
 NOT_FOR_ARCHS_REASON=	__uint128_t and __int128_t are not supported
 EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX} \
 		btzy-nativefiledialog-extended-${GH_TAG_NATIVEFILEDIALOG}_GH0${EXTRACT_SUFX} \
+		capstone-engine-capstone-${GH_TAG_CAPSTONE}_GH0${EXTRACT_SUFX} \
 		fmtlib-fmt-${GH_TAG_FMT}_GH0${EXTRACT_SUFX} \
 		WerWolv-libromfs-${GH_TAG_LIBROMFS}_GH0${EXTRACT_SUFX}
 
 BUILD_DEPENDS=	glm>0:math/glm \
 		nlohmann-json>0:devel/nlohmann-json \
 		${LOCALBASE}/include/range/v3/range.hpp:devel/range-v3
-LIB_DEPENDS=	libcapstone.so:devel/capstone4 \
-		libcurl.so:ftp/curl \
+LIB_DEPENDS=	libcurl.so:ftp/curl \
 		libfreetype.so:print/freetype2 \
 		libglfw.so:graphics/glfw \
 		libharfbuzz.so:print/harfbuzz \
@@ -41,13 +40,15 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	WerWolv
 GH_PROJECT=	ImHex
 GH_TUPLE=	btzy:nativefiledialog-extended:${GH_TAG_NATIVEFILEDIALOG}:nativefiledialog \
+		capstone-engine:capstone:${GH_TAG_CAPSTONE}:capstone \
 		fmtlib:fmt:${GH_TAG_FMT}:fmt \
 		WerWolv:libromfs:${GH_TAG_LIBROMFS}:libromfs
+GH_TAG_CAPSTONE=	c7c665f
 GH_TAG_FMT=	d141cdb
 GH_TAG_NATIVEFILEDIALOG=	322d1bc
-GH_TAG_LIBROMFS=	0842d22
+GH_TAG_LIBROMFS=	5d32734
 
-CMAKE_ARGS=	-DUSE_SYSTEM_CAPSTONE=ON -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON
+CMAKE_ARGS=	-DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON
 
 PORTDOCS=	README.md
 
@@ -55,10 +56,11 @@ OPTIONS_DEFINE=	DOCS NLS
 NLS_USES=	gettext
 
 post-extract:
-	${CP} ${DISTDIR}/${DIST_SUBDIR}/xdg.hpp ${WRKSRC}/external/xdgpp
-	${CP} -R ${WRKSRC_fmt}/* ${WRKSRC}/external/fmt
-	${CP} -R ${WRKSRC_libromfs}/* ${WRKSRC}/external/libromfs
-	${CP} -R ${WRKSRC_nativefiledialog}/* ${WRKSRC}/external/nativefiledialog
+	${CP} ${DISTDIR}/${DIST_SUBDIR}/xdg.hpp ${WRKSRC}/lib/external/xdgpp
+	${CP} -R ${WRKSRC_capstone}/* ${WRKSRC}/lib/external/capstone
+	${CP} -R ${WRKSRC_fmt}/* ${WRKSRC}/lib/external/fmt
+	${CP} -R ${WRKSRC_libromfs}/* ${WRKSRC}/lib/external/libromfs
+	${CP} -R ${WRKSRC_nativefiledialog}/* ${WRKSRC}/lib/external/nativefiledialog
 
 post-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/editors/imhex/distinfo b/editors/imhex/distinfo
index 95a505a3b088..631bfe4f0c34 100644
--- a/editors/imhex/distinfo
+++ b/editors/imhex/distinfo
@@ -1,11 +1,13 @@
-TIMESTAMP = 1642316602
+TIMESTAMP = 1643635079
 SHA256 (imhex/xdg.hpp) = 2e08ce74adb71ff9b9aa9e1c999733fccd4b00967b9cf0c0e51dbf049392a9ec
 SIZE (imhex/xdg.hpp) = 7674
-SHA256 (imhex/WerWolv-ImHex-v1.13.2_GH0.tar.gz) = 77fa014f365488fa529ce159ad6a4094790235b2e917a283f04d9c12a24c036b
-SIZE (imhex/WerWolv-ImHex-v1.13.2_GH0.tar.gz) = 8823496
+SHA256 (imhex/WerWolv-ImHex-v1.14.0_GH0.tar.gz) = 8f303a89c03294ab77d8c97ecaa091c397bfc15f562b9be48d301f830dcd8943
+SIZE (imhex/WerWolv-ImHex-v1.14.0_GH0.tar.gz) = 8845734
 SHA256 (imhex/btzy-nativefiledialog-extended-322d1bc_GH0.tar.gz) = 1950e8870068b64f862da0dcaebabaeae9a8d0edacae80ec2208a2df9c1e360f
 SIZE (imhex/btzy-nativefiledialog-extended-322d1bc_GH0.tar.gz) = 400379
+SHA256 (imhex/capstone-engine-capstone-c7c665f_GH0.tar.gz) = 7da2ea128eb6cf627be547da50275e8e8d6df0c184b2c8713a47eff5ae824ea7
+SIZE (imhex/capstone-engine-capstone-c7c665f_GH0.tar.gz) = 5758640
 SHA256 (imhex/fmtlib-fmt-d141cdb_GH0.tar.gz) = 06dc2fa0236b1b334b93f7e272cbb29554b05a19fd0a9b52039976e8b5dcd725
 SIZE (imhex/fmtlib-fmt-d141cdb_GH0.tar.gz) = 805703
-SHA256 (imhex/WerWolv-libromfs-0842d22_GH0.tar.gz) = 794604b0685c3c1286a602e50598d6a1f09508945cd07e94e9f23172aa6d7f40
-SIZE (imhex/WerWolv-libromfs-0842d22_GH0.tar.gz) = 3534
+SHA256 (imhex/WerWolv-libromfs-5d32734_GH0.tar.gz) = e6578158383d837074299d1a4993c94b2f2cf385003462fd8b87941462176320
+SIZE (imhex/WerWolv-libromfs-5d32734_GH0.tar.gz) = 3546
diff --git a/editors/imhex/files/patch-CMakeLists.txt b/editors/imhex/files/patch-CMakeLists.txt
index f0c812247c58..d99992725969 100644
--- a/editors/imhex/files/patch-CMakeLists.txt
+++ b/editors/imhex/files/patch-CMakeLists.txt
@@ -1,10 +1,18 @@
---- CMakeLists.txt.orig	2022-01-16 06:54:48 UTC
+--- CMakeLists.txt.orig	2022-01-30 20:55:06 UTC
 +++ CMakeLists.txt
-@@ -20,7 +20,6 @@ set(PLUGINS
- detectOS()
- detectArch()
+@@ -11,7 +11,6 @@ include("${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake
+ 
+ # Make sure project is configured correctly
  setDefaultBuiltTypeIfUnset()
 -detectBadClone()
  
- # Add bundled dependencies
- add_subdirectory(plugins/libimhex)
+ # List plugin names here. Project name must match folder name
+ set(PLUGINS
+@@ -28,7 +27,6 @@ configurePackingResources()
+ # Add ImHex sources
+ add_subdirectory(lib/libimhex)
+ add_subdirectory(main)
+-add_custom_target(imhex ALL DEPENDS main)
+ 
+ # Add unit tests
+ enable_testing()
diff --git a/editors/imhex/files/patch-cmake_build__helpers.cmake b/editors/imhex/files/patch-cmake_build__helpers.cmake
index 20b6eb51d2c6..88bdd983917d 100644
--- a/editors/imhex/files/patch-cmake_build__helpers.cmake
+++ b/editors/imhex/files/patch-cmake_build__helpers.cmake
@@ -1,30 +1,11 @@
---- cmake/build_helpers.cmake.orig	2021-12-26 13:48:48 UTC
+--- cmake/build_helpers.cmake.orig	2022-01-31 13:39:30 UTC
 +++ cmake/build_helpers.cmake
-@@ -68,10 +68,10 @@ macro(detectOS)
-         set(MAGIC_INSTALL_LOCATION "magic")
-     elseif(UNIX AND NOT APPLE)
-         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOS_LINUX")
--        set(CMAKE_INSTALL_BINDIR "usr/bin")
--        set(CMAKE_INSTALL_LIBDIR "usr/lib")
--        set(PLUGINS_INSTALL_LOCATION "usr/share/imhex/plugins")
--        set(MAGIC_INSTALL_LOCATION "usr/share/imhex/magic")
-+        set(CMAKE_INSTALL_BINDIR "bin")
-+        set(CMAKE_INSTALL_LIBDIR "lib")
-+        set(PLUGINS_INSTALL_LOCATION "share/imhex/plugins")
-+        set(MAGIC_INSTALL_LOCATION "share/imhex/magic")
-     else()
-         message(FATAL_ERROR "Unknown / unsupported system!")
-     endif()
-@@ -208,10 +208,8 @@ macro(createPackage)
-         endforeach()
-         ]])
-     elseif(UNIX AND NOT APPLE)
--        configure_file(${CMAKE_SOURCE_DIR}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control)
--        install(FILES ${CMAKE_BINARY_DIR}/DEBIAN/control DESTINATION ${CMAKE_INSTALL_PREFIX}/DEBIAN)
--        install(FILES ${CMAKE_SOURCE_DIR}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/usr/share/applications)
--        install(FILES ${CMAKE_SOURCE_DIR}/res/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/usr/share/pixmaps RENAME imhex.png)
-+        install(FILES ${CMAKE_SOURCE_DIR}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
-+        install(FILES ${CMAKE_SOURCE_DIR}/res/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.png)
-     endif()
+@@ -176,7 +176,7 @@ macro(createPackage)
+                 endif ()
+             endif ()
+ 
+-            add_dependencies(imhex ${plugin})
++            add_dependencies(main ${plugin})
+         endif ()
+     endforeach()
  
-     if (CREATE_BUNDLE)
diff --git a/editors/imhex/files/patch-external_libromfs_generator_include_embedder.hpp b/editors/imhex/files/patch-lib_external_libromfs_generator_include_embedder.hpp
similarity index 86%
rename from editors/imhex/files/patch-external_libromfs_generator_include_embedder.hpp
rename to editors/imhex/files/patch-lib_external_libromfs_generator_include_embedder.hpp
index 0f844e938536..f0ce2a4e5cb9 100644
--- a/editors/imhex/files/patch-external_libromfs_generator_include_embedder.hpp
+++ b/editors/imhex/files/patch-lib_external_libromfs_generator_include_embedder.hpp
@@ -1,5 +1,5 @@
---- external/libromfs/generator/include/embedder.hpp.orig	2022-01-16 07:27:44 UTC
-+++ external/libromfs/generator/include/embedder.hpp
+--- lib/external/libromfs/generator/include/embedder.hpp.orig	2022-01-31 11:53:19 UTC
++++ lib/external/libromfs/generator/include/embedder.hpp
 @@ -5,13 +5,13 @@ R"embedder(
  
      #define RESOURCE(name, path)                        \
diff --git a/editors/imhex/files/patch-lib_libimhex_include_hex_api_keybinding.hpp b/editors/imhex/files/patch-lib_libimhex_include_hex_api_keybinding.hpp
new file mode 100644
index 000000000000..dd14015b2fab
--- /dev/null
+++ b/editors/imhex/files/patch-lib_libimhex_include_hex_api_keybinding.hpp
@@ -0,0 +1,11 @@
+--- lib/libimhex/include/hex/api/keybinding.hpp.orig	2022-01-16 14:56:46 UTC
++++ lib/libimhex/include/hex/api/keybinding.hpp
+@@ -7,6 +7,8 @@
+ #include <map>
+ #include <set>
+ 
++#include <range/v3/compare.hpp>
++
+ struct ImGuiWindow;
+ 
+ namespace hex {
diff --git a/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_disassembler.hpp b/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_disassembler.hpp
new file mode 100644
index 000000000000..169ab8b00f34
--- /dev/null
+++ b/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_disassembler.hpp
@@ -0,0 +1,15 @@
+--- lib/libimhex/include/hex/helpers/disassembler.hpp.orig	2022-01-31 13:32:21 UTC
++++ lib/libimhex/include/hex/helpers/disassembler.hpp
+@@ -1,10 +1,7 @@
+ #pragma once
+ 
+-#if __has_include(<capstone/capstone.h>)
+-    #include <capstone/capstone.h>
+-#else
+-    #include <capstone.h>
+-#endif
++#include <capstone.h>
++
+ #include <hex.hpp>
+ 
+ namespace hex {
diff --git a/editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_socket.hpp b/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_socket.hpp
similarity index 55%
rename from editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_socket.hpp
rename to editors/imhex/files/patch-lib_libimhex_include_hex_helpers_socket.hpp
index d994b0773c89..4072ebba628e 100644
--- a/editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_socket.hpp
+++ b/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_socket.hpp
@@ -1,5 +1,5 @@
---- plugins/libimhex/include/hex/helpers/socket.hpp.orig	2021-12-16 17:57:41 UTC
-+++ plugins/libimhex/include/hex/helpers/socket.hpp
+--- lib/libimhex/include/hex/helpers/socket.hpp.orig	2021-12-16 17:57:41 UTC
++++ lib/libimhex/include/hex/helpers/socket.hpp
 @@ -14,6 +14,7 @@
  #else
      #include <unistd.h>
diff --git a/editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_utils.hpp b/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_utils.hpp
similarity index 68%
rename from editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_utils.hpp
rename to editors/imhex/files/patch-lib_libimhex_include_hex_helpers_utils.hpp
index 2d2e36d588d5..fa91822aa4b7 100644
--- a/editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_utils.hpp
+++ b/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_utils.hpp
@@ -1,6 +1,6 @@
---- plugins/libimhex/include/hex/helpers/utils.hpp.orig	2022-01-12 08:17:14 UTC
-+++ plugins/libimhex/include/hex/helpers/utils.hpp
-@@ -85,6 +85,12 @@ namespace hex {
+--- lib/libimhex/include/hex/helpers/utils.hpp.orig	2022-01-30 20:55:06 UTC
++++ lib/libimhex/include/hex/helpers/utils.hpp
+@@ -95,6 +95,12 @@ namespace hex {
      template<size_t Size>
      using SizeType = typename SizeTypeImpl<Size>::Type;
  
@@ -13,12 +13,12 @@
      template<typename T>
      constexpr T changeEndianess(const T &value, std::endian endian) {
          if (endian == std::endian::native)
-@@ -97,7 +103,7 @@ namespace hex {
+@@ -107,7 +113,7 @@ namespace hex {
  
          SizeType<Size> swapped;
  
 -        if constexpr (!std::has_single_bit(Size) || Size > 16)
 +        if constexpr (!has_single_bit(Size) || Size > 16)
-                 static_assert(always_false<T>::value, "Invalid type provided!");
+             static_assert(always_false<T>::value, "Invalid type provided!");
  
          switch (Size) {
diff --git a/editors/imhex/files/patch-plugins_libimhex_include_hex_pattern__language_ast__node.hpp b/editors/imhex/files/patch-lib_libimhex_include_hex_pattern__language_ast__node.hpp
similarity index 73%
rename from editors/imhex/files/patch-plugins_libimhex_include_hex_pattern__language_ast__node.hpp
rename to editors/imhex/files/patch-lib_libimhex_include_hex_pattern__language_ast__node.hpp
index 92d0a2210f77..113320775de9 100644
--- a/editors/imhex/files/patch-plugins_libimhex_include_hex_pattern__language_ast__node.hpp
+++ b/editors/imhex/files/patch-lib_libimhex_include_hex_pattern__language_ast__node.hpp
@@ -1,5 +1,5 @@
---- plugins/libimhex/include/hex/pattern_language/ast_node.hpp.orig	2022-01-12 08:17:14 UTC
-+++ plugins/libimhex/include/hex/pattern_language/ast_node.hpp
+--- lib/libimhex/include/hex/pattern_language/ast_node.hpp.orig	2022-01-30 20:55:06 UTC
++++ lib/libimhex/include/hex/pattern_language/ast_node.hpp
 @@ -13,6 +13,8 @@
  #include <variant>
  #include <vector>
@@ -8,8 +8,8 @@
 +
  namespace hex::pl {
  
-     class ASTNode;
-@@ -1719,7 +1721,7 @@ namespace hex::pl {
+     class PatternData;
+@@ -1794,7 +1796,7 @@ namespace hex::pl {
          Path m_path;
  
          void readVariable(Evaluator *evaluator, auto &value, PatternData *variablePattern) const {
diff --git a/editors/imhex/files/patch-lib_libimhex_source_helpers_crypto.cpp b/editors/imhex/files/patch-lib_libimhex_source_helpers_crypto.cpp
new file mode 100644
index 000000000000..1b852a571f6c
--- /dev/null
+++ b/editors/imhex/files/patch-lib_libimhex_source_helpers_crypto.cpp
@@ -0,0 +1,26 @@
+--- lib/libimhex/source/helpers/crypto.cpp.orig	2022-01-30 20:55:06 UTC
++++ lib/libimhex/source/helpers/crypto.cpp
+@@ -15,12 +15,13 @@
+ 
+ #include <array>
+ #include <span>
+-#include <concepts>
+ #include <functional>
+ #include <algorithm>
+ #include <cstddef>
+ #include <cstdint>
+ 
++#include <range/v3/functional/concepts.hpp>
++
+ #if MBEDTLS_VERSION_MAJOR <= 2
+ 
+     #define mbedtls_md5_starts mbedtls_md5_starts_ret
+@@ -44,7 +45,7 @@
+ namespace hex::crypt {
+     using namespace std::placeholders;
+ 
+-    template<std::invocable<unsigned char *, size_t> Func>
++    template<ranges::invocable<unsigned char *, size_t> Func>
+     void processDataByChunks(prv::Provider *data, u64 offset, size_t size, Func func) {
+         std::array<u8, 512> buffer = { 0 };
+         for (size_t bufferOffset = 0; bufferOffset < size; bufferOffset += buffer.size()) {
diff --git a/editors/imhex/files/patch-plugins_libimhex_source_helpers_file.cpp b/editors/imhex/files/patch-lib_libimhex_source_helpers_file.cpp
similarity index 60%
rename from editors/imhex/files/patch-plugins_libimhex_source_helpers_file.cpp
rename to editors/imhex/files/patch-lib_libimhex_source_helpers_file.cpp
index 70647c3041c4..92b04fd70d6c 100644
--- a/editors/imhex/files/patch-plugins_libimhex_source_helpers_file.cpp
+++ b/editors/imhex/files/patch-lib_libimhex_source_helpers_file.cpp
@@ -1,23 +1,23 @@
---- plugins/libimhex/source/helpers/file.cpp.orig	2021-11-28 20:34:17 UTC
-+++ plugins/libimhex/source/helpers/file.cpp
+--- lib/libimhex/source/helpers/file.cpp.orig	2022-01-30 20:55:06 UTC
++++ lib/libimhex/source/helpers/file.cpp
 @@ -5,12 +5,12 @@ namespace hex {
  
-     File::File(const std::string &path, Mode mode) : m_path(path) {
+     File::File(const fs::path &path, Mode mode) noexcept : m_path(path) {
          if (mode == File::Mode::Read)
--            this->m_file = fopen64(path.c_str(), "rb");
-+            this->m_file = fopen(path.c_str(), "rb");
+-            this->m_file = fopen64(path.string().c_str(), "rb");
++            this->m_file = fopen(path.string().c_str(), "rb");
          else if (mode == File::Mode::Write)
--            this->m_file = fopen64(path.c_str(), "r+b");
-+            this->m_file = fopen(path.c_str(), "r+b");
+-            this->m_file = fopen64(path.string().c_str(), "r+b");
++            this->m_file = fopen(path.string().c_str(), "r+b");
  
          if (mode == File::Mode::Create || (mode == File::Mode::Write && this->m_file == nullptr))
--            this->m_file = fopen64(path.c_str(), "w+b");
-+            this->m_file = fopen(path.c_str(), "w+b");
+-            this->m_file = fopen64(path.string().c_str(), "w+b");
++            this->m_file = fopen(path.string().c_str(), "w+b");
      }
  
-     File::File() {
-@@ -27,7 +27,7 @@ namespace hex {
-     }
+     File::File() noexcept {
+@@ -37,7 +37,7 @@ namespace hex {
+ 
  
      void File::seek(u64 offset) {
 -        fseeko64(this->m_file, offset, SEEK_SET);
@@ -25,7 +25,7 @@
      }
  
      void File::close() {
-@@ -85,10 +85,10 @@ namespace hex {
+@@ -95,10 +95,10 @@ namespace hex {
      size_t File::getSize() const {
          if (!isValid()) return 0;
  
@@ -40,7 +40,7 @@
  
          return size;
      }
-@@ -96,7 +96,7 @@ namespace hex {
+@@ -106,7 +106,7 @@ namespace hex {
      void File::setSize(u64 size) {
          if (!isValid()) return;
  
diff --git a/editors/imhex/files/patch-plugins_libimhex_source_helpers_paths.cpp b/editors/imhex/files/patch-lib_libimhex_source_helpers_paths.cpp
similarity index 71%
rename from editors/imhex/files/patch-plugins_libimhex_source_helpers_paths.cpp
rename to editors/imhex/files/patch-lib_libimhex_source_helpers_paths.cpp
index 82ceeee458c6..8d77b33d5949 100644
--- a/editors/imhex/files/patch-plugins_libimhex_source_helpers_paths.cpp
+++ b/editors/imhex/files/patch-lib_libimhex_source_helpers_paths.cpp
@@ -1,5 +1,5 @@
---- plugins/libimhex/source/helpers/paths.cpp.orig	2021-12-16 17:57:41 UTC
-+++ plugins/libimhex/source/helpers/paths.cpp
+--- lib/libimhex/source/helpers/paths.cpp.orig	2021-12-16 17:57:41 UTC
++++ lib/libimhex/source/helpers/paths.cpp
 @@ -8,10 +8,15 @@
      #include <shlobj.h>
  #elif defined(OS_LINUX)
diff --git a/editors/imhex/files/patch-main_source_window_window.cpp b/editors/imhex/files/patch-main_source_window_window.cpp
new file mode 100644
index 000000000000..1822b8ed89ee
--- /dev/null
+++ b/editors/imhex/files/patch-main_source_window_window.cpp
@@ -0,0 +1,10 @@
+--- main/source/window/window.cpp.orig	2022-01-30 20:55:06 UTC
++++ main/source/window/window.cpp
+@@ -280,7 +280,6 @@ namespace hex {
+         std::signal(SIGSEGV, signalHandler);
+         std::signal(SIGINT, signalHandler);
+         std::signal(SIGILL, signalHandler);
+-        std::signal(SIGABRT, signalHandler);
+         std::signal(SIGFPE, signalHandler);
+ 
+         auto imhexLogo = romfs::get("logo.png");
diff --git a/editors/imhex/files/patch-plugins_builtin_source_content_pl__builtin__functions.cpp b/editors/imhex/files/patch-plugins_builtin_source_content_pl__builtin__functions.cpp
index 0082c2fd9d08..a0c8ac4b72d5 100644
--- a/editors/imhex/files/patch-plugins_builtin_source_content_pl__builtin__functions.cpp
+++ b/editors/imhex/files/patch-plugins_builtin_source_content_pl__builtin__functions.cpp
@@ -1,11 +1,11 @@
---- plugins/builtin/source/content/pl_builtin_functions.cpp.orig	2022-01-12 08:17:14 UTC
+--- plugins/builtin/source/content/pl_builtin_functions.cpp.orig	2022-01-30 20:55:06 UTC
 +++ plugins/builtin/source/content/pl_builtin_functions.cpp
-@@ -209,7 +209,7 @@ namespace hex::plugin::builtin {
-                     const auto signIndex = index >> (sizeof(index) * 8 - 1);
-                     const auto absIndex = (index ^ signIndex) - signIndex;
-                 #else
+@@ -193,7 +193,7 @@ namespace hex::plugin::builtin {
+                 const auto signIndex = index >> (sizeof(index) * 8 - 1);
+                 const auto absIndex = (index ^ signIndex) - signIndex;
+ #else
 -                    const auto absIndex = std::abs(index);
 +                    const auto absIndex = std::abs((long)index);
-                 #endif
+ #endif
  
                  if (absIndex > string.length())
diff --git a/editors/imhex/files/patch-plugins_builtin_source_content_providers_disk__provider.cpp b/editors/imhex/files/patch-plugins_builtin_source_content_providers_disk__provider.cpp
index e8c51c383290..0a94c8aeacab 100644
--- a/editors/imhex/files/patch-plugins_builtin_source_content_providers_disk__provider.cpp
+++ b/editors/imhex/files/patch-plugins_builtin_source_content_providers_disk__provider.cpp
@@ -1,4 +1,4 @@
---- plugins/builtin/source/content/providers/disk_provider.cpp.orig	2021-12-16 17:57:41 UTC
+--- plugins/builtin/source/content/providers/disk_provider.cpp.orig	2022-01-30 20:55:06 UTC
 +++ plugins/builtin/source/content/providers/disk_provider.cpp
 @@ -11,7 +11,9 @@
      #include <sys/stat.h>
@@ -7,6 +7,6 @@
 +# if !defined(__FreeBSD__)
      #define lseek lseek64
 +# endif
- #elif defined (OS_MACOS)
+ #elif defined(OS_MACOS)
      #include <fcntl.h>
      #include <unistd.h>
diff --git a/editors/imhex/files/patch-plugins_libimhex_include_hex_api_keybinding.hpp b/editors/imhex/files/patch-plugins_libimhex_include_hex_api_keybinding.hpp
deleted file mode 100644
index f7859e965038..000000000000
--- a/editors/imhex/files/patch-plugins_libimhex_include_hex_api_keybinding.hpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- plugins/libimhex/include/hex/api/keybinding.hpp.orig	2022-01-16 14:56:46 UTC
-+++ plugins/libimhex/include/hex/api/keybinding.hpp
-@@ -7,6 +7,8 @@
- #include <map>
- #include <set>
- 
-+#include <range/v3/compare.hpp>
-+
- struct ImGuiWindow;
- 
- namespace hex {
diff --git a/editors/imhex/files/patch-plugins_libimhex_source_helpers_crypto.cpp b/editors/imhex/files/patch-plugins_libimhex_source_helpers_crypto.cpp
deleted file mode 100644
index 1e40da6d04ff..000000000000
--- a/editors/imhex/files/patch-plugins_libimhex_source_helpers_crypto.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
---- plugins/libimhex/source/helpers/crypto.cpp.orig	2021-12-16 17:57:41 UTC
-+++ plugins/libimhex/source/helpers/crypto.cpp
-@@ -15,12 +15,13 @@
- 
- #include <array>
- #include <span>
--#include <concepts>
- #include <functional>
- #include <algorithm>
- #include <cstddef>
- #include <cstdint>
- 
-+#include <range/v3/functional/concepts.hpp>
-+
- #if MBEDTLS_VERSION_MAJOR <= 2
- 
- #define mbedtls_md5_starts mbedtls_md5_starts_ret
-@@ -44,7 +45,7 @@
- namespace hex::crypt {
-     using namespace std::placeholders;
- 
--    template<std::invocable<unsigned char*, size_t> Func>
-+    template<ranges::invocable<unsigned char*, size_t> Func>
-     void processDataByChunks(prv::Provider* data, u64 offset, size_t size, Func func)
-     {
-         std::array<u8, 512> buffer = { 0 };
diff --git a/editors/imhex/files/patch-source_window_window.cpp b/editors/imhex/files/patch-source_window_window.cpp
deleted file mode 100644
index 3cd99b57ffac..000000000000
--- a/editors/imhex/files/patch-source_window_window.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
---- source/window/window.cpp.orig	2022-01-12 08:17:14 UTC
-+++ source/window/window.cpp
-@@ -279,7 +279,6 @@ namespace hex {
-         std::signal(SIGSEGV, signalHandler);
-         std::signal(SIGINT,  signalHandler);
-         std::signal(SIGILL,  signalHandler);
--        std::signal(SIGABRT, signalHandler);
-         std::signal(SIGFPE,  signalHandler);
- 
-         auto imhexLogo = romfs::get("logo.png");