lol

symbiyosys: fix calls to external programs

48085826f broke symbiyosys when it needed to call `yosys-abc`: when
`ABCEXTERNAL` is set in the Makefile, then `yosys-abc` is not built.

But in general `sby` was just calling programs out of the ambient
environment. Fix that for most programs it can invoke: it now has a
direct dependency on boolector, aiger, abc, yosys, etc.

This also does some other minor clean up.

Signed-off-by: Austin Seipp <aseipp@pobox.com>

+24 -12
+24 -12
pkgs/applications/science/logic/symbiyosys/default.nix
··· 1 - { stdenv, fetchFromGitHub, yosys, bash, python3, yices }: 1 + { stdenv, fetchFromGitHub 2 + , bash, python3, yosys 3 + , yices, boolector, aiger, abc-verifier 4 + }: 2 5 3 6 stdenv.mkDerivation { 4 7 pname = "symbiyosys"; ··· 11 14 sha256 = "1pwbirszc80r288x81nx032snniqgmc80i09bbha2i3zd0c3pj5h"; 12 15 }; 13 16 14 - buildInputs = [ python3 yosys ]; 17 + buildInputs = [ python3 ]; 18 + patchPhase = '' 19 + patchShebangs . 15 20 16 - propagatedBuildInputs = [ yices ]; 21 + # Fix up Yosys imports 22 + substituteInPlace sbysrc/sby.py \ 23 + --replace "##yosys-sys-path##" \ 24 + "sys.path += [p + \"/share/yosys/python3/\" for p in [\"$out\", \"${yosys}\"]]" 25 + 26 + # Fix various executable references 27 + substituteInPlace sbysrc/sby_core.py \ 28 + --replace '"/usr/bin/env", "bash"' '"${bash}/bin/bash"' \ 29 + --replace ': "btormc"' ': "${boolector}/bin/btormc"' \ 30 + --replace ': "yosys"' ': "${yosys}/bin/yosys"' \ 31 + --replace ': "yosys-smtbmc"' ': "${yosys}/bin/yosys-smtbmc"' \ 32 + --replace ': "yosys-abc"' ': "${abc-verifier}/bin/abc"' \ 33 + --replace ': "aigbmc"' ': "${aiger}/bin/aigbmc"' \ 34 + ''; 17 35 18 36 buildPhase = "true"; 19 37 installPhase = '' ··· 21 39 22 40 cp sbysrc/sby_*.py $out/share/yosys/python3/ 23 41 cp sbysrc/sby.py $out/bin/sby 24 - chmod +x $out/bin/sby 25 42 26 - # Fix up shebang and Yosys imports 27 - patchShebangs $out/bin/sby 28 - substituteInPlace $out/bin/sby \ 29 - --replace "##yosys-sys-path##" \ 30 - "sys.path += [p + \"/share/yosys/python3/\" for p in [\"$out\", \"${yosys}\"]]" 31 - substituteInPlace $out/share/yosys/python3/sby_core.py \ 32 - --replace '"/usr/bin/env", "bash"' '"${bash}/bin/bash"' 43 + chmod +x $out/bin/sby 33 44 ''; 45 + 34 46 meta = { 35 47 description = "Tooling for Yosys-based verification flows"; 36 - homepage = https://symbiyosys.readthedocs.io/; 48 + homepage = "https://symbiyosys.readthedocs.io/"; 37 49 license = stdenv.lib.licenses.isc; 38 50 maintainers = with stdenv.lib.maintainers; [ thoughtpolice emily ]; 39 51 platforms = stdenv.lib.platforms.all;