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] 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"