about summary refs log tree commit diff
path: root/pkgs/development/python-modules/compiledb/default.nix
blob: 25472793cce0eadf19083f9cdbd3c53cdf71d79c (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
38
39
40
41
42
43
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytest
, bashlex
, click
, shutilwhich
, gcc
, coreutils
}:

buildPythonPackage rec {
  pname = "compiledb";
  version = "0.10.1";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "nickdiego";
    repo = pname;
    rev = "v${version}";
    sha256 = "0qricdgqzry7j3rmgwyd43av3c2kxpzkh6f9zcqbzrjkn78qbpd4";
  };

  # fix the tests
  patchPhase = ''
    substituteInPlace tests/data/multiple_commands_oneline.txt \
                      --replace /bin/echo ${coreutils}/bin/echo
  '';

  nativeCheckInputs = [ pytest gcc coreutils ];
  propagatedBuildInputs = [ click bashlex shutilwhich ];

  checkPhase = ''
    pytest
  '';

  meta = with lib; {
    description = "Tool for generating Clang's JSON Compilation Database files";
    license = licenses.gpl3;
    homepage = "https://github.com/nickdiego/compiledb";
    maintainers = with maintainers; [ multun ];
  };
}