nixpkgs-suyu/pkgs/applications/science/logic/symbiyosys/default.nix
2019-09-02 23:25:24 +02:00

39 lines
1.2 KiB
Nix

{ stdenv, fetchFromGitHub, yosys, bash, python3 }:
stdenv.mkDerivation {
pname = "symbiyosys";
version = "2019.08.13";
src = fetchFromGitHub {
owner = "yosyshq";
repo = "symbiyosys";
rev = "9cb542ac7a310b3dfa626349db53bed6236b670c";
sha256 = "0c7nz740738ybk33zzlfl00cq86n31wvra8pqqkpl4ygxnwca1d6";
};
buildInputs = [ python3 yosys ];
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
# Fix up shebang and Yosys imports
patchShebangs $out/bin/sby
substituteInPlace $out/bin/sby \
--replace "##yosys-sys-path##" \
"sys.path += [p + \"/share/yosys/python3/\" for p in [\"$out\", \"${yosys}\"]]"
substituteInPlace $out/share/yosys/python3/sby_core.py \
--replace '"/usr/bin/env", "bash"' '"${bash}/bin/bash"'
'';
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;
};
}