From de5759ecbcb69fc4110be8a76264409202414b24 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 16 Oct 2025 20:45:47 +0100 Subject: [PATCH] cvise: fix `unifdef.patch` (crashes otherwise) Without the change `cvise` does not even parse: $ cvise --help |& unnix File "/<>/cvise-2.12.0/bin/.cvise-wrapped", line 96 programs['unifdef'] = '/<>/unifdef-2.12/bin/unifdef' ^^^^^^^^ SyntaxError: expected 'except' or 'finally' block Happens because the patch applies to the unrelated bit of the source. While at it added minimal `cvise --help` test. --- pkgs/development/tools/misc/cvise/default.nix | 12 ++++++++++++ pkgs/development/tools/misc/cvise/unifdef.patch | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/cvise/default.nix b/pkgs/development/tools/misc/cvise/default.nix index 332cf7aea9ec..bddf56345a9c 100644 --- a/pkgs/development/tools/misc/cvise/default.nix +++ b/pkgs/development/tools/misc/cvise/default.nix @@ -13,6 +13,8 @@ pebble, psutil, pytestCheckHook, + testers, + cvise, }: buildPythonApplication rec { @@ -78,6 +80,16 @@ buildPythonApplication rec { "test_simple_reduction" ]; + passthru = { + tests = { + # basic syntax check + help-output = testers.testVersion { + package = cvise; + command = "cvise --version"; + }; + }; + }; + meta = with lib; { homepage = "https://github.com/marxin/cvise"; description = "Super-parallel Python port of C-Reduce"; diff --git a/pkgs/development/tools/misc/cvise/unifdef.patch b/pkgs/development/tools/misc/cvise/unifdef.patch index d15ca6dce0bd..e584730d6146 100644 --- a/pkgs/development/tools/misc/cvise/unifdef.patch +++ b/pkgs/development/tools/misc/cvise/unifdef.patch @@ -1,6 +1,7 @@ ---- a/cvise.py -+++ b/cvise.py -@@ -93,4 +93,5 @@ def find_external_programs(): +--- a/cvise/utils/externalprograms.py ++++ b/cvise/utils/externalprograms.py +@@ -43,5 +43,6 @@ def find_external_programs(): + # Special case for clang-format programs['clang-format'] = '@CLANG_FORMAT_PATH@' + programs['unifdef'] = '@UNIFDEF@'