diff --git a/editors/imhex/Makefile b/editors/imhex/Makefile index 65d069e4aa7d..43980a09ae9f 100644 --- a/editors/imhex/Makefile +++ b/editors/imhex/Makefile @@ -1,62 +1,66 @@ PORTNAME= imhex -PORTVERSION= 1.12.1 +PORTVERSION= 1.13.2 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} + 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 \ 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 + fmtlib:fmt:${GH_TAG_FMT}:fmt \ + WerWolv:libromfs:${GH_TAG_LIBROMFS}:libromfs GH_TAG_FMT= d141cdb GH_TAG_NATIVEFILEDIALOG= 322d1bc +GH_TAG_LIBROMFS= 0842d22 CMAKE_ARGS= -DUSE_SYSTEM_CAPSTONE=ON -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=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_libromfs}/* ${WRKSRC}/external/libromfs ${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 daa2804126b2..95a505a3b088 100644 --- a/editors/imhex/distinfo +++ b/editors/imhex/distinfo @@ -1,9 +1,11 @@ -TIMESTAMP = 1640528524 +TIMESTAMP = 1642316602 SHA256 (imhex/xdg.hpp) = 2e08ce74adb71ff9b9aa9e1c999733fccd4b00967b9cf0c0e51dbf049392a9ec SIZE (imhex/xdg.hpp) = 7674 -SHA256 (imhex/WerWolv-ImHex-v1.12.1_GH0.tar.gz) = 139679a7d7b5ad22dc2e54bc238b95f757cd468c69da94d10a43504d589851f1 -SIZE (imhex/WerWolv-ImHex-v1.12.1_GH0.tar.gz) = 8785197 +SHA256 (imhex/WerWolv-ImHex-v1.13.2_GH0.tar.gz) = 77fa014f365488fa529ce159ad6a4094790235b2e917a283f04d9c12a24c036b +SIZE (imhex/WerWolv-ImHex-v1.13.2_GH0.tar.gz) = 8823496 SHA256 (imhex/btzy-nativefiledialog-extended-322d1bc_GH0.tar.gz) = 1950e8870068b64f862da0dcaebabaeae9a8d0edacae80ec2208a2df9c1e360f SIZE (imhex/btzy-nativefiledialog-extended-322d1bc_GH0.tar.gz) = 400379 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 diff --git a/editors/imhex/files/patch-CMakeLists.txt b/editors/imhex/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..f0c812247c58 --- /dev/null +++ b/editors/imhex/files/patch-CMakeLists.txt @@ -0,0 +1,10 @@ +--- CMakeLists.txt.orig 2022-01-16 06:54:48 UTC ++++ CMakeLists.txt +@@ -20,7 +20,6 @@ set(PLUGINS + detectOS() + detectArch() + setDefaultBuiltTypeIfUnset() +-detectBadClone() + + # Add bundled dependencies + add_subdirectory(plugins/libimhex) diff --git a/editors/imhex/files/patch-external_libromfs_generator_include_embedder.hpp b/editors/imhex/files/patch-external_libromfs_generator_include_embedder.hpp new file mode 100644 index 000000000000..0f844e938536 --- /dev/null +++ b/editors/imhex/files/patch-external_libromfs_generator_include_embedder.hpp @@ -0,0 +1,21 @@ +--- external/libromfs/generator/include/embedder.hpp.orig 2022-01-16 07:27:44 UTC ++++ external/libromfs/generator/include/embedder.hpp +@@ -5,13 +5,13 @@ R"embedder( + + #define RESOURCE(name, path) \ + __asm__ ( \ +- ".global _" #name "\n" \ +- ".global _" #name "_size\n" \ +- "_" #name ":\n" \ ++ ".global " #name "\n" \ ++ ".global " #name "_size\n" \ ++ #name ":\n" \ + ".incbin \"" path "\"\n" \ + ".align 8\n" \ +- "_" #name "_size:\n" \ +- ".int _" #name "_size - _" #name " - 1\n" \ ++ #name "_size:\n" \ ++ ".int " #name "_size - " #name " - 1\n" \ + ".align 8\n" \ + ) + 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 f21a728f65a6..0082c2fd9d08 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 2021-12-16 17:57:41 UTC +--- plugins/builtin/source/content/pl_builtin_functions.cpp.orig 2022-01-12 08:17:14 UTC +++ plugins/builtin/source/content/pl_builtin_functions.cpp -@@ -204,7 +204,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 +@@ -209,7 +209,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 if (absIndex > string.length()) 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 new file mode 100644 index 000000000000..f7859e965038 --- /dev/null +++ b/editors/imhex/files/patch-plugins_libimhex_include_hex_api_keybinding.hpp @@ -0,0 +1,11 @@ +--- 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 + #include + ++#include ++ + struct ImGuiWindow; + + namespace hex { diff --git a/editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_utils.hpp b/editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_utils.hpp index 99645f8e87ff..2d2e36d588d5 100644 --- a/editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_utils.hpp +++ b/editors/imhex/files/patch-plugins_libimhex_include_hex_helpers_utils.hpp @@ -1,24 +1,24 @@ ---- plugins/libimhex/include/hex/helpers/utils.hpp.orig 2021-12-26 14:58:20 UTC +--- plugins/libimhex/include/hex/helpers/utils.hpp.orig 2022-01-12 08:17:14 UTC +++ plugins/libimhex/include/hex/helpers/utils.hpp -@@ -79,6 +79,12 @@ namespace hex { +@@ -85,6 +85,12 @@ namespace hex { template using SizeType = typename SizeTypeImpl::Type; + // Workaround for FreeBSD versions that std::has_single_bit() is not available + template + constexpr bool has_single_bit(T x) { + return x != 0 && (((x & (x - 1)) == 0)); + } + template constexpr T changeEndianess(const T &value, std::endian endian) { if (endian == std::endian::native) -@@ -91,7 +97,7 @@ namespace hex { +@@ -97,7 +103,7 @@ namespace hex { SizeType swapped; - if constexpr (!std::has_single_bit(Size) || Size > 16) + if constexpr (!has_single_bit(Size) || Size > 16) static_assert(always_false::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-plugins_libimhex_include_hex_pattern__language_ast__node.hpp new file mode 100644 index 000000000000..92d0a2210f77 --- /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 2022-01-12 08:17:14 UTC ++++ plugins/libimhex/include/hex/pattern_language/ast_node.hpp +@@ -13,6 +13,8 @@ + #include + #include + ++#include ++ + namespace hex::pl { + + class ASTNode; +@@ -1719,7 +1721,7 @@ namespace hex::pl { + Path m_path; + + void readVariable(Evaluator *evaluator, auto &value, PatternData *variablePattern) const { +- constexpr bool isString = std::same_as, std::string>; ++ constexpr bool isString = ranges::same_as, std::string>; + + if (variablePattern->isLocal()) { + auto &literal = evaluator->getStack()[variablePattern->getOffset()]; diff --git a/editors/imhex/files/patch-source_window_window.cpp b/editors/imhex/files/patch-source_window_window.cpp index 6d2825a995a8..3cd99b57ffac 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-11-28 20:34:17 UTC +--- source/window/window.cpp.orig 2022-01-12 08:17:14 UTC +++ source/window/window.cpp -@@ -252,7 +252,6 @@ namespace hex { +@@ -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); - this->m_logoTexture = ImGui::LoadImageFromMemory(imhex_logo, imhex_logo_size); + auto imhexLogo = romfs::get("logo.png");