imhex: 1.37.4 -> 1.38.1

This commit is contained in:
Mrmaxmeier
2025-12-12 11:09:35 +01:00
parent a6531044f6
commit f2642a9101

View File

@@ -20,22 +20,21 @@
fmt_11,
nlohmann_json,
yara,
rsync,
nix-update-script,
autoPatchelfHook,
makeWrapper,
}:
let
version = "1.37.4";
patterns_version = "1.37.4";
version = "1.38.1";
patterns_version = "1.38.1";
patterns_src = fetchFromGitHub {
name = "ImHex-Patterns-source-${patterns_version}";
owner = "WerWolv";
repo = "ImHex-Patterns";
tag = "ImHex-v${patterns_version}";
hash = "sha256-2NgMYaG6+XKp0fIHAn3vAcoXXa3EF4HV01nI+t1IL1U=";
hash = "sha256-MqQHzR5lKWhQI6pIX1kbAPDVG18UrMJM45mtIe/ggJE=";
};
in
@@ -49,7 +48,7 @@ stdenv.mkDerivation (finalAttrs: {
owner = "WerWolv";
repo = "ImHex";
tag = "v${finalAttrs.version}";
hash = "sha256-uenwAaIjtBzrtiLdy6fh5TxtbWtUJbtybNOLP3+8blA=";
hash = "sha256-lkpFiXuEF72nBkPuInv683Ct1Uu+uZ0PGejI9cVEUp0=";
};
strictDeps = true;
@@ -60,7 +59,6 @@ stdenv.mkDerivation (finalAttrs: {
python3
perl
pkg-config
rsync
makeWrapper
]
++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
@@ -78,6 +76,7 @@ stdenv.mkDerivation (finalAttrs: {
mbedtls
nlohmann_json
yara
llvm
];
# autoPatchelfHook only searches for *.so and *.so.*, and won't find *.hexpluglib
@@ -104,17 +103,18 @@ stdenv.mkDerivation (finalAttrs: {
env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
# Comment out fixup_bundle in PostprocessBundle.cmake as we are not building a standalone application
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
postPatch = ''
# Link patterns source into location expected by cmake when IMHEX_OFFLINE_BUILD is set
ln -s ${patterns_src} ImHex-Patterns
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace cmake/modules/PostprocessBundle.cmake \
--replace-fail "fixup_bundle" "#fixup_bundle"
'';
# rsync is used here so we can not copy the _schema.json files
postInstall =
if stdenv.hostPlatform.isLinux then
''
mkdir -p $out/share/imhex
rsync -av --exclude="*_schema.json" ${patterns_src}/{constants,encodings,includes,magic,nodes,patterns} $out/share/imhex
# without this imhex is not able to find pattern files
wrapProgram $out/bin/imhex --prefix XDG_DATA_DIRS : $out/share
''
@@ -122,7 +122,6 @@ stdenv.mkDerivation (finalAttrs: {
''
mkdir -p $out/Applications
mv $out/imhex.app $out/Applications
rsync -av --exclude="*_schema.json" ${patterns_src}/{constants,encodings,includes,magic,nodes,patterns} "$out/Applications/imhex.app/Contents/MacOS"
install_name_tool \
-change "$out/lib/libimhex.${finalAttrs.version}${stdenv.hostPlatform.extensions.sharedLibrary}" \
"@executable_path/../Frameworks/libimhex.${finalAttrs.version}${stdenv.hostPlatform.extensions.sharedLibrary}" \