summary refs log tree commit diff
path: root/pkgs/tools/security/proxmark3/default.nix
blob: afaed796057c4038dae260d42726f12dc0ed2127 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ stdenv, fetchFromGitHub, pkgconfig, ncurses, readline }:

stdenv.mkDerivation rec {
  pname = "proxmark3";
  version = "3.1.0";

  src = fetchFromGitHub {
    owner = "Proxmark";
    repo = pname;
    rev = "v${version}";
    sha256 = "1qw28n1bhhl91ix77lv50qcr919fq3hjc8zhhqphwxal2svgx2jf";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ ncurses readline ];

  postPatch = ''
    substituteInPlace client/Makefile --replace '-ltermcap' ' '
    substituteInPlace liblua/Makefile --replace '-ltermcap' ' '
  '';

  preBuild = ''
    cd client
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp proxmark3 $out/bin
  '';

  meta = with stdenv.lib; {
    description = "Client for proxmark3,  powerful general purpose RFID tool";
    homepage = http://www.proxmark.org;
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ fpletz ];
  };
}