mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 13:41:26 +00:00
0eb943ecb1
Signed-off-by: Austin Seipp <aseipp@pobox.com>
59 lines
1.6 KiB
Nix
59 lines
1.6 KiB
Nix
{ stdenv, fetchFromGitHub
|
|
, bash, python3, yosys
|
|
, yices, boolector, z3, aiger
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "symbiyosys";
|
|
version = "2020.08.22";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "YosysHQ";
|
|
repo = "SymbiYosys";
|
|
rev = "33b0bb7d836fe2a73dc7b10587222f2a718beef4";
|
|
sha256 = "03rbrbwsji1sqcp2yhgbc0fca04zsryv2g4izjhdzv64nqjzjyhn";
|
|
};
|
|
|
|
buildInputs = [ ];
|
|
patchPhase = ''
|
|
patchShebangs .
|
|
|
|
# Fix up Yosys imports
|
|
substituteInPlace sbysrc/sby.py \
|
|
--replace "##yosys-sys-path##" \
|
|
"sys.path += [p + \"/share/yosys/python3/\" for p in [\"$out\", \"${yosys}\"]]"
|
|
|
|
# Fix various executable references
|
|
substituteInPlace sbysrc/sby_core.py \
|
|
--replace '"/usr/bin/env", "bash"' '"${bash}/bin/bash"' \
|
|
--replace ', "btormc"' ', "${boolector}/bin/btormc"' \
|
|
--replace ', "aigbmc"' ', "${aiger}/bin/aigbmc"'
|
|
|
|
substituteInPlace sbysrc/sby_core.py \
|
|
--replace '##yosys-program-prefix##' '"${yosys}/bin/"'
|
|
'';
|
|
|
|
buildPhase = "true";
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin $out/share/yosys/python3
|
|
|
|
cp sbysrc/sby_*.py $out/share/yosys/python3/
|
|
cp sbysrc/sby.py $out/bin/sby
|
|
|
|
chmod +x $out/bin/sby
|
|
'';
|
|
|
|
doCheck = false; # not all provers are yet packaged...
|
|
checkInputs = [ python3 yosys boolector yices z3 aiger ];
|
|
checkPhase = "make test";
|
|
|
|
meta = {
|
|
description = "Tooling for Yosys-based verification flows";
|
|
homepage = "https://symbiyosys.readthedocs.io/";
|
|
license = stdenv.lib.licenses.isc;
|
|
maintainers = with stdenv.lib.maintainers; [ thoughtpolice emily ];
|
|
platforms = stdenv.lib.platforms.all;
|
|
};
|
|
}
|