Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonApplication
3, fetchFromGitHub
4, bash
5, cmake
6, colordiff
7, flex
8, libclang
9, llvm
10, unifdef
11, chardet
12, pebble
13, psutil
14, pytestCheckHook
15}:
16
17buildPythonApplication rec {
18 pname = "cvise";
19 version = "2.8.0";
20 format = "other";
21
22 src = fetchFromGitHub {
23 owner = "marxin";
24 repo = "cvise";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-9HFCFgpRXqefFJLulwvi6nx0fl0G6IXI9gSinekJXRU=";
27 };
28
29 patches = [
30 # Refer to unifdef by absolute path.
31 ./unifdef.patch
32 ];
33
34 postPatch = ''
35 # Avoid blanket -Werror to evade build failures on less
36 # tested compilers.
37 substituteInPlace CMakeLists.txt \
38 --replace " -Werror " " "
39
40 # 'cvise --command=...' generates a script with hardcoded shebang.
41 substituteInPlace cvise.py \
42 --replace "#!/bin/bash" "#!${bash}/bin/bash"
43
44 substituteInPlace cvise/utils/testing.py \
45 --replace "'colordiff --version'" "'${colordiff}/bin/colordiff --version'" \
46 --replace "'colordiff'" "'${colordiff}/bin/colordiff'"
47 '';
48
49 nativeBuildInputs = [
50 cmake
51 flex
52 llvm.dev
53 ];
54
55 buildInputs = [
56 libclang
57 llvm
58 llvm.dev
59 unifdef
60 ];
61
62 propagatedBuildInputs = [
63 chardet
64 pebble
65 psutil
66 ];
67
68 nativeCheckInputs = [
69 pytestCheckHook
70 unifdef
71 ];
72
73 disabledTests = [
74 # Needs gcc, fails when run noninteractively (without tty).
75 "test_simple_reduction"
76 ];
77
78 meta = with lib; {
79 homepage = "https://github.com/marxin/cvise";
80 description = "Super-parallel Python port of C-Reduce";
81 license = licenses.ncsa;
82 maintainers = with maintainers; [ orivej ];
83 platforms = platforms.linux;
84 };
85}