hashcat: support darwin (#244289)
This commit is contained in:
parent
8fc69b0a8a
commit
ebefd134e5
2 changed files with 17 additions and 3 deletions
|
@ -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 ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue