2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
2023-05-24 13:37:59 +00:00
|
|
|
, stdenv
|
2022-10-21 18:38:19 +00:00
|
|
|
, cmake
|
|
|
|
, llvm
|
|
|
|
, fetchFromGitHub
|
|
|
|
, mbedtls
|
|
|
|
, gtk3
|
|
|
|
, pkg-config
|
|
|
|
, capstone
|
|
|
|
, dbus
|
|
|
|
, libGLU
|
|
|
|
, glfw3
|
|
|
|
, file
|
|
|
|
, perl
|
|
|
|
, python3
|
|
|
|
, jansson
|
|
|
|
, curl
|
|
|
|
, fmt_8
|
|
|
|
, nlohmann_json
|
|
|
|
, yara
|
2023-07-15 17:15:38 +00:00
|
|
|
, rsync
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-10-09 19:29:22 +00:00
|
|
|
# FIXME: unstable, stable needs #252945 (details in #258964)
|
|
|
|
# Next version bump should be stabilized
|
|
|
|
version = "unstable-2023-10-01";
|
|
|
|
patterns_version = "1.31.0";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
patterns_src = fetchFromGitHub {
|
|
|
|
owner = "WerWolv";
|
|
|
|
repo = "ImHex-Patterns";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "ImHex-v${patterns_version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-lTTXu9RxoD582lXWI789gNcWvJmxmBIlBRIiyY3DseM=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2023-05-24 13:37:59 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-10-21 18:38:19 +00:00
|
|
|
pname = "imhex";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
fetchSubmodules = true;
|
|
|
|
owner = "WerWolv";
|
|
|
|
repo = pname;
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "a62ede784018f9d5aaf40587f71a1271429ab50b";
|
|
|
|
hash = "sha256-L3ncmM7Ro60DvOF/Y0fjo2Smlw2LL8cPa8H6yVGdGAk=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [ cmake llvm python3 perl pkg-config rsync ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
capstone
|
|
|
|
curl
|
|
|
|
dbus
|
|
|
|
file
|
|
|
|
fmt_8
|
|
|
|
glfw3
|
|
|
|
gtk3
|
|
|
|
jansson
|
|
|
|
libGLU
|
|
|
|
mbedtls
|
|
|
|
nlohmann_json
|
|
|
|
yara
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DIMHEX_OFFLINE_BUILD=ON"
|
2023-07-15 17:15:38 +00:00
|
|
|
"-DUSE_SYSTEM_CAPSTONE=ON"
|
2022-10-21 18:38:19 +00:00
|
|
|
"-DUSE_SYSTEM_CURL=ON"
|
|
|
|
"-DUSE_SYSTEM_FMT=ON"
|
|
|
|
"-DUSE_SYSTEM_LLVM=ON"
|
|
|
|
"-DUSE_SYSTEM_NLOHMANN_JSON=ON"
|
|
|
|
"-DUSE_SYSTEM_YARA=ON"
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# rsync is used here so we can not copy the _schema.json files
|
2022-10-21 18:38:19 +00:00
|
|
|
postInstall = ''
|
2023-01-20 10:41:00 +00:00
|
|
|
mkdir -p $out/share/imhex
|
2023-07-15 17:15:38 +00:00
|
|
|
rsync -av --exclude="*_schema.json" ${patterns_src}/{constants,encodings,includes,magic,patterns} $out/share/imhex
|
2022-10-21 18:38:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM";
|
|
|
|
homepage = "https://github.com/WerWolv/ImHex";
|
|
|
|
license = with licenses; [ gpl2Only ];
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ luis kashw2 cafkafk ];
|
2022-10-21 18:38:19 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|