git: c914e602857a - main - editors/imhex: Update to 1.10.1

From: MANTANI Nobutaka <nobutaka_at_FreeBSD.org>
Date: Sat, 09 Oct 2021 13:59:00 UTC
The branch main has been updated by nobutaka:

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

commit c914e602857a640fb07ac86c429a2933e601bb70
Author:     MANTANI Nobutaka <nobutaka@FreeBSD.org>
AuthorDate: 2021-10-09 13:54:41 +0000
Commit:     MANTANI Nobutaka <nobutaka@FreeBSD.org>
CommitDate: 2021-10-09 13:56:30 +0000

    editors/imhex: Update to 1.10.1
---
 editors/imhex/Makefile                             |  4 ++--
 editors/imhex/distinfo                             | 12 +++++------
 editors/imhex/files/patch-CMakeLists.txt           | 11 -----------
 .../imhex/files/patch-cmake_build__helpers.cmake   |  6 +++---
 ...iltin_source_content_pl__builtin__functions.cpp | 11 +++++++++++
 .../files/patch-plugins_libimhex_CMakeLists.txt    | 15 ++++++--------
 ...hex_include_hex_pattern__language_ast__node.hpp | 20 +++++++++++++++++++
 .../patch-plugins_libimhex_source_helpers_file.cpp | 23 +++++++++++-----------
 editors/imhex/files/patch-source_window_window.cpp |  4 ++--
 editors/imhex/pkg-plist                            |  1 -
 10 files changed, 61 insertions(+), 46 deletions(-)

diff --git a/editors/imhex/Makefile b/editors/imhex/Makefile
index 0d5a8e15a030..fc324ff4bcad 100644
--- a/editors/imhex/Makefile
+++ b/editors/imhex/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	imhex
-PORTVERSION=	1.9.0
+PORTVERSION=	1.10.1
 DISTVERSIONPREFIX=	v
 CATEGORIES=	editors
 MASTER_SITES=	https://git.sr.ht/~danyspin97/xdgpp/blob/f01f810714443d0f10c333d4d1d9c0383be41375/:xdg
@@ -41,7 +41,7 @@ GH_PROJECT=	ImHex
 GH_TUPLE=	btzy:nativefiledialog-extended:${GH_TAG_NATIVEFILEDIALOG}:nativefiledialog \
 		fmtlib:fmt:${GH_TAG_FMT}:fmt
 GH_TAG_FMT=	d141cdb
-GH_TAG_NATIVEFILEDIALOG=	322d1bc
+GH_TAG_NATIVEFILEDIALOG=	800e880
 
 CMAKE_ARGS=	-DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_YARA=ON
 
diff --git a/editors/imhex/distinfo b/editors/imhex/distinfo
index 83a47dc351cd..6daae9dc6794 100644
--- a/editors/imhex/distinfo
+++ b/editors/imhex/distinfo
@@ -1,11 +1,9 @@
-TIMESTAMP = 1631340168
+TIMESTAMP = 1633780013
 SHA256 (imhex/xdg.hpp) = 2e08ce74adb71ff9b9aa9e1c999733fccd4b00967b9cf0c0e51dbf049392a9ec
 SIZE (imhex/xdg.hpp) = 7674
-SHA256 (imhex/WerWolv-ImHex-v1.9.0_GH0.tar.gz) = 070ec1acfa3182fd539b636ad55350f91b6667e29054729c308e78ff6dc6dcb3
-SIZE (imhex/WerWolv-ImHex-v1.9.0_GH0.tar.gz) = 8391190
-SHA256 (imhex/btzy-nativefiledialog-extended-322d1bc_GH0.tar.gz) = 1950e8870068b64f862da0dcaebabaeae9a8d0edacae80ec2208a2df9c1e360f
-SIZE (imhex/btzy-nativefiledialog-extended-322d1bc_GH0.tar.gz) = 400379
+SHA256 (imhex/WerWolv-ImHex-v1.10.1_GH0.tar.gz) = 02339938409d304c5e3075de4fb9dac2e047cf02a6aaf3925661d9d4662852c8
+SIZE (imhex/WerWolv-ImHex-v1.10.1_GH0.tar.gz) = 8523483
+SHA256 (imhex/btzy-nativefiledialog-extended-800e880_GH0.tar.gz) = aa2d90478c512e8ff98a2e42adc1a775ec8424b192369cec8d671d055d54d6ea
+SIZE (imhex/btzy-nativefiledialog-extended-800e880_GH0.tar.gz) = 400335
 SHA256 (imhex/fmtlib-fmt-d141cdb_GH0.tar.gz) = 06dc2fa0236b1b334b93f7e272cbb29554b05a19fd0a9b52039976e8b5dcd725
 SIZE (imhex/fmtlib-fmt-d141cdb_GH0.tar.gz) = 805703
-SHA256 (imhex/VirusTotal-yara-f844881_GH0.tar.gz) = 26fe609f2e8fb9036647cd90fffa12a5354f804aaa802c0c30c94bc703a5620b
-SIZE (imhex/VirusTotal-yara-f844881_GH0.tar.gz) = 936341
diff --git a/editors/imhex/files/patch-CMakeLists.txt b/editors/imhex/files/patch-CMakeLists.txt
deleted file mode 100644
index 036ca4612839..000000000000
--- a/editors/imhex/files/patch-CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
---- CMakeLists.txt.orig	2021-09-12 06:27:55 UTC
-+++ CMakeLists.txt
-@@ -101,7 +101,7 @@ target_link_directories(imhex PRIVATE ${CAPSTONE_LIBRA
- if (WIN32)
-     target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32 libyara Dwmapi.lib dl)
- else ()
--    target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread libyara)
-+    target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread yara)
- endif ()
- 
- createPackage()
diff --git a/editors/imhex/files/patch-cmake_build__helpers.cmake b/editors/imhex/files/patch-cmake_build__helpers.cmake
index 7da70ba6cbdc..fb929302d50d 100644
--- a/editors/imhex/files/patch-cmake_build__helpers.cmake
+++ b/editors/imhex/files/patch-cmake_build__helpers.cmake
@@ -1,13 +1,13 @@
---- cmake/build_helpers.cmake.orig	2021-09-10 13:54:59 UTC
+--- cmake/build_helpers.cmake.orig	2021-09-30 10:52:12 UTC
 +++ cmake/build_helpers.cmake
 @@ -37,7 +37,7 @@ macro(findLibraries)
      # Find packages
      find_package(PkgConfig REQUIRED)
  
--    find_package(mbedTLS REQUIRED)
+-    find_package(mbedTLS 2.26.0 REQUIRED)
 +    find_library(mbedTLS mbedtls REQUIRED)
  
-     pkg_search_module(CAPSTONE REQUIRED capstone)
+     pkg_search_module(CAPSTONE 4.0.2 REQUIRED capstone)
  
 @@ -48,6 +48,8 @@ macro(findLibraries)
          message(STATUS ${PYTHON_VERSION_MAJOR_MINOR})
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
new file mode 100644
index 000000000000..0229cf291d64
--- /dev/null
+++ b/editors/imhex/files/patch-plugins_builtin_source_content_pl__builtin__functions.cpp
@@ -0,0 +1,11 @@
+--- plugins/builtin/source/content/pl_builtin_functions.cpp.orig	2021-09-30 10:52:12 UTC
++++ plugins/builtin/source/content/pl_builtin_functions.cpp
+@@ -192,7 +192,7 @@ namespace hex::plugin::builtin {
+                 auto string = Token::literalToString(params[0], false);
+                 auto index = Token::literalToSigned(params[1]);
+ 
+-                if (std::abs(index) >= string.length())
++                if (std::abs((long)index) >= string.length())
+                     LogConsole::abortEvaluation("character index out of range");
+ 
+                 if (index >= 0)
diff --git a/editors/imhex/files/patch-plugins_libimhex_CMakeLists.txt b/editors/imhex/files/patch-plugins_libimhex_CMakeLists.txt
index bf21af11510f..a8c6cd803f60 100644
--- a/editors/imhex/files/patch-plugins_libimhex_CMakeLists.txt
+++ b/editors/imhex/files/patch-plugins_libimhex_CMakeLists.txt
@@ -1,11 +1,8 @@
---- plugins/libimhex/CMakeLists.txt.orig	2021-09-11 13:07:05 UTC
+--- plugins/libimhex/CMakeLists.txt.orig	2021-09-30 10:52:12 UTC
 +++ plugins/libimhex/CMakeLists.txt
-@@ -98,7 +98,7 @@ if (APPLE)
-     find_library(FOUNDATION NAMES Foundation)
-     target_link_libraries(libimhex PUBLIC imgui nlohmann_json mbedcrypto ${FOUNDATION} nfd fmt-header-only libcurl magic)
- else ()
--    target_link_libraries(libimhex PUBLIC imgui nlohmann_json mbedcrypto nfd magic)
-+    target_link_libraries(libimhex PUBLIC imgui nlohmann_json mbedcrypto mbedtls mbedx509 nfd magic)
+@@ -111,4 +111,4 @@ if (APPLE)
+     target_link_libraries(libimhex PUBLIC ${FOUNDATION})
+ endif ()
  
-     if (NOT USE_SYSTEM_FMT)
-         target_link_libraries(libimhex PUBLIC fmt-header-only)
+-target_link_libraries(libimhex PUBLIC imgui nfd magic capstone LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${FMT_LIBRARIES} ${Python_LIBRARIES})
++target_link_libraries(libimhex PUBLIC imgui nfd magic capstone LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} mbedtls mbedcrypto mbedx509 ${FMT_LIBRARIES} ${Python_LIBRARIES})
diff --git a/editors/imhex/files/patch-plugins_libimhex_include_hex_pattern__language_ast__node.hpp b/editors/imhex/files/patch-plugins_libimhex_include_hex_pattern__language_ast__node.hpp
new file mode 100644
index 000000000000..1db19e1e0dd9
--- /dev/null
+++ b/editors/imhex/files/patch-plugins_libimhex_include_hex_pattern__language_ast__node.hpp
@@ -0,0 +1,20 @@
+--- plugins/libimhex/include/hex/pattern_language/ast_node.hpp.orig	2021-10-09 12:03:58 UTC
++++ plugins/libimhex/include/hex/pattern_language/ast_node.hpp
+@@ -9,7 +9,7 @@
+ #include <map>
+ #include <variant>
+ #include <vector>
+-#include <ranges>
++#include <range/v3/view.hpp>
+ 
+ #include <hex/pattern_language/ast_node_base.hpp>
+ 
+@@ -1437,7 +1437,7 @@ namespace hex::pl {
+                         continue;
+                     } else {
+                         bool found = false;
+-                        for (const auto &variable : (searchScope | std::views::reverse)) {
++                        for (const auto &variable : (searchScope | ranges::views::reverse)) {
+                             if (variable->getVariableName() == name) {
+                                 auto newPattern = variable->clone();
+                                 delete currPattern;
diff --git a/editors/imhex/files/patch-plugins_libimhex_source_helpers_file.cpp b/editors/imhex/files/patch-plugins_libimhex_source_helpers_file.cpp
index d0568bf88d82..fa341698c61e 100644
--- a/editors/imhex/files/patch-plugins_libimhex_source_helpers_file.cpp
+++ b/editors/imhex/files/patch-plugins_libimhex_source_helpers_file.cpp
@@ -1,8 +1,8 @@
---- plugins/libimhex/source/helpers/file.cpp.orig	2021-09-11 12:12:38 UTC
+--- plugins/libimhex/source/helpers/file.cpp.orig	2021-09-30 10:52:12 UTC
 +++ plugins/libimhex/source/helpers/file.cpp
 @@ -5,12 +5,12 @@ namespace hex {
  
-     File::File(const std::string &path, Mode mode) {
+     File::File(const std::string &path, Mode mode) : m_path(path) {
          if (mode == File::Mode::Read)
 -            this->m_file = fopen64(path.c_str(), "rb");
 +            this->m_file = fopen(path.c_str(), "rb");
@@ -15,8 +15,8 @@
 +            this->m_file = fopen(path.c_str(), "w+b");
      }
  
-     File::~File() {
-@@ -19,7 +19,7 @@ namespace hex {
+     File::File() {
+@@ -27,7 +27,7 @@ namespace hex {
      }
  
      void File::seek(u64 offset) {
@@ -24,11 +24,11 @@
 +        fseeko(this->m_file, offset, SEEK_SET);
      }
  
-     std::vector<u8> File::readBytes(size_t numBytes) {
-@@ -44,16 +44,16 @@ namespace hex {
-     }
+     void File::close() {
+@@ -81,10 +81,10 @@ namespace hex {
+     size_t File::getSize() const {
+         if (!isValid()) return 0;
  
-     size_t File::getSize() {
 -        auto startPos = ftello64(this->m_file);
 -        fseeko64(this->m_file, 0, SEEK_END);
 -        size_t size = ftello64(this->m_file);
@@ -40,11 +40,12 @@
  
          return size;
      }
- 
+@@ -92,7 +92,7 @@ namespace hex {
      void File::setSize(u64 size) {
+         if (!isValid()) return;
+ 
 -        ftruncate64(fileno(this->m_file), size);
 +        ftruncate(fileno(this->m_file), size);
      }
  
- }
-\ No newline at end of file
+     void File::flush() {
diff --git a/editors/imhex/files/patch-source_window_window.cpp b/editors/imhex/files/patch-source_window_window.cpp
index 0e98c317c077..36747d47ac7a 100644
--- a/editors/imhex/files/patch-source_window_window.cpp
+++ b/editors/imhex/files/patch-source_window_window.cpp
@@ -1,6 +1,6 @@
---- source/window/window.cpp.orig	2021-09-18 14:15:40 UTC
+--- source/window/window.cpp.orig	2021-09-30 10:52:12 UTC
 +++ source/window/window.cpp
-@@ -243,7 +243,6 @@ namespace hex {
+@@ -248,7 +248,6 @@ namespace hex {
          std::signal(SIGSEGV, signalHandler);
          std::signal(SIGINT,  signalHandler);
          std::signal(SIGILL,  signalHandler);
diff --git a/editors/imhex/pkg-plist b/editors/imhex/pkg-plist
index b3b6c176f610..e413c9a129fc 100644
--- a/editors/imhex/pkg-plist
+++ b/editors/imhex/pkg-plist
@@ -1,4 +1,3 @@
 bin/imhex
 lib/libimhex.so
-%%DATADIR%%/magic/imhex.mgc
 %%DATADIR%%/plugins/builtin.hexplug