diff --git a/pkgs/applications/science/logic/symbiyosys/default.nix b/pkgs/applications/science/logic/symbiyosys/default.nix deleted file mode 100644 index c3df8340d20c..000000000000 --- a/pkgs/applications/science/logic/symbiyosys/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ lib, stdenv, fetchFromGitHub -, bash, python3, yosys -, yices, boolector, z3, aiger -}: - -stdenv.mkDerivation { - pname = "symbiyosys"; - version = "2021.11.30"; - - src = fetchFromGitHub { - owner = "YosysHQ"; - repo = "SymbiYosys"; - rev = "b409b1179e36d2a3fff66c85b7d4e271769a2d9e"; - hash = "sha256-S7of2upntiMkSdh4kf1RsrjriS31Eh8iEcVvG36isQg="; - }; - - 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/"' - - substituteInPlace sbysrc/sby.py \ - --replace '/usr/bin/env python3' '${python3}/bin/python' - ''; - - 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... - nativeCheckInputs = [ python3 yosys boolector yices z3 aiger ]; - checkPhase = "make test"; - - meta = { - description = "Tooling for Yosys-based verification flows"; - homepage = "https://symbiyosys.readthedocs.io/"; - license = lib.licenses.isc; - maintainers = with lib.maintainers; [ thoughtpolice ]; - mainProgram = "sby"; - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/by-name/sb/sby/package.nix b/pkgs/by-name/sb/sby/package.nix new file mode 100644 index 000000000000..a7cad6dac143 --- /dev/null +++ b/pkgs/by-name/sb/sby/package.nix @@ -0,0 +1,106 @@ +{ + lib, + stdenv, + fetchFromGitHub, + bash, + python3, + yosys, + yices, + boolector, + z3, + aiger, + python3Packages, + nix-update-script, +}: + +let + pythonEnv = python3.withPackages (ps: with ps; [ click ]); +in + +stdenv.mkDerivation rec { + pname = "sby"; + version = "0.44"; + + src = fetchFromGitHub { + owner = "YosysHQ"; + repo = "sby"; + rev = "yosys-${version}"; + hash = "sha256-/oDbbdZuWPdg0Xrh+c4i283vML9QTfyWVu8kryb4WaE="; + }; + + nativeBuildInputs = [ bash ]; + buildInputs = [ + pythonEnv + yosys + boolector + yices + z3 + aiger + ]; + + 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/"' + + substituteInPlace sbysrc/sby.py \ + --replace '/usr/bin/env python3' '${pythonEnv}/bin/python' + ''; + + 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 = true; + nativeCheckInputs = [ + pythonEnv + yosys + boolector + yices + z3 + aiger + ]; + checkPhase = '' + runHook preCheck + make test + runHook postCheck + ''; + + passthru.updateScript = nix-update-script { + extraArgs = [ + "--version-regex" + "yosys-([0-9].*)" + ]; + }; + + meta = { + description = "SymbiYosys (sby) -- Front-end for Yosys-based formal verification flows"; + homepage = "https://symbiyosys.readthedocs.io/"; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ + thoughtpolice + rcoeurjoly + ]; + mainProgram = "sby"; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/development/python-modules/amaranth/default.nix b/pkgs/development/python-modules/amaranth/default.nix index 2490deb1dbba..24707baa4cdf 100644 --- a/pkgs/development/python-modules/amaranth/default.nix +++ b/pkgs/development/python-modules/amaranth/default.nix @@ -13,7 +13,7 @@ # for tests pytestCheckHook, - symbiyosys, + sby, yices, yosys, }: @@ -47,7 +47,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - symbiyosys + sby yices yosys ]; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 9dc77b1f1c69..9bb124022242 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1432,6 +1432,7 @@ mapAliases ({ swift-im = throw "swift-im has been removed as it is unmaintained and depends on deprecated Python 2 / Qt WebKit"; # Added 2023-01-06 swtpm-tpm2 = swtpm; # Added 2021-02-26 Sylk = sylk; # Added 2024-06-12 + symbiyosys = sby; # Added 2024-08-18 syncthing-cli = syncthing; # Added 2021-04-06 syncthingtray-qt6 = syncthingtray; # Added 2024-03-06 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 772e8f93a0da..1ab45f9ede8a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37659,8 +37659,6 @@ with pkgs; bitwuzla = callPackage ../applications/science/logic/bitwuzla { }; - symbiyosys = callPackage ../applications/science/logic/symbiyosys { }; - symfpu = callPackage ../applications/science/logic/symfpu { }; uhdm = callPackage ../applications/science/logic/uhdm { };