1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 15:11:35 +00:00

cvise: use /bin.bash from nix store

Noticed failures as an incorrect handling of `--command` param:

    $ cvise --command="gcc -c bug.c |& fgrep 'during RTL pass: expand'" bug.c
    C-Vise cannot run because the interestingness test does not return
    zero.

This happens because temporary shell script has "#!/bin/bash" shebang.

The change replaces it to path from nix store.
This commit is contained in:
Sergei Trofimovich 2021-09-15 19:18:05 +01:00
parent 2bb5cbf7f8
commit 5cc72dbec4

View file

@ -1,4 +1,4 @@
{ lib, buildPythonApplication, fetchFromGitHub, cmake, flex
{ lib, buildPythonApplication, fetchFromGitHub, bash, cmake, flex
, libclang, llvm, unifdef
, pebble, psutil, pytestCheckHook, pytest-flake8
}:
@ -20,10 +20,16 @@ buildPythonApplication rec {
];
nativeBuildInputs = [ cmake flex llvm.dev ];
buildInputs = [ libclang llvm llvm.dev unifdef ];
buildInputs = [ bash libclang llvm llvm.dev unifdef ];
propagatedBuildInputs = [ pebble psutil ];
checkInputs = [ pytestCheckHook pytest-flake8 unifdef ];
# 'cvise --command=...' generates a script with hardcoded shebang.
postPatch = ''
substituteInPlace cvise.py \
--replace "#!/bin/bash" "#!${bash}/bin/bash"
'';
preCheck = ''
patchShebangs cvise.py
'';