1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytest
5, bashlex
6, click
7, shutilwhich
8, gcc
9, coreutils
10}:
11
12buildPythonPackage rec {
13 pname = "compiledb";
14 version = "0.10.1";
15
16 src = fetchFromGitHub {
17 owner = "nickdiego";
18 repo = pname;
19 rev = "v${version}";
20 sha256 = "0qricdgqzry7j3rmgwyd43av3c2kxpzkh6f9zcqbzrjkn78qbpd4";
21 };
22
23 # fix the tests
24 patchPhase = ''
25 substituteInPlace tests/data/multiple_commands_oneline.txt \
26 --replace /bin/echo ${coreutils}/bin/echo
27 '';
28
29 nativeCheckInputs = [ pytest gcc coreutils ];
30 propagatedBuildInputs = [ click bashlex shutilwhich ];
31
32 checkPhase = ''
33 pytest
34 '';
35
36 meta = with lib; {
37 description = "Tool for generating Clang's JSON Compilation Database files";
38 license = licenses.gpl3;
39 homepage = "https://github.com/nickdiego/compiledb";
40 maintainers = with maintainers; [ multun ];
41 };
42}