From c1d56239b8fb7754c71ebf6f85cac98d188ffc0b Mon Sep 17 00:00:00 2001 From: fasheng Date: Mon, 22 Feb 2021 09:37:51 +0800 Subject: [PATCH] hashcat: Fix OpenCL support for ROCm Fix OpenCL issue like darktable did. Confirm that `hashcat -b -m 2500` can be successfully executed on ROCm/RX 580. --- pkgs/tools/security/hashcat/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/security/hashcat/default.nix b/pkgs/tools/security/hashcat/default.nix index 20b5aed39320..173fdc8b18d2 100644 --- a/pkgs/tools/security/hashcat/default.nix +++ b/pkgs/tools/security/hashcat/default.nix @@ -26,6 +26,12 @@ stdenv.mkDerivation rec { "USE_SYSTEM_XXHASH=1" ]; + preFixup = '' + for f in $out/share/hashcat/OpenCL/*.cl; do + sed "s|#include \"\(.*\)\"|#include \"$out/share/hashcat/OpenCL/\1\"|g" -i "$f" + done + ''; + postFixup = '' wrapProgram $out/bin/hashcat --prefix LD_LIBRARY_PATH : ${ocl-icd}/lib '';