zipline: refactor environment variables (#377101)
[NixPkgs.git] / pkgs / by-name / li / libinjection / package.nix
blob1e8e6959f09bb587eb90ff4a8428e0e3e9a6bd16
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch,
6   python3,
7 }:
9 stdenv.mkDerivation rec {
10   pname = "libinjection";
11   version = "3.10.0";
13   src = fetchFromGitHub {
14     owner = "client9";
15     repo = pname;
16     tag = "v${version}";
17     sha256 = "0chsgam5dqr9vjfhdcp8cgk7la6nf3lq44zs6z6si98cq743550g";
18   };
20   nativeBuildInputs = [ python3 ];
22   strictDeps = true;
24   patches = [
25     (fetchpatch {
26       name = "support-python3-for-building";
27       url = "https://raw.githubusercontent.com/sysown/proxysql/bed58f92917eb651b80fd8ffa627a485eb320805/deps/libinjection/update-build-py3.diff";
28       hash = "sha256-SPdf57FIDDNpatWe5pjhAiZl5yPMDEv50k0Wj+eWTEM=";
29     })
30   ];
32   postPatch = ''
33     patchShebangs src
34     substituteInPlace src/Makefile \
35       --replace /usr/local $out
36   '';
38   configurePhase = "cd src";
39   buildPhase = "make all";
41   # no binaries, so out = library, dev = headers
42   outputs = [
43     "out"
44     "dev"
45   ];
47   meta = with lib; {
48     description = "SQL / SQLI tokenizer parser analyzer";
49     homepage = "https://github.com/client9/libinjection";
50     license = licenses.bsd3;
51     platforms = platforms.all;
52     maintainers = with maintainers; [ thoughtpolice ];
53   };