build: Removed all usages of Python
This commit is contained in:
parent
b4fa8bebe9
commit
85823e8e5d
@ -52,31 +52,6 @@ macro(addVersionDefines)
|
|||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(configurePython)
|
|
||||||
set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
|
|
||||||
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
|
|
||||||
|
|
||||||
# Enforce that we use non system Python 3 on macOS.
|
|
||||||
set(Python_FIND_FRAMEWORK NEVER)
|
|
||||||
|
|
||||||
find_package(Python COMPONENTS Development REQUIRED)
|
|
||||||
if(Python_VERSION LESS 3)
|
|
||||||
message(STATUS ${PYTHON_VERSION_MAJOR_MINOR})
|
|
||||||
message(FATAL_ERROR "No valid version of Python 3 was found.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
string(REPLACE "." ";" PYTHON_VERSION_MAJOR_MINOR ${Python_VERSION})
|
|
||||||
|
|
||||||
list(LENGTH PYTHON_VERSION_MAJOR_MINOR PYTHON_VERSION_COMPONENT_COUNT)
|
|
||||||
|
|
||||||
if (PYTHON_VERSION_COMPONENT_COUNT EQUAL 3)
|
|
||||||
list(REMOVE_AT PYTHON_VERSION_MAJOR_MINOR 2)
|
|
||||||
endif ()
|
|
||||||
list(JOIN PYTHON_VERSION_MAJOR_MINOR "." PYTHON_VERSION_MAJOR_MINOR)
|
|
||||||
|
|
||||||
add_compile_definitions(PYTHON_VERSION_MAJOR_MINOR="${PYTHON_VERSION_MAJOR_MINOR}")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
# Detect current OS / System
|
# Detect current OS / System
|
||||||
macro(detectOS)
|
macro(detectOS)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
@ -223,7 +198,6 @@ macro(createPackage)
|
|||||||
|
|
||||||
# Grab all dynamically linked dependencies.
|
# Grab all dynamically linked dependencies.
|
||||||
INSTALL(CODE "set(CMAKE_INSTALL_BINDIR \"${CMAKE_INSTALL_BINDIR}\")")
|
INSTALL(CODE "set(CMAKE_INSTALL_BINDIR \"${CMAKE_INSTALL_BINDIR}\")")
|
||||||
INSTALL(CODE "get_filename_component(PY_PARENT \"${Python_LIBRARIES}\" DIRECTORY)")
|
|
||||||
INSTALL(CODE "LIST(APPEND DEP_FOLDERS \${PY_PARENT})")
|
INSTALL(CODE "LIST(APPEND DEP_FOLDERS \${PY_PARENT})")
|
||||||
install(CODE [[
|
install(CODE [[
|
||||||
file(GET_RUNTIME_DEPENDENCIES
|
file(GET_RUNTIME_DEPENDENCIES
|
||||||
|
@ -46,7 +46,7 @@ endfunction()
|
|||||||
|
|
||||||
include(BundleUtilities)
|
include(BundleUtilities)
|
||||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||||
fixup_bundle("${BUNDLE_PATH}" "${extra_libs}" "${extra_dirs}" IGNORE_ITEM "Python")
|
fixup_bundle("${BUNDLE_PATH}" "${extra_libs}" "${extra_dirs}")
|
||||||
|
|
||||||
if (CODE_SIGN_CERTIFICATE_ID)
|
if (CODE_SIGN_CERTIFICATE_ID)
|
||||||
# Hack around Apple Silicon signing bugs by copying the real app, signing it and moving it back.
|
# Hack around Apple Silicon signing bugs by copying the real app, signing it and moving it back.
|
||||||
|
1
dist/AppImageBuilder.yml
vendored
1
dist/AppImageBuilder.yml
vendored
@ -107,7 +107,6 @@ AppDir:
|
|||||||
- /lib/x86_64-linux-gnu/libpcre2-8.so.0
|
- /lib/x86_64-linux-gnu/libpcre2-8.so.0
|
||||||
- /lib/x86_64-linux-gnu/libpixman-1.so.0
|
- /lib/x86_64-linux-gnu/libpixman-1.so.0
|
||||||
- /lib/x86_64-linux-gnu/libpng16.so.16
|
- /lib/x86_64-linux-gnu/libpng16.so.16
|
||||||
- /lib/x86_64-linux-gnu/libpython3.10.so.1.0
|
|
||||||
- /lib/x86_64-linux-gnu/libsasl2.so.2
|
- /lib/x86_64-linux-gnu/libsasl2.so.2
|
||||||
- /lib/x86_64-linux-gnu/libsensors.so.5
|
- /lib/x86_64-linux-gnu/libsensors.so.5
|
||||||
- /lib/x86_64-linux-gnu/libstdc++.so.6
|
- /lib/x86_64-linux-gnu/libstdc++.so.6
|
||||||
|
2
dist/Arch/PKGBUILD
vendored
2
dist/Arch/PKGBUILD
vendored
@ -8,7 +8,7 @@ pkgdesc="A Hex Editor for Reverse Engineers, Programmers and people who value th
|
|||||||
arch=("x86_64")
|
arch=("x86_64")
|
||||||
url="https://github.com/WerWolv/ImHex"
|
url="https://github.com/WerWolv/ImHex"
|
||||||
license=('GPL2')
|
license=('GPL2')
|
||||||
depends=(glfw mbedtls python freetype2 libglvnd dbus xdg-desktop-portal curl fmt yara nlohmann-json)
|
depends=(glfw mbedtls freetype2 libglvnd dbus xdg-desktop-portal curl fmt yara nlohmann-json)
|
||||||
makedepends=(git)
|
makedepends=(git)
|
||||||
provides=(imhex)
|
provides=(imhex)
|
||||||
conflicts=(imhex)
|
conflicts=(imhex)
|
||||||
|
1
dist/Brewfile
vendored
1
dist/Brewfile
vendored
@ -2,7 +2,6 @@ brew "mbedtls"
|
|||||||
brew "nlohmann-json"
|
brew "nlohmann-json"
|
||||||
brew "cmake"
|
brew "cmake"
|
||||||
brew "ccache"
|
brew "ccache"
|
||||||
brew "python3"
|
|
||||||
brew "freetype2"
|
brew "freetype2"
|
||||||
brew "libmagic"
|
brew "libmagic"
|
||||||
brew "pkg-config"
|
brew "pkg-config"
|
||||||
|
2
dist/DEBIAN/control.in
vendored
2
dist/DEBIAN/control.in
vendored
@ -4,7 +4,7 @@ Section: editors
|
|||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
License: GNU GPL-2
|
License: GNU GPL-2
|
||||||
Depends: libglfw3, libmagic1, libmbedtls14, libpython3.10, libfreetype6, libopengl0, libdbus-1-3, xdg-desktop-portal
|
Depends: libglfw3, libmagic1, libmbedtls14, libfreetype6, libopengl0, libdbus-1-3, xdg-desktop-portal
|
||||||
Maintainer: WerWolv <hey@werwolv.net>
|
Maintainer: WerWolv <hey@werwolv.net>
|
||||||
Description: ImHex Hex Editor
|
Description: ImHex Hex Editor
|
||||||
A Hex Editor for Reverse Engineers, Programmers and
|
A Hex Editor for Reverse Engineers, Programmers and
|
||||||
|
1
dist/Dockerfile
vendored
1
dist/Dockerfile
vendored
@ -13,7 +13,6 @@ RUN pacman -S --needed --noconfirm \
|
|||||||
glfw-x11 \
|
glfw-x11 \
|
||||||
file \
|
file \
|
||||||
mbedtls \
|
mbedtls \
|
||||||
python3 \
|
|
||||||
freetype2 \
|
freetype2 \
|
||||||
dbus \
|
dbus \
|
||||||
xdg-desktop-portal
|
xdg-desktop-portal
|
||||||
|
7
dist/ImHex-9999.ebuild
vendored
7
dist/ImHex-9999.ebuild
vendored
@ -9,20 +9,15 @@ HOMEPAGE="https://github.com/WerWolv/ImHex"
|
|||||||
SRC_URI=""
|
SRC_URI=""
|
||||||
EGIT_REPO_URI="https://github.com/WerWolv/ImHex.git"
|
EGIT_REPO_URI="https://github.com/WerWolv/ImHex.git"
|
||||||
|
|
||||||
PYTHON_COMPAT=( python3_{6,7,8,9} )
|
inherit git-r3 cmake
|
||||||
|
|
||||||
inherit git-r3 python-single-r1 cmake
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
LICENSE="GPL-2"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="~amd64"
|
KEYWORDS="~amd64"
|
||||||
IUSE=""
|
IUSE=""
|
||||||
|
|
||||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
|
||||||
|
|
||||||
DEPEND=""
|
DEPEND=""
|
||||||
RDEPEND="${DEPEND}
|
RDEPEND="${DEPEND}
|
||||||
${PYTHON_DEPS}
|
|
||||||
media-libs/glfw
|
media-libs/glfw
|
||||||
sys-apps/file
|
sys-apps/file
|
||||||
dev-libs/mbedtls
|
dev-libs/mbedtls
|
||||||
|
1
dist/get_deps_archlinux.sh
vendored
1
dist/get_deps_archlinux.sh
vendored
@ -7,7 +7,6 @@ pacman -S $@ --needed \
|
|||||||
glfw \
|
glfw \
|
||||||
file \
|
file \
|
||||||
mbedtls \
|
mbedtls \
|
||||||
python3 \
|
|
||||||
freetype2 \
|
freetype2 \
|
||||||
dbus \
|
dbus \
|
||||||
xdg-desktop-portal \
|
xdg-desktop-portal \
|
||||||
|
1
dist/get_deps_debian.sh
vendored
1
dist/get_deps_debian.sh
vendored
@ -19,7 +19,6 @@ apt install -y \
|
|||||||
libglm-dev \
|
libglm-dev \
|
||||||
libmagic-dev \
|
libmagic-dev \
|
||||||
libmbedtls-dev \
|
libmbedtls-dev \
|
||||||
python3-dev \
|
|
||||||
libfreetype-dev \
|
libfreetype-dev \
|
||||||
libdbus-1-dev \
|
libdbus-1-dev \
|
||||||
xdg-desktop-portal
|
xdg-desktop-portal
|
||||||
|
3
dist/get_deps_fedora.sh
vendored
3
dist/get_deps_fedora.sh
vendored
@ -10,5 +10,4 @@ dnf install -y \
|
|||||||
mesa-libGL-devel \
|
mesa-libGL-devel \
|
||||||
glfw-devel \
|
glfw-devel \
|
||||||
lld \
|
lld \
|
||||||
mbedtls-devel \
|
mbedtls-devel
|
||||||
python3-devel
|
|
1
dist/get_deps_msys2.sh
vendored
1
dist/get_deps_msys2.sh
vendored
@ -9,6 +9,5 @@ pacman -S --needed --noconfirm \
|
|||||||
mingw-w64-x86_64-glfw \
|
mingw-w64-x86_64-glfw \
|
||||||
mingw-w64-x86_64-file \
|
mingw-w64-x86_64-file \
|
||||||
mingw-w64-x86_64-mbedtls \
|
mingw-w64-x86_64-mbedtls \
|
||||||
mingw-w64-x86_64-python \
|
|
||||||
mingw-w64-x86_64-freetype \
|
mingw-w64-x86_64-freetype \
|
||||||
mingw-w64-x86_64-dlfcn
|
mingw-w64-x86_64-dlfcn
|
||||||
|
2
dist/msys2/PKGBUILD
vendored
2
dist/msys2/PKGBUILD
vendored
@ -7,7 +7,6 @@ pkgdesc="${_realname}: a Hex Editor for Reverse Engineers, Programmers and peopl
|
|||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://github.com/WerWolv/ImHex"
|
url="https://github.com/WerWolv/ImHex"
|
||||||
license=('GPLv2')
|
license=('GPLv2')
|
||||||
depends=("${MINGW_PACKAGE_PREFIX}-python")
|
|
||||||
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
|
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
|
||||||
"${MINGW_PACKAGE_PREFIX}-lld"
|
"${MINGW_PACKAGE_PREFIX}-lld"
|
||||||
"${MINGW_PACKAGE_PREFIX}-cmake"
|
"${MINGW_PACKAGE_PREFIX}-cmake"
|
||||||
@ -17,7 +16,6 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
|
|||||||
"${MINGW_PACKAGE_PREFIX}-file"
|
"${MINGW_PACKAGE_PREFIX}-file"
|
||||||
"${MINGW_PACKAGE_PREFIX}-mbedtls"
|
"${MINGW_PACKAGE_PREFIX}-mbedtls"
|
||||||
"${MINGW_PACKAGE_PREFIX}-polly"
|
"${MINGW_PACKAGE_PREFIX}-polly"
|
||||||
"${MINGW_PACKAGE_PREFIX}-python"
|
|
||||||
"${MINGW_PACKAGE_PREFIX}-freetype")
|
"${MINGW_PACKAGE_PREFIX}-freetype")
|
||||||
|
|
||||||
source=()
|
source=()
|
||||||
|
1
dist/rpm/imhex.spec
vendored
1
dist/rpm/imhex.spec
vendored
@ -19,7 +19,6 @@ BuildRequires: json-devel
|
|||||||
BuildRequires: libcurl-devel
|
BuildRequires: libcurl-devel
|
||||||
BuildRequires: llvm-devel
|
BuildRequires: llvm-devel
|
||||||
BuildRequires: mbedtls-devel
|
BuildRequires: mbedtls-devel
|
||||||
BuildRequires: python3-devel
|
|
||||||
%if 0%{?fedora} >= 37
|
%if 0%{?fedora} >= 37
|
||||||
BuildRequires: yara-devel
|
BuildRequires: yara-devel
|
||||||
%endif
|
%endif
|
||||||
|
@ -90,7 +90,6 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../external/pattern_language ${CMAK
|
|||||||
set_target_properties(libpl PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
set_target_properties(libpl PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
find_package(mbedTLS 2.26.0 REQUIRED)
|
find_package(mbedTLS 2.26.0 REQUIRED)
|
||||||
configurePython()
|
|
||||||
|
|
||||||
pkg_search_module(MAGIC libmagic>=5.39)
|
pkg_search_module(MAGIC libmagic>=5.39)
|
||||||
if(NOT MAGIC_FOUND)
|
if(NOT MAGIC_FOUND)
|
||||||
@ -162,7 +161,7 @@ add_library(libimhex SHARED ${LIBIMHEX_SOURCES})
|
|||||||
set_target_properties(libimhex PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
set_target_properties(libimhex PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
setupCompilerWarnings(libimhex)
|
setupCompilerWarnings(libimhex)
|
||||||
|
|
||||||
target_include_directories(libimhex PUBLIC include ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${YARA_INCLUDE_DIRS})
|
target_include_directories(libimhex PUBLIC include ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${YARA_INCLUDE_DIRS})
|
||||||
target_link_directories(libimhex PUBLIC ${MBEDTLS_LIBRARY_DIR} ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS})
|
target_link_directories(libimhex PUBLIC ${MBEDTLS_LIBRARY_DIR} ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS})
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
@ -170,4 +169,4 @@ if (APPLE)
|
|||||||
target_link_libraries(libimhex PUBLIC ${FOUNDATION})
|
target_link_libraries(libimhex PUBLIC ${FOUNDATION})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_link_libraries(libimhex PUBLIC dl imgui ${NFD_LIBRARIES} magic ${CAPSTONE_LIBRARIES} LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${FMT_LIBRARIES} ${Python_LIBRARIES} libpl intervaltree)
|
target_link_libraries(libimhex PUBLIC dl imgui ${NFD_LIBRARIES} magic ${CAPSTONE_LIBRARIES} LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${FMT_LIBRARIES} libpl intervaltree)
|
||||||
|
@ -90,7 +90,6 @@ namespace hex::fs {
|
|||||||
Patterns = 0,
|
Patterns = 0,
|
||||||
PatternsInclude,
|
PatternsInclude,
|
||||||
Magic,
|
Magic,
|
||||||
Python,
|
|
||||||
Plugins,
|
Plugins,
|
||||||
Yara,
|
Yara,
|
||||||
Config,
|
Config,
|
||||||
|
@ -238,9 +238,6 @@ namespace hex::fs {
|
|||||||
case ImHexPath::PatternsInclude:
|
case ImHexPath::PatternsInclude:
|
||||||
result = appendPath(getDataPaths(), "includes");
|
result = appendPath(getDataPaths(), "includes");
|
||||||
break;
|
break;
|
||||||
case ImHexPath::Python:
|
|
||||||
result = appendPath(getDataPaths(), "python");
|
|
||||||
break;
|
|
||||||
case ImHexPath::Yara:
|
case ImHexPath::Yara:
|
||||||
result = appendPath(getDataPaths(), "yara");
|
result = appendPath(getDataPaths(), "yara");
|
||||||
break;
|
break;
|
||||||
|
@ -130,7 +130,6 @@ namespace hex::plugin::builtin {
|
|||||||
link("GNU libmagic", "", "https://www.darwinsys.com/file/");
|
link("GNU libmagic", "", "https://www.darwinsys.com/file/");
|
||||||
link("GLFW3", "", "https://github.com/glfw/glfw/");
|
link("GLFW3", "", "https://github.com/glfw/glfw/");
|
||||||
link("LLVM", "", "https://github.com/llvm/llvm-project/");
|
link("LLVM", "", "https://github.com/llvm/llvm-project/");
|
||||||
link("Python 3", "", "https://github.com/python/cpython/");
|
|
||||||
|
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
|
||||||
@ -143,15 +142,23 @@ namespace hex::plugin::builtin {
|
|||||||
ImGui::TableSetupColumn("Type");
|
ImGui::TableSetupColumn("Type");
|
||||||
ImGui::TableSetupColumn("Paths");
|
ImGui::TableSetupColumn("Paths");
|
||||||
|
|
||||||
constexpr static std::array<std::pair<const char *, fs::ImHexPath>, 8> PathTypes = {
|
constexpr static std::array<std::pair<const char *, fs::ImHexPath>, u32(fs::ImHexPath::END)> PathTypes = {
|
||||||
{{ "Resources", fs::ImHexPath::Resources },
|
{
|
||||||
{ "Config", fs::ImHexPath::Config },
|
{ "Patterns", fs::ImHexPath::Patterns },
|
||||||
{ "Magic", fs::ImHexPath::Magic },
|
{ "Patterns Includes", fs::ImHexPath::PatternsInclude },
|
||||||
{ "Patterns", fs::ImHexPath::Patterns },
|
{ "Magic", fs::ImHexPath::Magic },
|
||||||
{ "Patterns Includes", fs::ImHexPath::PatternsInclude },
|
{ "Plugins", fs::ImHexPath::Plugins },
|
||||||
{ "Plugins", fs::ImHexPath::Plugins },
|
{ "Yara Patterns", fs::ImHexPath::Yara },
|
||||||
{ "Python Scripts", fs::ImHexPath::Python },
|
{ "Config", fs::ImHexPath::Config },
|
||||||
{ "Yara Patterns", fs::ImHexPath::Yara }}
|
{ "Resources", fs::ImHexPath::Resources },
|
||||||
|
{ "Constants lists", fs::ImHexPath::Constants },
|
||||||
|
{ "Custom encodings", fs::ImHexPath::Encodings },
|
||||||
|
{ "Logs", fs::ImHexPath::Logs },
|
||||||
|
{ "Recent files", fs::ImHexPath::Recent },
|
||||||
|
{ "Scripts", fs::ImHexPath::Scripts },
|
||||||
|
{ "Themes", fs::ImHexPath::Themes },
|
||||||
|
{ "Data inspector scripts", fs::ImHexPath::Inspectors },
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ImGui::TableHeadersRow();
|
ImGui::TableHeadersRow();
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
from _imhex import *
|
|
||||||
import imhex_python.types as types
|
|
@ -1,44 +0,0 @@
|
|||||||
class ImHexTypeMeta(type):
|
|
||||||
def __new__(cls, name, bases, dct):
|
|
||||||
return super().__new__(cls, name, bases, dct)
|
|
||||||
|
|
||||||
def __getitem__(self, value):
|
|
||||||
return array(self, value)
|
|
||||||
|
|
||||||
class ImHexType(metaclass=ImHexTypeMeta):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class u8(ImHexType):
|
|
||||||
pass
|
|
||||||
class u16(ImHexType):
|
|
||||||
pass
|
|
||||||
class u32(ImHexType):
|
|
||||||
pass
|
|
||||||
class u64(ImHexType):
|
|
||||||
pass
|
|
||||||
class u128(ImHexType):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class s8(ImHexType):
|
|
||||||
pass
|
|
||||||
class s16(ImHexType):
|
|
||||||
pass
|
|
||||||
class s32(ImHexType):
|
|
||||||
pass
|
|
||||||
class s64(ImHexType):
|
|
||||||
pass
|
|
||||||
class s128(ImHexType):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class float(ImHexType):
|
|
||||||
pass
|
|
||||||
class double(ImHexType):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class array(ImHexType):
|
|
||||||
def __init__(self, array_type, size):
|
|
||||||
self.array_type = array_type()
|
|
||||||
self.size = size
|
|
||||||
|
|
||||||
array_type : type
|
|
||||||
size : int
|
|
Loading…
Reference in New Issue
Block a user