nixpkgs/pkgs/applications/editors/imhex/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
1.7 KiB
Nix
Raw Normal View History

2022-08-01 07:39:10 +00:00
{ lib
, gcc12Stdenv
, cmake
, llvm
, fetchFromGitHub
, mbedtls
, gtk3
, pkg-config
, capstone
, dbus
, libGLU
, glfw3
, file
, perl
, python3
, jansson
, curl
, fmt_8
, nlohmann_json
, yara
}:
let
# when bumping the version, check if imhex has gotten support for the capstone version in nixpkgs
2023-03-28 12:14:02 +00:00
version = "1.27.1";
2022-08-01 07:39:10 +00:00
patterns_src = fetchFromGitHub {
owner = "WerWolv";
repo = "ImHex-Patterns";
rev = "ImHex-v${version}";
2023-03-28 12:14:02 +00:00
hash = "sha256-7Aaj+W+zXjHO8A2gmWtp5Pa/i5Uk8lXzX2WHjPIPRZI=";
2022-08-01 07:39:10 +00:00
};
in
gcc12Stdenv.mkDerivation rec {
pname = "imhex";
inherit version;
src = fetchFromGitHub {
fetchSubmodules = true;
owner = "WerWolv";
repo = pname;
rev = "v${version}";
2023-03-28 12:14:02 +00:00
hash = "sha256-meOx8SkufXbXuBIVefr/mO9fsUi3zeQmqmf86+aDMaI=";
2022-08-01 07:39:10 +00:00
};
nativeBuildInputs = [ cmake llvm python3 perl pkg-config ];
2022-08-01 07:39:10 +00:00
buildInputs = [
capstone
curl
dbus
file
fmt_8
glfw3
gtk3
jansson
libGLU
mbedtls
nlohmann_json
yara
];
cmakeFlags = [
"-DIMHEX_OFFLINE_BUILD=ON"
# see comment at the top about our version of capstone
"-DUSE_SYSTEM_CAPSTONE=OFF"
"-DUSE_SYSTEM_CURL=ON"
"-DUSE_SYSTEM_FMT=ON"
"-DUSE_SYSTEM_LLVM=ON"
"-DUSE_SYSTEM_NLOHMANN_JSON=ON"
"-DUSE_SYSTEM_YARA=ON"
];
postInstall = ''
mkdir -p $out/share/imhex
2022-08-01 07:39:10 +00:00
for d in ${patterns_src}/{constants,encodings,includes,magic,patterns}; do
cp -r $d $out/share/imhex/
done
'';
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 ];
maintainers = with maintainers; [ luis ];
platforms = platforms.linux;
};
}