From dd4a80196d23f6b61e6b32cacab493e9cf55da3a Mon Sep 17 00:00:00 2001 From: nyanotech Date: Tue, 25 Jul 2023 13:19:40 -0700 Subject: proxmark3: Replace with rfidresearchgroup fork Looking at https://repology.org/project/proxmark3/versions, it seems like all the other distros that have proxmark3 packaged package the fork version. Additionally, the upstream version hasn't been updated in some time. --- pkgs/tools/security/proxmark3/default.nix | 131 ++++++++++++++---------- pkgs/tools/security/proxmark3/proxmark3-rrg.nix | 86 ---------------- pkgs/top-level/aliases.nix | 2 + pkgs/top-level/all-packages.nix | 5 +- 4 files changed, 81 insertions(+), 143 deletions(-) delete mode 100644 pkgs/tools/security/proxmark3/proxmark3-rrg.nix diff --git a/pkgs/tools/security/proxmark3/default.nix b/pkgs/tools/security/proxmark3/default.nix index b52e7279fa98e..48d0d4a0ee141 100644 --- a/pkgs/tools/security/proxmark3/default.nix +++ b/pkgs/tools/security/proxmark3/default.nix @@ -1,61 +1,86 @@ -{ lib, stdenv, fetchFromGitHub, pkg-config, ncurses, readline, pcsclite, qt5 -, gcc-arm-embedded }: +{ lib +, stdenv +, fetchFromGitHub +, pkg-config +, gcc-arm-embedded +, readline +, bzip2 +, openssl +, jansson +, whereami +, lua +, Foundation +, AppKit +, withGui ? true, wrapQtAppsHook, qtbase +, withPython ? true, python3 +, withBlueshark ? false, bluez5 +, withGeneric ? false +, withSmall ? false +, withoutFunctions ? [] +, hardwarePlatform ? if withGeneric then "PM3GENERIC" else "PM3RDV4" +, hardwarePlatformExtras ? lib.optionalString withBlueshark "BTADDON" +, standalone ? "LF_SAMYRUN" +}: +assert withBlueshark -> stdenv.hostPlatform.isLinux; +stdenv.mkDerivation rec { + pname = "proxmark3"; + version = "4.16717"; -let - generic = { pname, version, rev, sha256 }: - stdenv.mkDerivation rec { - inherit pname version; - - src = fetchFromGitHub { - owner = "Proxmark"; - repo = "proxmark3"; - inherit rev sha256; - }; - - nativeBuildInputs = [ pkg-config gcc-arm-embedded ]; - buildInputs = [ ncurses readline pcsclite qt5.qtbase ]; - - dontWrapQtApps = true; - - postPatch = '' - substituteInPlace client/Makefile --replace '-ltermcap' ' ' - substituteInPlace liblua/Makefile --replace '-ltermcap' ' ' - substituteInPlace client/flasher.c \ - --replace 'armsrc/obj/fullimage.elf' \ - '${placeholder "out"}/firmware/fullimage.elf' - ''; + src = fetchFromGitHub { + owner = "RfidResearchGroup"; + repo = "proxmark3"; + rev = "v${version}"; + sha256 = "sha256-rkfVgT+9fqlWvUXzLH28Nzd8HldJnU+IZz8conY8Mis="; + }; - buildPhase = '' - make bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf client - ''; + patches = [ + # Don't check for DISPLAY env variable on Darwin. pm3 uses this to test if + # XQuartz is installed, however it is not actually required for GUI features + ./darwin-always-gui.patch + ]; - installPhase = '' - install -Dt $out/bin client/proxmark3 - install -T client/flasher $out/bin/proxmark3-flasher - install -Dt $out/firmware bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf - ''; + postPatch = '' + # Remove hardcoded paths on Darwin + substituteInPlace Makefile.defs \ + --replace "/usr/bin/ar" "ar" \ + --replace "/usr/bin/ranlib" "ranlib" + # Replace hardcoded path to libwhereami + substituteInPlace client/Makefile \ + --replace "/usr/include/whereami.h" "${whereami}/include/whereami.h" + ''; - meta = with lib; { - description = "Client for proxmark3, powerful general purpose RFID tool"; - homepage = "http://www.proxmark.org"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ fpletz ]; - }; - }; -in + nativeBuildInputs = [ + pkg-config + gcc-arm-embedded + ] ++ lib.optional withGui wrapQtAppsHook; + buildInputs = [ + readline + bzip2 + openssl + jansson + whereami + lua + ] ++ lib.optional withGui qtbase + ++ lib.optional withPython python3 + ++ lib.optional withBlueshark bluez5 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation AppKit ]; -{ - proxmark3 = generic rec { - pname = "proxmark3"; - version = "3.1.0"; - rev = "v${version}"; - sha256 = "1qw28n1bhhl91ix77lv50qcr919fq3hjc8zhhqphwxal2svgx2jf"; - }; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "UDEV_PREFIX=${placeholder "out"}/etc/udev/rules.d" + "PLATFORM=${hardwarePlatform}" + "PLATFORM_EXTRAS=${hardwarePlatformExtras}" + "STANDALONE=${standalone}" + "USE_BREW=0" + ] ++ lib.optional withSmall "PLATFORM_SIZE=256" + ++ map (x: "SKIP_${x}=1") withoutFunctions; + enableParallelBuilding = true; - proxmark3-unstable = generic { - pname = "proxmark3-unstable"; - version = "2019-12-28"; - rev = "a4ff62be63ca2a81071e9aa2b882bd3ff57f13ad"; - sha256 = "067lp28xqx61n3i2a2fy489r5frwxqrcfj8cpv3xdzi3gb3vk5c3"; + meta = with lib; { + description = "Client for proxmark3, powerful general purpose RFID tool"; + homepage = "https://github.com/RfidResearchGroup/proxmark3"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ nyanotech emilytrau ]; + platforms = platforms.unix; }; } diff --git a/pkgs/tools/security/proxmark3/proxmark3-rrg.nix b/pkgs/tools/security/proxmark3/proxmark3-rrg.nix deleted file mode 100644 index fc033125e8b60..0000000000000 --- a/pkgs/tools/security/proxmark3/proxmark3-rrg.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, pkg-config -, gcc-arm-embedded -, readline -, bzip2 -, openssl -, jansson -, whereami -, lua -, Foundation -, AppKit -, withGui ? true, wrapQtAppsHook, qtbase -, withPython ? true, python3 -, withBlueshark ? false, bluez5 -, withGeneric ? false -, withSmall ? false -, withoutFunctions ? [] -, hardwarePlatform ? if withGeneric then "PM3GENERIC" else "PM3RDV4" -, hardwarePlatformExtras ? lib.optionalString withBlueshark "BTADDON" -, standalone ? "LF_SAMYRUN" -}: -assert withBlueshark -> stdenv.hostPlatform.isLinux; -stdenv.mkDerivation rec { - pname = "proxmark3-rrg"; - version = "4.16717"; - - src = fetchFromGitHub { - owner = "RfidResearchGroup"; - repo = "proxmark3"; - rev = "v${version}"; - sha256 = "sha256-rkfVgT+9fqlWvUXzLH28Nzd8HldJnU+IZz8conY8Mis="; - }; - - patches = [ - # Don't check for DISPLAY env variable on Darwin. pm3 uses this to test if - # XQuartz is installed, however it is not actually required for GUI features - ./darwin-always-gui.patch - ]; - - postPatch = '' - # Remove hardcoded paths on Darwin - substituteInPlace Makefile.defs \ - --replace "/usr/bin/ar" "ar" \ - --replace "/usr/bin/ranlib" "ranlib" - # Replace hardcoded path to libwhereami - substituteInPlace client/Makefile \ - --replace "/usr/include/whereami.h" "${whereami}/include/whereami.h" - ''; - - nativeBuildInputs = [ - pkg-config - gcc-arm-embedded - ] ++ lib.optional withGui wrapQtAppsHook; - buildInputs = [ - readline - bzip2 - openssl - jansson - whereami - lua - ] ++ lib.optional withGui qtbase - ++ lib.optional withPython python3 - ++ lib.optional withBlueshark bluez5 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation AppKit ]; - - makeFlags = [ - "PREFIX=${placeholder "out"}" - "UDEV_PREFIX=${placeholder "out"}/etc/udev/rules.d" - "PLATFORM=${hardwarePlatform}" - "PLATFORM_EXTRAS=${hardwarePlatformExtras}" - "STANDALONE=${standalone}" - "USE_BREW=0" - ] ++ lib.optional withSmall "PLATFORM_SIZE=256" - ++ map (x: "SKIP_${x}=1") withoutFunctions; - enableParallelBuilding = true; - - meta = with lib; { - description = "Client for proxmark3, powerful general purpose RFID tool"; - homepage = "https://github.com/RfidResearchGroup/proxmark3"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ nyanotech emilytrau ]; - platforms = platforms.unix; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 7ac9b47e8bd92..3d865156c8f33 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1413,6 +1413,8 @@ mapAliases ({ protobuf3_11 = throw "protobuf3_11 does not receive updates anymore and has been removed"; # Added 2022-09-28 protobuf3_17 = throw "protobuf3_17 does not receive updates anymore and has been removed"; # Added 2023-05-21 protonup = protonup-ng; # Added 2022-11-06 + proxmark3-rrg = proxmark3; # Added 2023-07-25 + proxmark3-unstable = throw "removed in favor of rfidresearchgroup fork"; # Added 2023-07-25 proxytunnel = throw "proxytunnel has been removed from nixpkgs, because it has not been update upstream since it was added to nixpkgs in 2008 and has therefore bitrotted."; # added 2021-12-15 pulseaudio-hsphfpd = throw "pulseaudio-hsphfpd upstream has been abandoned"; # Added 2022-03-23 pulseaudio-modules-bt = throw "pulseaudio-modules-bt has been abandoned, and is superseded by pulseaudio's native bt functionality"; # Added 2022-04-01 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b3c828de6a37..9381a7d607e30 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11910,10 +11910,7 @@ with pkgs; prototypejs = callPackage ../development/libraries/prototypejs { }; - inherit (callPackages ../tools/security/proxmark3 { gcc-arm-embedded = gcc-arm-embedded-8; }) - proxmark3 proxmark3-unstable; - - proxmark3-rrg = libsForQt5.callPackage ../tools/security/proxmark3/proxmark3-rrg.nix { + proxmark3 = libsForQt5.callPackage ../tools/security/proxmark3/default.nix { inherit (darwin.apple_sdk.frameworks) Foundation AppKit; }; -- cgit 1.4.1