Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 May 2022 16:23:42 GMT
From:      MANTANI Nobutaka <nobutaka@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: ecb6408e743b - main - editors/imhex: Update to 1.17.0
Message-ID:  <202205041623.244GNgsv014580@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by nobutaka:

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

commit ecb6408e743bcf745f1c2670f1ccbd2fc0729b1e
Author:     MANTANI Nobutaka <nobutaka@FreeBSD.org>
AuthorDate: 2022-05-04 16:21:53 +0000
Commit:     MANTANI Nobutaka <nobutaka@FreeBSD.org>
CommitDate: 2022-05-04 16:23:01 +0000

    editors/imhex: Update to 1.17.0
---
 editors/imhex/Makefile                             | 32 +++++++++----
 editors/imhex/distinfo                             | 28 ++++++-----
 editors/imhex/files/patch-CMakeLists.txt           | 10 +---
 .../imhex/files/patch-cmake_build__helpers.cmake   | 25 +++++++---
 ...xternal_libromfs_generator_include_embedder.hpp |  4 +-
 ...l_pattern__language_lib_source_helpers_file.cpp | 51 ++++++++++++++++++++
 ...atch-lib_libimhex_include_hex_helpers_utils.hpp |  6 +--
 ...hex_include_hex_pattern__language_ast__node.hpp | 20 --------
 .../patch-lib_libimhex_source_helpers_crypto.cpp   | 26 ----------
 .../patch-lib_libimhex_source_helpers_file.cpp     | 26 +++++-----
 ...pp => patch-lib_libimhex_source_helpers_fs.cpp} | 10 ++--
 .../files/patch-main_source_window_window.cpp      | 13 ++++-
 ...iltin_source_content_pl__builtin__functions.cpp |  6 +--
 ...tin_source_content_providers_disk__provider.cpp |  4 +-
 ...atch-plugins_builtin_source_math__evaluator.cpp | 10 ----
 editors/imhex/pkg-plist                            | 55 ++++++++++++++++++++++
 16 files changed, 204 insertions(+), 122 deletions(-)

diff --git a/editors/imhex/Makefile b/editors/imhex/Makefile
index a04431fcd9dd..0f32187a403d 100644
--- a/editors/imhex/Makefile
+++ b/editors/imhex/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	imhex
-PORTVERSION=	1.15.0
+PORTVERSION=	1.17.0
 DISTVERSIONPREFIX=	v
 CATEGORIES=	editors
 MASTER_SITES=	https://git.sr.ht/~danyspin97/xdgpp/blob/f01f810714443d0f10c333d4d1d9c0383be41375/:xdg
@@ -18,7 +18,10 @@ 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}
+		VirusTotal-yara-${GH_TAG_YARA}_GH0${EXTRACT_SUFX} \
+		WerWolv-libromfs-${GH_TAG_LIBROMFS}_GH0${EXTRACT_SUFX} \
+		WerWolv-ImHex-Patterns-${GH_TAG_IMHEX_PATTERNS}_GH0${EXTRACT_SUFX} \
+		WerWolv-PatternLanguage-${GH_TAG_PATTERN_LANGUAGE}_GH0${EXTRACT_SUFX}
 
 BUILD_DEPENDS=	glm>0:math/glm \
 		nlohmann-json>0:devel/nlohmann-json \
@@ -28,8 +31,7 @@ LIB_DEPENDS=	libcurl.so:ftp/curl \
 		libglfw.so:graphics/glfw \
 		libharfbuzz.so:print/harfbuzz \
 		libmbedtls.so:security/mbedtls \
-		libtre.so:textproc/libtre \
-		libyara.so:security/yara
+		libtre.so:textproc/libtre
 
 USES=		cmake gl gnome pkgconfig python:3.8+ xorg
 USE_GL=		gl
@@ -42,13 +44,21 @@ 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 \
+		VirusTotal:yara:${GH_TAG_YARA}:yara \
+		WerWolv:ImHex-Patterns:${GH_TAG_IMHEX_PATTERNS}:imhex_patterns \
+		WerWolv:PatternLanguage:${GH_TAG_PATTERN_LANGUAGE}:pattern_language \
 		WerWolv:libromfs:${GH_TAG_LIBROMFS}:libromfs
-GH_TAG_CAPSTONE=	c7c665f
-GH_TAG_FMT=	d141cdb
-GH_TAG_NATIVEFILEDIALOG=	322d1bc
-GH_TAG_LIBROMFS=	5d32734
 
-CMAKE_ARGS=	-DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON
+GH_TAG_CAPSTONE=	d5141c0
+GH_TAG_FMT=	bc654fa
+GH_TAG_IMHEX_PATTERNS=	4ec37de
+GH_TAG_LIBROMFS=	f14e88a
+GH_TAG_NATIVEFILEDIALOG=	28ade5a
+GH_TAG_PATTERN_LANGUAGE=	49bafd8
+GH_TAG_YARA=	1367943
+
+CMAKE_ARGS=	-DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON
+CXXFLAGS+=	-fPIC
 
 PORTDOCS=	README.md
 
@@ -61,6 +71,10 @@ post-extract:
 	${CP} -R ${WRKSRC_fmt}/* ${WRKSRC}/lib/external/fmt
 	${CP} -R ${WRKSRC_libromfs}/* ${WRKSRC}/lib/external/libromfs
 	${CP} -R ${WRKSRC_nativefiledialog}/* ${WRKSRC}/lib/external/nativefiledialog
+	${CP} -R ${WRKSRC_pattern_language}/* ${WRKSRC}/lib/external/pattern_language
+	${CP} -R ${WRKSRC_yara}/* ${WRKSRC}/lib/external/yara/yara
+	${MKDIR} ${WRKDIR}/.build/_deps/imhex_patterns_src
+	${CP} -R ${WRKSRC_imhex_patterns}/* ${WRKDIR}/.build/_deps/imhex_patterns_src
 
 post-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/editors/imhex/distinfo b/editors/imhex/distinfo
index b1b24b0fffe0..2ed552024e28 100644
--- a/editors/imhex/distinfo
+++ b/editors/imhex/distinfo
@@ -1,13 +1,19 @@
-TIMESTAMP = 1645106596
+TIMESTAMP = 1651665999
 SHA256 (imhex/xdg.hpp) = 2e08ce74adb71ff9b9aa9e1c999733fccd4b00967b9cf0c0e51dbf049392a9ec
 SIZE (imhex/xdg.hpp) = 7674
-SHA256 (imhex/WerWolv-ImHex-v1.15.0_GH0.tar.gz) = 101546a3018a073aefb5c7063a82425d4c116784d0c1673207b1c543cd8e7629
-SIZE (imhex/WerWolv-ImHex-v1.15.0_GH0.tar.gz) = 8860931
-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-5d32734_GH0.tar.gz) = e6578158383d837074299d1a4993c94b2f2cf385003462fd8b87941462176320
-SIZE (imhex/WerWolv-libromfs-5d32734_GH0.tar.gz) = 3546
+SHA256 (imhex/WerWolv-ImHex-v1.17.0_GH0.tar.gz) = 08e7c6c2b43708e71ad8a2de01d8f4b200e6fb7d17fd29cc9eba76f4f82e03c0
+SIZE (imhex/WerWolv-ImHex-v1.17.0_GH0.tar.gz) = 8723416
+SHA256 (imhex/btzy-nativefiledialog-extended-28ade5a_GH0.tar.gz) = dcba95e4af561468fd30533882af0733a8e4df7a963c2a19eef9789c90807e28
+SIZE (imhex/btzy-nativefiledialog-extended-28ade5a_GH0.tar.gz) = 409643
+SHA256 (imhex/capstone-engine-capstone-d5141c0_GH0.tar.gz) = 435d40757928fa73dec19c6d0fbf171bd76341391c8525ce1286927dab44c3e7
+SIZE (imhex/capstone-engine-capstone-d5141c0_GH0.tar.gz) = 5761632
+SHA256 (imhex/fmtlib-fmt-bc654fa_GH0.tar.gz) = 90d5bbae46999d81510e671b49a356cd98a086ba8b7547f5065faa74f32fffad
+SIZE (imhex/fmtlib-fmt-bc654fa_GH0.tar.gz) = 826857
+SHA256 (imhex/VirusTotal-yara-1367943_GH0.tar.gz) = 2afca72e2dd10a929d1341e69f1f6d170d421f04a3d6f3321bb8fb4b8982cf07
+SIZE (imhex/VirusTotal-yara-1367943_GH0.tar.gz) = 1284035
+SHA256 (imhex/WerWolv-ImHex-Patterns-4ec37de_GH0.tar.gz) = 59e81f8d4dbeb21da5ddf6c6dcbf404b79c32d583f59a9be6d01c3468effa4bd
+SIZE (imhex/WerWolv-ImHex-Patterns-4ec37de_GH0.tar.gz) = 217951
+SHA256 (imhex/WerWolv-PatternLanguage-49bafd8_GH0.tar.gz) = 48080776130cdf3bed27dda4fd8b9babbcf6e77bbb375ff1125cc7f71b78da7e
+SIZE (imhex/WerWolv-PatternLanguage-49bafd8_GH0.tar.gz) = 168895
+SHA256 (imhex/WerWolv-libromfs-f14e88a_GH0.tar.gz) = cb375ae5b5539d19f6a17af1690e0b3cbbd0ad2e4282ce3c33efb94960ebff4b
+SIZE (imhex/WerWolv-libromfs-f14e88a_GH0.tar.gz) = 3600
diff --git a/editors/imhex/files/patch-CMakeLists.txt b/editors/imhex/files/patch-CMakeLists.txt
index f8e892680e22..256c61a51235 100644
--- a/editors/imhex/files/patch-CMakeLists.txt
+++ b/editors/imhex/files/patch-CMakeLists.txt
@@ -1,4 +1,4 @@
---- CMakeLists.txt.orig	2022-02-15 12:57:57 UTC
+--- CMakeLists.txt.orig	2022-03-03 13:32:30 UTC
 +++ CMakeLists.txt
 @@ -11,7 +11,6 @@ include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmak
  
@@ -8,11 +8,3 @@
  
  # 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
- add_subdirectory(tests EXCLUDE_FROM_ALL)
diff --git a/editors/imhex/files/patch-cmake_build__helpers.cmake b/editors/imhex/files/patch-cmake_build__helpers.cmake
index 88bdd983917d..401997ffd956 100644
--- a/editors/imhex/files/patch-cmake_build__helpers.cmake
+++ b/editors/imhex/files/patch-cmake_build__helpers.cmake
@@ -1,11 +1,22 @@
---- cmake/build_helpers.cmake.orig	2022-01-31 13:39:30 UTC
+--- cmake/build_helpers.cmake.orig	2022-03-03 13:32:30 UTC
 +++ cmake/build_helpers.cmake
-@@ -176,7 +176,7 @@ macro(createPackage)
-                 endif ()
-             endif ()
+@@ -284,17 +284,9 @@ endmacro()
  
--            add_dependencies(imhex ${plugin})
-+            add_dependencies(main ${plugin})
-         endif ()
+ 
+ function(downloadImHexPatternsFiles)
+-    FetchContent_Declare(
+-        imhex_patterns
+-        GIT_REPOSITORY https://github.com/WerWolv/ImHex-Patterns.git
+-        GIT_TAG master
+-    )
+-
+-    FetchContent_Populate(imhex_patterns)
+-
+     set(PATTERNS_FOLDERS_TO_INSTALL constants encodings includes patterns magic)
+     foreach (FOLDER ${PATTERNS_FOLDERS_TO_INSTALL})
+-        install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION "./")
++        install(DIRECTORY "${CMAKE_BINARY_DIR}/_deps/imhex_patterns_src/${FOLDER}" DESTINATION "share/imhex/")
      endforeach()
  
+ endfunction()
+\ No newline at end of file
diff --git a/editors/imhex/files/patch-lib_external_libromfs_generator_include_embedder.hpp b/editors/imhex/files/patch-lib_external_libromfs_generator_include_embedder.hpp
index f0ce2a4e5cb9..f8ed8dac663a 100644
--- a/editors/imhex/files/patch-lib_external_libromfs_generator_include_embedder.hpp
+++ b/editors/imhex/files/patch-lib_external_libromfs_generator_include_embedder.hpp
@@ -1,6 +1,6 @@
---- lib/external/libromfs/generator/include/embedder.hpp.orig	2022-01-31 11:53:19 UTC
+--- lib/external/libromfs/generator/include/embedder.hpp.orig	2022-05-04 11:03:08 UTC
 +++ lib/external/libromfs/generator/include/embedder.hpp
-@@ -5,13 +5,13 @@ R"embedder(
+@@ -19,13 +19,13 @@ R"embedder(
  
      #define RESOURCE(name, path)                        \
      __asm__ (                                           \
diff --git a/editors/imhex/files/patch-lib_external_pattern__language_lib_source_helpers_file.cpp b/editors/imhex/files/patch-lib_external_pattern__language_lib_source_helpers_file.cpp
new file mode 100644
index 000000000000..b378eac067a9
--- /dev/null
+++ b/editors/imhex/files/patch-lib_external_pattern__language_lib_source_helpers_file.cpp
@@ -0,0 +1,51 @@
+--- lib/external/pattern_language/lib/source/helpers/file.cpp.orig	2022-05-04 11:27:58 UTC
++++ lib/external/pattern_language/lib/source/helpers/file.cpp
+@@ -7,12 +7,12 @@ namespace pl::fs {
+ 
+     File::File(const std::fs::path &path, Mode mode) noexcept : m_path(path) {
+         if (mode == File::Mode::Read)
+-            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.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.string().c_str(), "w+b");
++            this->m_file = fopen(path.string().c_str(), "w+b");
+     }
+ 
+     File::File() noexcept {
+@@ -39,7 +39,7 @@ namespace pl::fs {
+ 
+ 
+     void File::seek(u64 offset) {
+-        fseeko64(this->m_file, offset, SEEK_SET);
++        fseeko(this->m_file, offset, SEEK_SET);
+     }
+ 
+     void File::close() {
+@@ -103,10 +103,10 @@ namespace pl::fs {
+     size_t File::getSize() const {
+         if (!isValid()) return 0;
+ 
+-        auto startPos = ftello64(this->m_file);
+-        fseeko64(this->m_file, 0, SEEK_END);
+-        auto size = ftello64(this->m_file);
+-        fseeko64(this->m_file, startPos, SEEK_SET);
++        auto startPos = ftello(this->m_file);
++        fseeko(this->m_file, 0, SEEK_END);
++        auto size = ftello(this->m_file);
++        fseeko(this->m_file, startPos, SEEK_SET);
+ 
+         if (size < 0)
+             return 0;
+@@ -117,7 +117,7 @@ namespace pl::fs {
+     void File::setSize(u64 size) {
+         if (!isValid()) return;
+ 
+-        auto result = ftruncate64(fileno(this->m_file), size);
++        auto result = ftruncate(fileno(this->m_file), size);
+         pl::unused(result);
+     }
+ 
diff --git a/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_utils.hpp b/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_utils.hpp
index fa91822aa4b7..239e4d750c1f 100644
--- a/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_utils.hpp
+++ b/editors/imhex/files/patch-lib_libimhex_include_hex_helpers_utils.hpp
@@ -1,6 +1,6 @@
---- lib/libimhex/include/hex/helpers/utils.hpp.orig	2022-01-30 20:55:06 UTC
+--- lib/libimhex/include/hex/helpers/utils.hpp.orig	2022-04-17 23:53:01 UTC
 +++ lib/libimhex/include/hex/helpers/utils.hpp
-@@ -95,6 +95,12 @@ namespace hex {
+@@ -94,6 +94,12 @@ namespace hex {
      template<size_t Size>
      using SizeType = typename SizeTypeImpl<Size>::Type;
  
@@ -13,7 +13,7 @@
      template<typename T>
      constexpr T changeEndianess(const T &value, std::endian endian) {
          if (endian == std::endian::native)
-@@ -107,7 +113,7 @@ namespace hex {
+@@ -106,7 +112,7 @@ namespace hex {
  
          SizeType<Size> swapped;
  
diff --git a/editors/imhex/files/patch-lib_libimhex_include_hex_pattern__language_ast__node.hpp b/editors/imhex/files/patch-lib_libimhex_include_hex_pattern__language_ast__node.hpp
deleted file mode 100644
index bfe310010fb0..000000000000
--- a/editors/imhex/files/patch-lib_libimhex_include_hex_pattern__language_ast__node.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
---- lib/libimhex/include/hex/pattern_language/ast_node.hpp.orig	2022-02-15 12:57:57 UTC
-+++ lib/libimhex/include/hex/pattern_language/ast_node.hpp
-@@ -14,6 +14,8 @@
- #include <variant>
- #include <vector>
- 
-+#include <range/v3/range/concepts.hpp>
-+
- namespace hex::pl {
- 
-     class PatternData;
-@@ -1895,7 +1897,7 @@ namespace hex::pl {
-         Path m_path;
- 
-         void readVariable(Evaluator *evaluator, auto &value, PatternData *variablePattern) const {
--            constexpr bool isString = std::same_as<std::remove_cvref_t<decltype(value)>, std::string>;
-+            constexpr bool isString = ranges::same_as<std::remove_cvref_t<decltype(value)>, std::string>;
- 
-             if (variablePattern->isLocal()) {
-                 auto &literal = evaluator->getStack()[variablePattern->getOffset()];
diff --git a/editors/imhex/files/patch-lib_libimhex_source_helpers_crypto.cpp b/editors/imhex/files/patch-lib_libimhex_source_helpers_crypto.cpp
deleted file mode 100644
index 1b852a571f6c..000000000000
--- a/editors/imhex/files/patch-lib_libimhex_source_helpers_crypto.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
---- 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-lib_libimhex_source_helpers_file.cpp b/editors/imhex/files/patch-lib_libimhex_source_helpers_file.cpp
index 30bc60c741b5..07474a940c20 100644
--- a/editors/imhex/files/patch-lib_libimhex_source_helpers_file.cpp
+++ b/editors/imhex/files/patch-lib_libimhex_source_helpers_file.cpp
@@ -1,8 +1,8 @@
---- lib/libimhex/source/helpers/file.cpp.orig	2022-02-15 12:57:57 UTC
+--- lib/libimhex/source/helpers/file.cpp.orig	2022-04-17 23:53:01 UTC
 +++ lib/libimhex/source/helpers/file.cpp
-@@ -5,12 +5,12 @@ namespace hex {
+@@ -5,12 +5,12 @@ namespace hex::fs {
  
-     File::File(const fs::path &path, Mode mode) noexcept : m_path(path) {
+     File::File(const std::fs::path &path, Mode mode) noexcept : m_path(path) {
          if (mode == File::Mode::Read)
 -            this->m_file = fopen64(path.string().c_str(), "rb");
 +            this->m_file = fopen(path.string().c_str(), "rb");
@@ -16,7 +16,7 @@
      }
  
      File::File() noexcept {
-@@ -37,7 +37,7 @@ namespace hex {
+@@ -37,7 +37,7 @@ namespace hex::fs {
  
  
      void File::seek(u64 offset) {
@@ -25,27 +25,27 @@
      }
  
      void File::close() {
-@@ -96,10 +96,10 @@ namespace hex {
+@@ -101,10 +101,10 @@ namespace hex::fs {
      size_t File::getSize() const {
          if (!isValid()) return 0;
  
 -        auto startPos = ftello64(this->m_file);
 -        fseeko64(this->m_file, 0, SEEK_END);
--        size_t size = ftello64(this->m_file);
+-        auto size = ftello64(this->m_file);
 -        fseeko64(this->m_file, startPos, SEEK_SET);
 +        auto startPos = ftello(this->m_file);
 +        fseeko(this->m_file, 0, SEEK_END);
-+        size_t size = ftello(this->m_file);
++        auto size = ftello(this->m_file);
 +        fseeko(this->m_file, startPos, SEEK_SET);
  
-         return size;
-     }
-@@ -107,7 +107,7 @@ namespace hex {
+         if (size < 0)
+             return 0;
+@@ -115,7 +115,7 @@ namespace hex::fs {
      void File::setSize(u64 size) {
          if (!isValid()) return;
  
--        ftruncate64(fileno(this->m_file), size);
-+        ftruncate(fileno(this->m_file), size);
+-        auto result = ftruncate64(fileno(this->m_file), size);
++        auto result = ftruncate(fileno(this->m_file), size);
+         hex::unused(result);
      }
  
-     void File::flush() {
diff --git a/editors/imhex/files/patch-lib_libimhex_source_helpers_paths.cpp b/editors/imhex/files/patch-lib_libimhex_source_helpers_fs.cpp
similarity index 60%
rename from editors/imhex/files/patch-lib_libimhex_source_helpers_paths.cpp
rename to editors/imhex/files/patch-lib_libimhex_source_helpers_fs.cpp
index 8d77b33d5949..ff7069fc12c9 100644
--- a/editors/imhex/files/patch-lib_libimhex_source_helpers_paths.cpp
+++ b/editors/imhex/files/patch-lib_libimhex_source_helpers_fs.cpp
@@ -1,6 +1,6 @@
---- lib/libimhex/source/helpers/paths.cpp.orig	2021-12-16 17:57:41 UTC
-+++ lib/libimhex/source/helpers/paths.cpp
-@@ -8,10 +8,15 @@
+--- lib/libimhex/source/helpers/fs.cpp.orig	2022-05-04 11:21:53 UTC
++++ lib/libimhex/source/helpers/fs.cpp
+@@ -12,10 +12,15 @@
      #include <shlobj.h>
  #elif defined(OS_LINUX)
      #include <xdg.hpp>
@@ -14,5 +14,5 @@
  #include <algorithm>
 +#include <array>
  #include <filesystem>
- #include <string>
- #include <vector>
+ 
+ namespace hex::fs {
diff --git a/editors/imhex/files/patch-main_source_window_window.cpp b/editors/imhex/files/patch-main_source_window_window.cpp
index 3fb9d7805bc2..cd8164abd262 100644
--- a/editors/imhex/files/patch-main_source_window_window.cpp
+++ b/editors/imhex/files/patch-main_source_window_window.cpp
@@ -1,6 +1,6 @@
---- main/source/window/window.cpp.orig	2022-02-15 12:57:57 UTC
+--- main/source/window/window.cpp.orig	2022-04-17 23:53:01 UTC
 +++ main/source/window/window.cpp
-@@ -151,7 +151,6 @@ namespace hex {
+@@ -148,7 +148,6 @@ namespace hex {
          std::signal(SIGSEGV, signalHandler);
          std::signal(SIGINT, signalHandler);
          std::signal(SIGILL, signalHandler);
@@ -8,3 +8,12 @@
          std::signal(SIGFPE, signalHandler);
  
          auto imhexLogo      = romfs::get("logo.png");
+@@ -597,7 +596,7 @@ namespace hex {
+                 return;
+ 
+             for (int i = 0; i < count; i++) {
+-                auto path = std::fs::path(reinterpret_cast<const char8_t *>(paths[i]));
++                auto path = std::fs::path(paths[i]);
+ 
+                 bool handled = false;
+                 for (const auto &[extensions, handler] : ContentRegistry::FileHandler::getEntries()) {
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 bbef929cb471..b922e005ca85 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-02-15 12:57:57 UTC
+--- plugins/builtin/source/content/pl_builtin_functions.cpp.orig	2022-04-17 23:53:01 UTC
 +++ plugins/builtin/source/content/pl_builtin_functions.cpp
-@@ -195,7 +195,7 @@ namespace hex::plugin::builtin {
+@@ -203,7 +203,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);
++                    const auto absIndex = (unsigned long)std::abs((long)index);
  #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 c02de3ebdc20..058bc825f254 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,6 +1,6 @@
---- plugins/builtin/source/content/providers/disk_provider.cpp.orig	2022-02-15 12:57:57 UTC
+--- plugins/builtin/source/content/providers/disk_provider.cpp.orig	2022-03-03 13:32:30 UTC
 +++ plugins/builtin/source/content/providers/disk_provider.cpp
-@@ -15,7 +15,9 @@
+@@ -17,7 +17,9 @@
      #include <sys/stat.h>
      #include <sys/types.h>
  
diff --git a/editors/imhex/files/patch-plugins_builtin_source_math__evaluator.cpp b/editors/imhex/files/patch-plugins_builtin_source_math__evaluator.cpp
deleted file mode 100644
index a091a604fc7c..000000000000
--- a/editors/imhex/files/patch-plugins_builtin_source_math__evaluator.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
---- plugins/builtin/source/math_evaluator.cpp.orig	2021-05-18 19:25:59 UTC
-+++ plugins/builtin/source/math_evaluator.cpp
-@@ -7,7 +7,6 @@
- #include <cmath>
- #include <cstdint>
- #include <optional>
--#include <numbers>
- 
- namespace hex {
- 
diff --git a/editors/imhex/pkg-plist b/editors/imhex/pkg-plist
index 15a4f054707b..e319711e23c2 100644
--- a/editors/imhex/pkg-plist
+++ b/editors/imhex/pkg-plist
@@ -1,5 +1,60 @@
 bin/imhex
 lib/libimhex.so
 share/applications/imhex.desktop
+%%DATADIR%%/constants/crc16.json
+%%DATADIR%%/constants/crc32.json
+%%DATADIR%%/constants/http_status.json
+%%DATADIR%%/constants/linux_errors.json
+%%DATADIR%%/encodings/ansi.tbl
+%%DATADIR%%/encodings/euc_jp.tbl
+%%DATADIR%%/encodings/iso_646.tbl
+%%DATADIR%%/encodings/iso_6937.tbl
+%%DATADIR%%/encodings/jis_x_0201.tbl
+%%DATADIR%%/encodings/jis_x_0211.tbl
+%%DATADIR%%/encodings/jis_x_0213.tbl
+%%DATADIR%%/encodings/shiftjis.tbl
+%%DATADIR%%/encodings/shiftjis_halfchars.tbl
+%%DATADIR%%/includes/cstdint.pat
+%%DATADIR%%/includes/std/bit.pat
+%%DATADIR%%/includes/std/cint.pat
+%%DATADIR%%/includes/std/ctype.pat
+%%DATADIR%%/includes/std/file.pat
+%%DATADIR%%/includes/std/fxpt.pat
+%%DATADIR%%/includes/std/hash.pat
+%%DATADIR%%/includes/std/http.pat
+%%DATADIR%%/includes/std/io.pat
+%%DATADIR%%/includes/std/limits.pat
+%%DATADIR%%/includes/std/math.pat
+%%DATADIR%%/includes/std/mem.pat
+%%DATADIR%%/includes/std/ptr.pat
+%%DATADIR%%/includes/std/rustint.pat
+%%DATADIR%%/includes/std/string.pat
+%%DATADIR%%/includes/std/sys.pat
+%%DATADIR%%/includes/std/types.pat
+%%DATADIR%%/magic/nintendo_switch_magic
+%%DATADIR%%/magic/portable_executable_magic
+%%DATADIR%%/patterns/afe2.hexpat
+%%DATADIR%%/patterns/ar.hexpat
+%%DATADIR%%/patterns/arm_cm_vtor.hexpat
+%%DATADIR%%/patterns/bmp.hexpat
+%%DATADIR%%/patterns/dds.hexpat
+%%DATADIR%%/patterns/elf.hexpat
+%%DATADIR%%/patterns/ico.hexpat
+%%DATADIR%%/patterns/intel_hex.hexpat
+%%DATADIR%%/patterns/ip.hexpat
+%%DATADIR%%/patterns/iso.hexpat
+%%DATADIR%%/patterns/java_class.hexpat
+%%DATADIR%%/patterns/midi.hexpat
+%%DATADIR%%/patterns/nacp.hexpat
+%%DATADIR%%/patterns/nro.hexpat
+%%DATADIR%%/patterns/pcap.hexpat
+%%DATADIR%%/patterns/pe.hexpat
+%%DATADIR%%/patterns/png.hexpat
+%%DATADIR%%/patterns/prodinfo.hexpat
+%%DATADIR%%/patterns/spirv.hexpat
+%%DATADIR%%/patterns/tga.hexpat
+%%DATADIR%%/patterns/vdf.hexpat
+%%DATADIR%%/patterns/wav.hexpat
+%%DATADIR%%/patterns/zip.hexpat
 %%DATADIR%%/plugins/builtin.hexplug
 share/pixmaps/imhex.png



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202205041623.244GNgsv014580>