2022-08-21 13:32:41 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bash
|
|
|
|
, cmake
|
2022-09-09 14:08:57 +00:00
|
|
|
, colordiff
|
2022-08-21 13:32:41 +00:00
|
|
|
, flex
|
|
|
|
, libclang
|
|
|
|
, llvm
|
|
|
|
, unifdef
|
|
|
|
, chardet
|
|
|
|
, pebble
|
|
|
|
, psutil
|
|
|
|
, pytestCheckHook
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "cvise";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "2.8.0";
|
2022-09-30 11:47:45 +00:00
|
|
|
format = "other";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "marxin";
|
|
|
|
repo = "cvise";
|
2022-09-09 14:08:57 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-9HFCFgpRXqefFJLulwvi6nx0fl0G6IXI9gSinekJXRU=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Refer to unifdef by absolute path.
|
|
|
|
./unifdef.patch
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
2022-11-21 17:40:18 +00:00
|
|
|
# Avoid blanket -Werror to evade build failures on less
|
|
|
|
# tested compilers.
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace " -Werror " " "
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# 'cvise --command=...' generates a script with hardcoded shebang.
|
2021-09-18 10:52:07 +00:00
|
|
|
substituteInPlace cvise.py \
|
|
|
|
--replace "#!/bin/bash" "#!${bash}/bin/bash"
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
substituteInPlace cvise/utils/testing.py \
|
|
|
|
--replace "'colordiff --version'" "'${colordiff}/bin/colordiff --version'" \
|
|
|
|
--replace "'colordiff'" "'${colordiff}/bin/colordiff'"
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
llvm.dev
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libclang
|
|
|
|
llvm
|
|
|
|
llvm.dev
|
|
|
|
unifdef
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
chardet
|
|
|
|
pebble
|
|
|
|
psutil
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-21 13:32:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
unifdef
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Needs gcc, fails when run noninteractively (without tty).
|
|
|
|
"test_simple_reduction"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/marxin/cvise";
|
|
|
|
description = "Super-parallel Python port of C-Reduce";
|
|
|
|
license = licenses.ncsa;
|
|
|
|
maintainers = with maintainers; [ orivej ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|