diff --git a/pkgs/tools/security/hashcat/default.nix b/pkgs/tools/security/hashcat/default.nix index 93c4b4fcf742..dc7676ca764d 100644 --- a/pkgs/tools/security/hashcat/default.nix +++ b/pkgs/tools/security/hashcat/default.nix @@ -8,6 +8,7 @@ , opencl-headers , ocl-icd , xxHash +, Foundation, IOKit, Metal, OpenCL, libiconv }: stdenv.mkDerivation rec { @@ -19,13 +20,22 @@ stdenv.mkDerivation rec { sha256 = "sha256-sl4Qd7zzSQjMjxjBppouyYsEeyy88PURRNzzuh4Leyo="; }; + postPatch = '' + # Remove hardcoded paths on darwin + substituteInPlace src/Makefile \ + --replace "/usr/bin/ar" "ar" \ + --replace "/usr/bin/sed" "sed" \ + --replace '-i ""' '-i' + ''; + nativeBuildInputs = [ makeWrapper ] ++ lib.optionals cudaSupport [ addOpenGLRunpath ]; - buildInputs = [ opencl-headers xxHash ]; + buildInputs = [ opencl-headers xxHash ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation IOKit Metal OpenCL libiconv ]; makeFlags = [ "PREFIX=${placeholder "out"}" @@ -35,6 +45,8 @@ stdenv.mkDerivation rec { "USE_SYSTEM_XXHASH=1" ]; + enableParallelBuilding = true; + preFixup = '' for f in $out/share/hashcat/OpenCL/*.cl; do # Rewrite files to be included for compilation at runtime for opencl offload @@ -63,7 +75,7 @@ stdenv.mkDerivation rec { description = "Fast password cracker"; homepage = "https://hashcat.net/hashcat/"; license = licenses.mit; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ kierdavis zimbatm ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 523be31c5a0b..6bf8162bdbfc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8695,7 +8695,9 @@ with pkgs; hashcash = callPackage ../tools/security/hashcash { }; - hashcat = callPackage ../tools/security/hashcat { }; + hashcat = callPackage ../tools/security/hashcat { + inherit (darwin.apple_sdk.frameworks) Foundation IOKit Metal OpenCL; + }; hashcat-utils = callPackage ../tools/security/hashcat-utils { };