Change:
Project description Is it possible to add OpenCL support to ? Details can be found by link below: Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:
I tried but I'm getting a weird linker error: I have no idea what causes it. Looking at the source, it looks perfectly fine.
CC
Worked around it with . PR:

Discussion:
<del> { lib, stdenv, fetchFromGitHub, openssl, nss, nspr, libkrb5, gmp, zlib, libpcap, re2 , gcc, python3Packages, perl, perlPackages, makeWrapper, }: </del> <ins> { lib, stdenv, fetchFromGitHub, openssl, nss, nspr, libkrb5, gmp, zlib, libpcap, re2, gcc, python3Packages, perl, perlPackages, withOpenCL ? true, opencl-headers, ocl-icd, substituteAll, makeWrapper, }: </ins> stdenv.mkDerivation rec { pname = "john";

hash = "sha256-zvoN+8Sx6qpVg2JeRLOIH1ehfl3tFTv7r5wQZ44Qsbc="; }; <ins> patches = lib.optionals withOpenCL [ (substituteAll { src = ./opencl.patch; ocl_icd = ocl-icd; }) ]; </ins> postPatch = '' sed -ri -e ' s!^(#defines+CFG_[A-Z]+_NAMEs+).*/!1"'"$out"'/etc/john/!

}' run/*.conf ''; <del> preConfigure = '' cd src # Makefile.in depends on AS and LD being set to CC, which is set by default in configure.ac. # This ensures we override the environment variables set in cc-wrapper/setup-hook.sh export AS=$CC export LD=$CC ''; </del> <ins> preConfigure = '' cd src # Makefile.in depends on AS and LD being set to CC, which is set by default in configure.ac. # This ensures we override the environment variables set in cc-wrapper/setup-hook.sh export AS=$CC export LD=$CC '' + lib.optionalString withOpenCL '' python ./opencl_generate_dynamic_loader.py  # Update opencl_dynamic_loader.c ''; </ins> configureFlags = [ "--disable-native-tests" "--with-systemwide" ]; <del> buildInputs = [ openssl nss nspr libkrb5 gmp zlib libpcap re2 ]; nativeBuildInputs = [ gcc python3Packages.wrapPython perl makeWrapper ]; propagatedBuildInputs = (with python3Packages; [ dpkt scapy lxml ]) ++ # For pcap2john.py (with perlPackages; [ DigestMD4 DigestSHA1 GetoptLong # For pass_gen.pl CompressRawLzma # For 7z2john.pl perlldap ]); # For sha-dump.pl # TODO: Get dependencies for radius2john.pl and lion2john-alt.pl </del> <ins> buildInputs = [ openssl nss nspr libkrb5 gmp zlib libpcap re2 ] ++ lib.optionals withOpenCL [ opencl-headers ocl-icd ]; nativeBuildInputs = [ gcc python3Packages.wrapPython perl makeWrapper ]; propagatedBuildInputs = # For pcap2john.py (with python3Packages; [ dpkt scapy lxml ]) ++ (with perlPackages; [ # For pass_gen.pl DigestMD4 DigestSHA1 GetoptLong # For 7z2john.pl CompressRawLzma # For sha-dump.pl perlldap ]); # TODO: Get dependencies for radius2john.pl and lion2john-alt.pl </ins> # gcc -DAC_BUILT -Wall vncpcap2john.o memdbg.o -g    -lpcap -fopenmp -o ../run/vncpcap2john # gcc: error: memdbg.o: No such file or directory

description = "John the Ripper password cracker"; license = licenses.gpl2Plus; homepage = "https://github.com/openwall/john/"; <del> maintainers = with maintainers; [ offline matthewbauer cherrykitten ]; </del> <ins> maintainers = with maintainers; [ offline matthewbauer cherrykitten ]; </ins> platforms = platforms.unix; }; }

<ins> diff --git a/src/opencl_generate_dynamic_loader.py b/src/opencl_generate_dynamic_loader.py index 790705330..2acedbc56 100755 --- a/src/opencl_generate_dynamic_loader.py +++ b/src/opencl_generate_dynamic_loader.py @@ -134,12 +134,7 @@ static void load_opencl_dll(void) /* Names to try to load */ const char * const opencl_names[] = { -		"libOpenCL.so",		/* Linux/others, hack via "development" sub-package's symlink */ -		"OpenCL",		/* _WIN */ -		"/System/Library/Frameworks/OpenCL.framework/OpenCL", /* __APPLE__ */ -		"opencl.dll",		/* __CYGWIN__ */ -		"cygOpenCL-1.dll",	/* __CYGWIN__ */ -		"libOpenCL.so.1"	/* Linux/others, no "development" sub-package installed */ +		"@ocl_icd@/lib/libOpenCL.so"	/* NixOS */ }; for (i = 0; i < sizeof(opencl_names)/sizeof(opencl_names[0]); i++) { </ins>