summary refs log tree commit diff
path: root/pkgs/development/libraries/libinjection/default.nix
blob: b3bdbb41588ab3606f9932ad3ce844c3fea4f5ee (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
, python
}:

stdenv.mkDerivation rec {
  pname   = "libinjection";
  version = "3.10.0";

  src = fetchFromGitHub {
    owner  = "client9";
    repo   = pname;
    rev    = "refs/tags/v${version}";
    sha256 = "0chsgam5dqr9vjfhdcp8cgk7la6nf3lq44zs6z6si98cq743550g";
  };

  nativeBuildInputs = [ python ];

  patchPhase = ''
    patchShebangs src
    substituteInPlace src/Makefile \
      --replace /usr/local $out
  '';

  configurePhase = "cd src";
  buildPhase = "make all";

  # no binaries, so out = library, dev = headers
  outputs = [ "out" "dev" ];

  meta = with stdenv.lib; {
    description = "SQL / SQLI tokenizer parser analyzer";
    homepage    = "https://github.com/client9/libinjection";
    license     = licenses.bsd3;
    platforms   = platforms.all;
    maintainers = with maintainers; [ thoughtpolice ];
  };
}