16 , withGui ? true, wrapQtAppsHook, qtbase
17 , withPython ? true, python3
18 , withBlueshark ? false, bluez5
21 , withoutFunctions ? []
22 , hardwarePlatform ? if withGeneric then "PM3GENERIC" else "PM3RDV4"
23 , hardwarePlatformExtras ? lib.optionalString withBlueshark "BTADDON"
24 , standalone ? "LF_SAMYRUN"
26 assert withBlueshark -> stdenv.hostPlatform.isLinux;
27 stdenv.mkDerivation (finalAttrs: {
31 src = fetchFromGitHub {
32 owner = "RfidResearchGroup";
34 rev = "v${finalAttrs.version}";
35 hash = "sha256-LeVQnidlCGFwtgJZdGlIFEYgf3M3BtfxoBKsxSFEo2w=";
39 # Don't check for DISPLAY env variable on Darwin. pm3 uses this to test if
40 # XQuartz is installed, however it is not actually required for GUI features
41 ./darwin-always-gui.patch
45 # Remove hardcoded paths on Darwin
46 substituteInPlace Makefile.defs \
47 --replace "/usr/bin/ar" "ar" \
48 --replace "/usr/bin/ranlib" "ranlib"
49 # Replace hardcoded path to libwhereami
50 substituteInPlace client/Makefile \
51 --replace "/usr/include/whereami.h" "${whereami}/include/whereami.h"
57 ] ++ lib.optional withGui wrapQtAppsHook;
67 ] ++ lib.optional withGui qtbase
68 ++ lib.optional withPython python3
69 ++ lib.optional withBlueshark bluez5
70 ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation AppKit ];
73 "PREFIX=${placeholder "out"}"
74 "UDEV_PREFIX=${placeholder "out"}/etc/udev/rules.d"
75 "PLATFORM=${hardwarePlatform}"
76 "PLATFORM_EXTRAS=${hardwarePlatformExtras}"
77 "STANDALONE=${standalone}"
79 ] ++ lib.optional withSmall "PLATFORM_SIZE=256"
80 ++ map (x: "SKIP_${x}=1") withoutFunctions;
81 enableParallelBuilding = true;
84 description = "Client for proxmark3, powerful general purpose RFID tool";
85 homepage = "https://github.com/RfidResearchGroup/proxmark3";
86 license = licenses.gpl3Plus;
87 maintainers = with maintainers; [ nyanotech emilytrau ];
88 platforms = platforms.unix;