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

hashcat: 0.49 -> 2.00

The current URL is broken, upstream has moved the download from .../files/ to
.../files_legacy/. But after fixing that, starting hashcat results in:

$ ./result/bin/hashcat
ERROR: this copy of hashcat is outdated. Get a more recent version.

So just update to latest.

New releases are on github, the license is now MIT and there are build
system changes.

+11 -21
+11 -21
pkgs/tools/security/hashcat/default.nix
··· 1 - { stdenv, fetchurl, p7zip, patchelf, gmp }: 1 + { stdenv, fetchurl, gmp }: 2 2 3 3 assert stdenv.isLinux; 4 4 5 5 let 6 - bits = if stdenv.system == "x86_64-linux" then "64" else "32"; 7 - libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc gmp ]; 8 - 9 - fixBin = x: '' 10 - patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 11 - --set-rpath ${libPath} ${x} 12 - ''; 6 + bits = if stdenv.system == "x86_64-linux" then "64" else "32"; 13 7 in 14 8 stdenv.mkDerivation rec { 15 9 name = "hashcat-${version}"; 16 - version = "0.49"; 10 + version = "2.00"; 17 11 18 12 src = fetchurl { 19 - url = "http://hashcat.net/files/${name}.7z"; 20 - sha256 = "0va07flncihgmnri5wj0jn636w86x5qwm4jmj2halcyg7qwqijh2"; 13 + name = "${name}.tar.gz"; 14 + url = "https://codeload.github.com/hashcat/hashcat/tar.gz/${version}"; 15 + sha256 = "0i2l4i1jkdhj9bkvycgd2nf809kki3jp83y0vrd4iwsdbbbyc9b3"; 21 16 }; 22 17 23 - buildInputs = [ p7zip patchelf ]; 18 + buildInputs = [ gmp ]; 24 19 25 - unpackPhase = "7z x $src > /dev/null && cd ${name}"; 20 + buildFlags = [ "posix${bits}" ] 21 + ++ stdenv.lib.optionals (bits == "64") [ "posixXOP" "posixAVX" ]; 26 22 23 + # Upstream Makefile doesn't have 'install' target 27 24 installPhase = '' 28 25 mkdir -p $out/bin $out/libexec 29 26 cp -R * $out/libexec 30 27 31 - echo -n "/" > $out/bin/eula.accepted 32 28 ln -s $out/libexec/hashcat-cli${bits}.bin $out/bin/hashcat 33 29 ln -s $out/libexec/hashcat-cliXOP.bin $out/bin/hashcat-xop 34 30 ln -s $out/libexec/hashcat-cliAVX.bin $out/bin/hashcat-avx 35 31 ''; 36 32 37 - fixupPhase = '' 38 - ${fixBin "$out/libexec/hashcat-cli${bits}.bin"} 39 - ${fixBin "$out/libexec/hashcat-cliXOP.bin"} 40 - ${fixBin "$out/libexec/hashcat-cliAVX.bin"} 41 - ''; 42 - 43 33 meta = { 44 34 description = "Fast password cracker"; 45 35 homepage = "http://hashcat.net/hashcat/"; 46 - license = stdenv.lib.licenses.unfreeRedistributable; 36 + license = stdenv.lib.licenses.mit; 47 37 platforms = stdenv.lib.platforms.linux; 48 38 maintainers = [ stdenv.lib.maintainers.thoughtpolice ]; 49 39 };