1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

editors/imhex: Update to 1.14.0

This commit is contained in:
MANTANI Nobutaka 2022-02-03 21:04:00 +09:00
parent c59ef50bb0
commit 714d30ce9a
19 changed files with 141 additions and 133 deletions

View File

@ -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}

View File

@ -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

View File

@ -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()

View File

@ -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)

View File

@ -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) \

View File

@ -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 {

View File

@ -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 {

View File

@ -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>

View File

@ -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) {

View File

@ -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 {

View File

@ -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()) {

View File

@ -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;

View File

@ -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)

View File

@ -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");

View File

@ -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())

View File

@ -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>

View File

@ -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 {

View File

@ -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 };

View File

@ -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");