nixpkgs/pkgs/tools/security/hashcat/default.nix
Kier Davis df462d09e4
hashcat: 4.2.1 -> 5.0.0
This introduces a dependency on xxHash. Unfortunately, hashcat's
build system wants to rebuild xxHash from the source code located
in `<hashcat source root>/deps/git/xxHash`, a Git submodule whose
contents are not included in the source tarball we currently
download.

This could be fixed by either using a recursive git clone instead
a tarball download, or patching the build files to use an existing
installation of xxHash (i.e. the one already provided by Nix). I
believe the latter is preferable since it avoids the situation in
which the xxHash version used by hashcat is different to the xxHash
version used by all other Nix packages.

Fortunately, this situation has been greatly improved [1] since
release 5.0.0; the next release of hashcat should drop usage of
git submodules and provide better support for using existing
installations of dependencies.

[1] 4177e1ee28
2018-11-17 20:10:52 +00:00

41 lines
1.1 KiB
Nix

{ stdenv, fetchurl, makeWrapper, opencl-headers, ocl-icd, xxHash }:
stdenv.mkDerivation rec {
name = "hashcat-${version}";
version = "5.0.0";
src = fetchurl {
url = "https://hashcat.net/files/hashcat-${version}.tar.gz";
sha256 = "13xh1lmzdppvx8wr8blqhdr8vpa24j099kz2xzb9pcnqy26dk4kh";
};
patches = [ ./use-installed-xxhash.patch ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ opencl-headers xxHash ];
makeFlags = [
"OPENCL_HEADERS_KHRONOS=${opencl-headers}/include"
"COMPTIME=1337"
"VERSION_TAG=${version}"
];
# $out is not known until the build has started.
configurePhase = ''
runHook preConfigure
makeFlags="$makeFlags PREFIX=$out"
runHook postConfigure
'';
postFixup = ''
wrapProgram $out/bin/hashcat --prefix LD_LIBRARY_PATH : ${ocl-icd}/lib
'';
meta = with stdenv.lib; {
description = "Fast password cracker";
homepage = https://hashcat.net/hashcat/;
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ kierdavis zimbatm ];
};
}