Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

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] https://github.com/hashcat/hashcat/commit/4177e1ee286f80c344f7bae6a65c40192f523e0a

+27 -4
+5 -4
pkgs/tools/security/hashcat/default.nix
··· 1 - { stdenv, fetchurl, makeWrapper, opencl-headers, ocl-icd }: 1 + { stdenv, fetchurl, makeWrapper, opencl-headers, ocl-icd, xxHash }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "hashcat-${version}"; 5 - version = "4.2.1"; 5 + version = "5.0.0"; 6 6 7 7 src = fetchurl { 8 8 url = "https://hashcat.net/files/hashcat-${version}.tar.gz"; 9 - sha256 = "082k5srjwkfvnvz0bfcg5r12m9c2qjyfhnp135mparkf831p7bbx"; 9 + sha256 = "13xh1lmzdppvx8wr8blqhdr8vpa24j099kz2xzb9pcnqy26dk4kh"; 10 10 }; 11 + patches = [ ./use-installed-xxhash.patch ]; 11 12 12 13 nativeBuildInputs = [ makeWrapper ]; 13 - buildInputs = [ opencl-headers ]; 14 + buildInputs = [ opencl-headers xxHash ]; 14 15 15 16 makeFlags = [ 16 17 "OPENCL_HEADERS_KHRONOS=${opencl-headers}/include"
+22
pkgs/tools/security/hashcat/use-installed-xxhash.patch
··· 1 + diff --git a/src/Makefile b/src/Makefile 2 + index 3a1cd680..576353fe 100644 3 + --- a/src/Makefile 4 + +++ b/src/Makefile 5 + @@ -189,7 +189,7 @@ endif 6 + # brain and xxHash 7 + ifeq ($(ENABLE_BRAIN),1) 8 + CFLAGS += -DWITH_BRAIN 9 + -CFLAGS += -Ideps/git/xxHash 10 + +LFLAGS += -lxxhash 11 + endif 12 + 13 + ## 14 + @@ -313,7 +313,7 @@ WIN_32_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).WIN.32.o) 15 + WIN_64_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).WIN.64.o) 16 + 17 + ifeq ($(ENABLE_BRAIN),1) 18 + -OBJS_XXHASH := xxhash 19 + +OBJS_XXHASH := 20 + 21 + NATIVE_STATIC_OBJS += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).NATIVE.STATIC.o) 22 + NATIVE_SHARED_OBJS += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).NATIVE.SHARED.o)