diff --git a/pkgs/development/tools/misc/cvise/default.nix b/pkgs/development/tools/misc/cvise/default.nix new file mode 100644 index 000000000000..357e3e98f081 --- /dev/null +++ b/pkgs/development/tools/misc/cvise/default.nix @@ -0,0 +1,46 @@ +{ lib, buildPythonApplication, fetchFromGitHub, cmake, flex +, clang-unwrapped, llvm, unifdef +, pebble, psutil, pytestCheckHook, pytest-flake8 +}: + +buildPythonApplication rec { + pname = "cvise"; + version = "2.1.0"; + + src = fetchFromGitHub { + owner = "marxin"; + repo = "cvise"; + rev = "v${version}"; + sha256 = "0ljl0r5jqj6lrddrbxjkcphcz5p4njnn2hqz07jyh30jd9sm7dmj"; + }; + + patches = [ + # Refer to unifdef by absolute path. + ./unifdef.patch + ]; + + nativeBuildInputs = [ cmake flex ]; + buildInputs = [ clang-unwrapped llvm unifdef ]; + propagatedBuildInputs = [ pebble psutil ]; + checkInputs = [ pytestCheckHook pytest-flake8 unifdef ]; + + preCheck = '' + patchShebangs cvise.py + ''; + disabledTests = [ + # Needs gcc, fails when run noninteractively (without tty). + "test_simple_reduction" + ]; + + dontUsePipInstall = true; + dontUseSetuptoolsBuild = true; + dontUseSetuptoolsCheck = true; + + 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; + }; +} diff --git a/pkgs/development/tools/misc/cvise/unifdef.patch b/pkgs/development/tools/misc/cvise/unifdef.patch new file mode 100644 index 000000000000..d15ca6dce0bd --- /dev/null +++ b/pkgs/development/tools/misc/cvise/unifdef.patch @@ -0,0 +1,8 @@ +--- a/cvise.py ++++ b/cvise.py +@@ -93,4 +93,5 @@ def find_external_programs(): + # Special case for clang-format + programs['clang-format'] = '@CLANG_FORMAT_PATH@' ++ programs['unifdef'] = '@UNIFDEF@' + + return programs diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 25d26938723f..78aa21f044fd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12145,6 +12145,10 @@ in csslint = callPackage ../development/web/csslint { }; + cvise = python3Packages.callPackage ../development/tools/misc/cvise { + inherit (llvmPackages_11) llvm clang-unwrapped; + }; + libcxx = llvmPackages.libcxx; libcxxabi = llvmPackages.libcxxabi;