3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/security/hashcat/default.nix
ElXreno 92a5fe180a
hashcat: 6.2.1 -> 6.2.2 (#126820)
Change-Id: I3aa4d98b448b1a046cdcc103011c58a1a67c23de
2021-06-14 18:57:27 +02:00

49 lines
1.2 KiB
Nix

{ lib, stdenv
, fetchurl
, makeWrapper
, opencl-headers
, ocl-icd
, xxHash
}:
stdenv.mkDerivation rec {
pname = "hashcat";
version = "6.2.2";
src = fetchurl {
url = "https://hashcat.net/files/hashcat-${version}.tar.gz";
sha256 = "0xbs3i5g2w8h5031jwgm13algs3f721k12fghnwfzi05fmzw8d0f";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ opencl-headers xxHash ];
makeFlags = [
"PREFIX=${placeholder "out"}"
"COMPTIME=1337"
"VERSION_TAG=${version}"
"USE_SYSTEM_OPENCL=1"
"USE_SYSTEM_XXHASH=1"
];
preFixup = ''
for f in $out/share/hashcat/OpenCL/*.cl; do
# Rewrite files to be included for compilation at runtime for opencl offload
sed "s|#include \"\(.*\)\"|#include \"$out/share/hashcat/OpenCL/\1\"|g" -i "$f"
sed "s|#define COMPARE_\([SM]\) \"\(.*\.cl\)\"|#define COMPARE_\1 \"$out/share/hashcat/OpenCL/\2\"|g" -i "$f"
done
'';
postFixup = ''
wrapProgram $out/bin/hashcat --prefix LD_LIBRARY_PATH : ${ocl-icd}/lib
'';
meta = with lib; {
description = "Fast password cracker";
homepage = "https://hashcat.net/hashcat/";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ kierdavis zimbatm ];
};
}