diff --git a/editors/imhex/Makefile b/editors/imhex/Makefile index 0d5a8e15a030..fc324ff4bcad 100644 --- a/editors/imhex/Makefile +++ b/editors/imhex/Makefile @@ -1,62 +1,62 @@ 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 DISTFILES= xdg.hpp:xdg DIST_SUBDIR= imhex MAINTAINER= nobutaka@FreeBSD.org COMMENT= Hex editor for reverse engineers and programmers LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE 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} \ fmtlib-fmt-${GH_TAG_FMT}_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 \ libfreetype.so:print/freetype2 \ libglfw.so:graphics/glfw \ libharfbuzz.so:print/harfbuzz \ libmbedtls.so:security/mbedtls \ libtre.so:textproc/libtre \ libyara.so:security/yara USES= cmake gl gnome pkgconfig python:3.8+ xorg USE_GL= gl USE_GNOME= cairo gdkpixbuf2 gtk30 USE_XORG= x11 xcb xau xdmcp USE_GITHUB= yes GH_ACCOUNT= WerWolv 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 PORTDOCS= README.md 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_nativefiledialog}/* ${WRKSRC}/external/nativefiledialog post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} .include 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,20 +1,20 @@ ---- 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}) message(FATAL_ERROR "No valid version of Python 3 was found.") endif() + + find_package(CURL REQUIRED) string(REPLACE "." ";" PYTHON_VERSION_MAJOR_MINOR ${Python_VERSION}) 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 + #include + #include +-#include ++#include + + #include + +@@ -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,50 +1,51 @@ ---- 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"); else if (mode == File::Mode::Write) - this->m_file = fopen64(path.c_str(), "r+b"); + this->m_file = fopen(path.c_str(), "r+b"); if (mode == File::Mode::Create || this->m_file == nullptr) - this->m_file = fopen64(path.c_str(), "w+b"); + 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) { - fseeko64(this->m_file, offset, SEEK_SET); + fseeko(this->m_file, offset, SEEK_SET); } - std::vector 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); - 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); + fseeko(this->m_file, startPos, SEEK_SET); 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,10 +1,10 @@ ---- 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); - std::signal(SIGABRT, signalHandler); std::signal(SIGFPE, signalHandler); this->m_logoTexture = ImGui::LoadImageFromMemory(imhex_logo, imhex_logo_size); 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