From fe47a55fa3c957bc37e32ed66147fbc4bf546fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sat, 29 Jun 2024 20:28:23 -0400 Subject: [PATCH 1/3] imhex: 1.33.2 -> 1.35.3 --- pkgs/by-name/im/imhex/package.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/im/imhex/package.nix b/pkgs/by-name/im/imhex/package.nix index da3a2b4e20fa..7a5535cbd5b2 100644 --- a/pkgs/by-name/im/imhex/package.nix +++ b/pkgs/by-name/im/imhex/package.nix @@ -22,14 +22,15 @@ }: let - version = "1.33.2"; - patterns_version = "1.33.2"; + version = "1.35.3"; + patterns_version = "1.35.3"; patterns_src = fetchFromGitHub { + name = "ImHex-Patterns-source-${patterns_version}"; owner = "WerWolv"; repo = "ImHex-Patterns"; rev = "ImHex-v${patterns_version}"; - hash = "sha256-5a6aFT8R8vMzPS+Y+fcDV5+olhioEpLjdMqa7qOyGsw="; + hash = "sha256-h86qoFMSP9ehsXJXOccUK9Mfqe+DVObfSRT4TCtK0rY="; }; in @@ -38,11 +39,12 @@ stdenv.mkDerivation rec { inherit version; src = fetchFromGitHub { + name = "ImHex-source-${version}"; fetchSubmodules = true; owner = "WerWolv"; - repo = pname; - rev = "v${version}"; - hash = "sha256-8Ehpk0TjE4itQ7D9Nx74plYwABVufuYmxfxyuSqak1c="; + repo = "ImHex"; + rev = "refs/tags/v${version}"; + hash = "sha256-8vhOOHfg4D9B9yYgnGZBpcjAjuL4M4oHHax9ad5PJtA="; }; nativeBuildInputs = [ cmake llvm python3 perl pkg-config rsync ]; From 1db62e6fb734146b49d057ca9350510fd158ad88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sat, 29 Jun 2024 20:59:05 -0400 Subject: [PATCH 2/3] imhex: fix RUNPATH to find libGL and plugins --- pkgs/by-name/im/imhex/package.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/im/imhex/package.nix b/pkgs/by-name/im/imhex/package.nix index 7a5535cbd5b2..a30de68669a3 100644 --- a/pkgs/by-name/im/imhex/package.nix +++ b/pkgs/by-name/im/imhex/package.nix @@ -9,6 +9,7 @@ , capstone , dbus , libGLU +, libGL , glfw3 , file , perl @@ -19,6 +20,7 @@ , nlohmann_json , yara , rsync +, autoPatchelfHook }: let @@ -47,7 +49,7 @@ stdenv.mkDerivation rec { hash = "sha256-8vhOOHfg4D9B9yYgnGZBpcjAjuL4M4oHHax9ad5PJtA="; }; - nativeBuildInputs = [ cmake llvm python3 perl pkg-config rsync ]; + nativeBuildInputs = [ autoPatchelfHook cmake llvm python3 perl pkg-config rsync ]; buildInputs = [ capstone @@ -64,6 +66,14 @@ stdenv.mkDerivation rec { yara ]; + # autoPatchelfHook only searches for *.so and *.so.*, and won't find *.hexpluglib + # however, we will append to RUNPATH ourselves + autoPatchelfIgnoreMissingDeps = [ "*.hexpluglib" ]; + appendRunpaths = [ + (lib.makeLibraryPath [ libGL ]) + "${placeholder "out"}/lib/imhex/plugins" + ]; + cmakeFlags = [ "-DIMHEX_OFFLINE_BUILD=ON" "-DUSE_SYSTEM_CAPSTONE=ON" From 3728d33b72684639dccaaae6aa6d16a26198490d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sat, 29 Jun 2024 20:59:47 -0400 Subject: [PATCH 3/3] imhex: nixfmt-rfc-style --- pkgs/by-name/im/imhex/package.nix | 62 ++++++++++++++++++------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/pkgs/by-name/im/imhex/package.nix b/pkgs/by-name/im/imhex/package.nix index a30de68669a3..a1b55f16899d 100644 --- a/pkgs/by-name/im/imhex/package.nix +++ b/pkgs/by-name/im/imhex/package.nix @@ -1,26 +1,27 @@ -{ lib -, stdenv -, cmake -, llvm -, fetchFromGitHub -, mbedtls -, gtk3 -, pkg-config -, capstone -, dbus -, libGLU -, libGL -, glfw3 -, file -, perl -, python3 -, jansson -, curl -, fmt_8 -, nlohmann_json -, yara -, rsync -, autoPatchelfHook +{ + lib, + stdenv, + cmake, + llvm, + fetchFromGitHub, + mbedtls, + gtk3, + pkg-config, + capstone, + dbus, + libGLU, + libGL, + glfw3, + file, + perl, + python3, + jansson, + curl, + fmt_8, + nlohmann_json, + yara, + rsync, + autoPatchelfHook, }: let @@ -49,7 +50,15 @@ stdenv.mkDerivation rec { hash = "sha256-8vhOOHfg4D9B9yYgnGZBpcjAjuL4M4oHHax9ad5PJtA="; }; - nativeBuildInputs = [ autoPatchelfHook cmake llvm python3 perl pkg-config rsync ]; + nativeBuildInputs = [ + autoPatchelfHook + cmake + llvm + python3 + perl + pkg-config + rsync + ]; buildInputs = [ capstone @@ -94,7 +103,10 @@ stdenv.mkDerivation rec { 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; [ kashw2 cafkafk ]; + maintainers = with maintainers; [ + kashw2 + cafkafk + ]; platforms = platforms.linux; }; }