From c277f9004f24cd056df72790b26ec78b6ce3e3c9 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sun, 4 Jul 2021 12:57:29 +0200 Subject: [PATCH] app-editors/imhex: initial import Signed-off-by: Alessandro Barbieri --- app-editors/imhex/Manifest | 1 + .../files/imhex-1.8.1-fix-yara-linking.patch | 11 ++ .../imhex/files/imhex-1.8.1-gcc11.patch | 11 ++ .../imhex-1.8.1-system-nativefiledialog.patch | 19 ++++ .../files/imhex-1.8.1-system-xdgpp.patch | 11 ++ app-editors/imhex/imhex-1.8.1.ebuild | 106 ++++++++++++++++++ app-editors/imhex/metadata.xml | 77 +++++++++++++ 7 files changed, 236 insertions(+) create mode 100644 app-editors/imhex/Manifest create mode 100644 app-editors/imhex/files/imhex-1.8.1-fix-yara-linking.patch create mode 100644 app-editors/imhex/files/imhex-1.8.1-gcc11.patch create mode 100644 app-editors/imhex/files/imhex-1.8.1-system-nativefiledialog.patch create mode 100644 app-editors/imhex/files/imhex-1.8.1-system-xdgpp.patch create mode 100644 app-editors/imhex/imhex-1.8.1.ebuild create mode 100644 app-editors/imhex/metadata.xml diff --git a/app-editors/imhex/Manifest b/app-editors/imhex/Manifest new file mode 100644 index 0000000000..aae2af6f2d --- /dev/null +++ b/app-editors/imhex/Manifest @@ -0,0 +1 @@ +DIST imhex-1.8.1.tar.gz 1758664 BLAKE2B 62c58358810bd4f1192495001d01fc6c6fe8f28a35adc1478c8b2d0dab0fd929c0f46018c9afd51c1094cbae0c04002f4887fb2fb9377b6c645abaee006b9a03 SHA512 c6ec73a282c9eb90b58d164c29abbef3dceba09aa706a8295cecdcb429d5efa4015fac0dd0a3111eae3efe667f5b16f063624bf188a00a400fc06b008e3b51f8 diff --git a/app-editors/imhex/files/imhex-1.8.1-fix-yara-linking.patch b/app-editors/imhex/files/imhex-1.8.1-fix-yara-linking.patch new file mode 100644 index 0000000000..54754d2419 --- /dev/null +++ b/app-editors/imhex/files/imhex-1.8.1-fix-yara-linking.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -93,7 +93,7 @@ + if (WIN32) + target_link_libraries(imhex magic ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32 libyara) + else () +- target_link_libraries(imhex magic ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread libyara) ++ target_link_libraries(imhex magic ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread yara) + endif () + + createPackage() diff --git a/app-editors/imhex/files/imhex-1.8.1-gcc11.patch b/app-editors/imhex/files/imhex-1.8.1-gcc11.patch new file mode 100644 index 0000000000..7c62768ea5 --- /dev/null +++ b/app-editors/imhex/files/imhex-1.8.1-gcc11.patch @@ -0,0 +1,11 @@ +--- a/plugins/libimhex/include/hex/helpers/utils.hpp ++++ b/plugins/libimhex/include/hex/helpers/utils.hpp +@@ -25,7 +25,7 @@ + #define fopen64 fopen + #define fseeko64 fseek + #define ftello64 ftell +-#else ++#elif __cplusplus < 201703L + template<> + struct std::is_integral : public std::true_type { }; + template<> diff --git a/app-editors/imhex/files/imhex-1.8.1-system-nativefiledialog.patch b/app-editors/imhex/files/imhex-1.8.1-system-nativefiledialog.patch new file mode 100644 index 0000000000..185b35469a --- /dev/null +++ b/app-editors/imhex/files/imhex-1.8.1-system-nativefiledialog.patch @@ -0,0 +1,19 @@ +--- a/plugins/libimhex/CMakeLists.txt ++++ b/plugins/libimhex/CMakeLists.txt +@@ -12,7 +12,6 @@ + find_package(nlohmann_json REQUIRED) + endif() + +-add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/nativefiledialog ${CMAKE_CURRENT_BINARY_DIR}/external/nativefiledialog EXCLUDE_FROM_ALL) + if(NOT USE_SYSTEM_FMT) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/fmt ${CMAKE_CURRENT_BINARY_DIR}/external/fmt) + else() +@@ -32,7 +31,7 @@ + pkg_check_modules(LIBCURL REQUIRED IMPORTED_TARGET libcurl) + endif() + +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -lnfd") + + set(CMAKE_SHARED_LIBRARY_PREFIX "") + diff --git a/app-editors/imhex/files/imhex-1.8.1-system-xdgpp.patch b/app-editors/imhex/files/imhex-1.8.1-system-xdgpp.patch new file mode 100644 index 0000000000..511fe67eaa --- /dev/null +++ b/app-editors/imhex/files/imhex-1.8.1-system-xdgpp.patch @@ -0,0 +1,11 @@ +--- a/plugins/libimhex/CMakeLists.txt ++++ b/plugins/libimhex/CMakeLists.txt +@@ -19,7 +19,7 @@ + find_package(fmt REQUIRED) + endif() + +-set(XDGPP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../../external/xdgpp") ++set(XDGPP_INCLUDE_DIRS "/usr/include") + set(CMAKE_USE_MBEDTLS ON) + set(BUILD_CURL_EXE OFF) + set(FPHSA_NAME_MISMATCHED ON CACHE BOOL "") diff --git a/app-editors/imhex/imhex-1.8.1.ebuild b/app-editors/imhex/imhex-1.8.1.ebuild new file mode 100644 index 0000000000..8f9fd4480e --- /dev/null +++ b/app-editors/imhex/imhex-1.8.1.ebuild @@ -0,0 +1,106 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +CMAKE_BUILD_TYPE="Release" +CMAKE_MAKEFILE_GENERATOR="emake" +LLVM_MAX_SLOT=12 +PYTHON_COMPAT=( python3_{8..10} ) + +inherit cmake desktop llvm python-single-r1 xdg-utils + +DESCRIPTION="A hex editor for reverse engineers, programmers, and eyesight" +HOMEPAGE="https://github.com/WerWolv/ImHex" +SRC_URI="https://github.com/WerWolv/ImHex/archive/v${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/ImHex-${PV}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND=" + ${PYTHON_DEPS} + app-forensics/yara + dev-cpp/nlohmann_json + dev-cpp/xdgpp + dev-libs/capstone + + + + + co-maintainers welcome + lssndrbarbieri@gmail.com + Alessandro Barbieri + + + https://github.com/WerWolv/ImHex/releases + https://github.com/WerWolv/ImHex/issues + + +Features + +Featureful hex view +Byte patching +Patch management +Copy bytes as feature +Bytes +Hex string +C, C++, C sharp, Rust, Python, Java and JavaScript array +ASCII-Art hex view +HTML self contained div +String and hex search +Colorful highlighting +Goto from start, end and current cursor position +Custom C++-like pattern language for parsing highlighting a file's content +Automatic loading based on MIME type +arrays, pointers, structs, unions, enums, bitfields, using declarations, little and big endian support, conditionals and much more! +Useful error messages, syntax highlighting and error marking +Data importing +Base64 files +IPS and IPS32 patches +Data exporting +IPS and IPS32 patches +Data inspector allowing interpretation of data as many different types (little and big endian) +Huge file support with fast and efficient loading +String search +Copying of strings +Copying of demangled strings +File hashing support +CRC16 and CRC32 with custom initial values and polynomials +MD4, MD5 +SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 +Disassembler supporting many different architectures +ARM32 (ARM, Thumb, Cortex-M, AArch32) +ARM64 +MIPS (MIPS32, MIPS64, MIPS32R6, Micro) +x86 (16-bit, 32-bit, 64-bit) +PowerPC (32-bit, 64-bit) +SPARC +IBM SystemZ +xCORE +M68K +TMS320C64X +M680X +Ethereum +Bookmarks +Region highlighting +Comments +Data Analyzer +File magic-based file parser and MIME type database +Byte distribution graph +Entropy graph +Highest and average entropy +Encrypted / Compressed file detection +Helpful tools +Itanium and MSVC demangler +ASCII table +Regex replacer +Mathematical expression evaluator (Calculator) +Hexadecimal Color picker +Built-in cheat sheet for pattern language and Math evaluator +Doesn't burn out your retinas when used in late-night sessions + +