diff --git a/pkgs/default.nix b/pkgs/default.nix index a2e08155..b990a832 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -28,6 +28,12 @@ pretalx-venueless pretalx-public-voting ; + + libresoc = rec { + libresoc-nmutil = callPackage ./libresoc/libresoc-nmutil.nix {}; + openpower-isa = callPackage ./libresoc/openpower-isa.nix {inherit power-instruction-analyzer libresoc-nmutil;}; + power-instruction-analyzer = callPackage ./libresoc/power-instruction-analyzer.nix {}; + }; }; in self diff --git a/pkgs/libresoc/libresoc-nmutil.nix b/pkgs/libresoc/libresoc-nmutil.nix new file mode 100644 index 00000000..478c1bba --- /dev/null +++ b/pkgs/libresoc/libresoc-nmutil.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: +with pkgs.python3Packages; + buildPythonPackage rec { + pname = "libresoc-nmutil"; + version = "0.0.1"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-DPnzjdGDhAN+wYoSo6iaAK44Je/RKgTe4p/+SHIIaM0="; + }; + + propagatedBuildInputs = [pyvcd]; + + nativeCheckInputs = [nose]; + + # FIXME(jl): nmigen/amaranth tests + doCheck = false; + } diff --git a/pkgs/libresoc/openpower-isa.nix b/pkgs/libresoc/openpower-isa.nix new file mode 100644 index 00000000..18995e36 --- /dev/null +++ b/pkgs/libresoc/openpower-isa.nix @@ -0,0 +1,28 @@ +{ + pkgs, + fetchgit, + power-instruction-analyzer, + libre-soc, + ... +}: +with pkgs.python3Packages; + buildPythonPackage { + pname = "openpower-isa"; + version = "2023-10-28"; + format = "setuptools"; + + src = fetchgit { + url = "https://git.libre-soc.org/git/openpower-isa.git"; + rev = "21f95f5bb243c937aed9f9ef28605f20b33b7b0e"; + hash = "sha256-UqEBEwVnVMgAn2Y64ccYC3zDY/RLCB7463hQbms+arc="; + }; + + patches = [./setup-no-cprop.patch]; + + propagatedBuildInputs = [amaranth astor cffi ply pygdbmi libresoc-nmutil]; + + nativeCheckInputs = [nose power-instruction-analyzer]; + + dontUsePipInstall = true; + doInstallCheck = false; + } diff --git a/pkgs/libresoc/power-instruction-analyzer.nix b/pkgs/libresoc/power-instruction-analyzer.nix new file mode 100644 index 00000000..05def83d --- /dev/null +++ b/pkgs/libresoc/power-instruction-analyzer.nix @@ -0,0 +1,23 @@ +{pkgs, fetchgit, ...}: +with pkgs.python3Packages; +with pkgs.rustPlatform; + buildPythonPackage rec { + pname = "power-instruction-analyzer"; + version = "0.2.0"; + + src = fetchgit { + url = "https://git.libre-soc.org/git/power-instruction-analyzer.git"; + rev = "v${version}"; + hash = "sha256-UmgDykG9yn413PXrMsI4oRblCZdHbtaIZ55p89YPfQs="; + }; + + cargoDeps = fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-lkSdkkU0lvGtEHbM3eFrXHiUcWEPkHL1sQeebAyMUcY="; + }; + + format = "pyproject"; + + nativeBuildInputs = [cargoSetupHook maturinBuildHook]; + }