Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkgs/by-name/libresoc-nmigen/bigfloat.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
lib,
python39Packages,
python3Packages,
fetchFromGitHub,
mpfr,
}:
python39Packages.buildPythonPackage rec {
python3Packages.buildPythonPackage rec {
pname = "bigfloat";
version = "0.4.0";
pyproject = true;
Expand All @@ -16,12 +16,12 @@ python39Packages.buildPythonPackage rec {
hash = "sha256-HgbwA0YksF/LDiD8WrcQZKilU6J94zSkgIyR+UUf+do=";
};

build-system = with python39Packages; [
build-system = with python3Packages; [
cython
setuptools
];

propagatedBuildInputs = [ mpfr ] ++ (with python39Packages; [ six ]);
propagatedBuildInputs = [ mpfr ] ++ (with python3Packages; [ six ]);

meta = {
description = "Arbitrary-precision correctly-rounded floating-point arithmetic, via MPFR.";
Expand Down
13 changes: 9 additions & 4 deletions pkgs/by-name/libresoc-nmigen/ieee754fpu.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
lib,
python39Packages,
python3Packages,
fetchFromLibresoc,
bigfloat,
sfpy,
Expand All @@ -9,9 +9,10 @@
nmigen,
pytest-output-to-files,
}:
python39Packages.buildPythonPackage rec {
python3Packages.buildPythonPackage rec {
pname = "ieee754fpu";
version = "unstable-2024-03-31";
version = "0-unstable-2024-03-31";
pyproject = true;

src = fetchFromLibresoc {
inherit pname;
Expand All @@ -23,6 +24,10 @@ python39Packages.buildPythonPackage rec {
touch ./src/ieee754/part{,_ass,_cat,_repl}/__init__.py
'';

build-system = with python3Packages; [
setuptools
];

propagatedBuildInputs = [ nmutil ];

nativeCheckInputs =
Expand All @@ -33,7 +38,7 @@ python39Packages.buildPythonPackage rec {
sfpy
bigfloat
]
++ (with python39Packages; [
++ (with python3Packages; [
pytestCheckHook
pytest-xdist
]);
Expand Down
15 changes: 9 additions & 6 deletions pkgs/by-name/libresoc-nmigen/libresoc-c4m-jtag.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
lib,
fetchFromLibresoc,
python39,
python39Packages,
python3Packages,
nmigen-soc,
nmigen,
modgrammar,
}:
python39Packages.buildPythonPackage rec {
python3Packages.buildPythonPackage rec {
pname = "c4m-jtag";
version = "unstable-2024-03-31";
realVersion = "0.3.dev243+g${lib.substring 0 7 src.rev}";
pyproject = true;

src = fetchFromLibresoc {
inherit pname;
Expand All @@ -21,8 +21,11 @@ python39Packages.buildPythonPackage rec {
export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}"
'';

nativeBuildInputs = with python39Packages; [ setuptools-scm ];
propagatedBuildInputs = [ nmigen-soc ];
nativeBuildInputs = with python3Packages; [ setuptools-scm ];
propagatedBuildInputs = [
nmigen-soc
modgrammar
];

pythonImportsCheck = [ "c4m.nmigen.jtag.tap" ];

Expand Down
5 changes: 3 additions & 2 deletions pkgs/by-name/libresoc-nmigen/libresoc-pyelftools.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
lib,
python39Packages,
python3Packages,
fetchFromGitHub,
}:
python39Packages.pyelftools.overrideAttrs (_: rec {
python3Packages.pyelftools.overrideAttrs (_: rec {
name = "pyelftools";
version = "unstable-2024-03-31";
pyproject = true;

# upstream Libre-SOC uses a mirror,
# and while this would be best handled as github.com/Libre-SOC-mirrors copy,
Expand Down
7 changes: 5 additions & 2 deletions pkgs/by-name/libresoc-nmigen/mdis.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
lib,
python39Packages,
python3Packages,
fetchPypi,
}:
python39Packages.buildPythonPackage rec {
python3Packages.buildPythonPackage rec {
pname = "mdis";
version = "0.5.1";
pyproject = true;

src = fetchPypi {
inherit pname version;
sha256 = "sha256-gvXtP8NO5XPDAs0XMbGknG79FscN/7lxqmF1kg3nhxg=";
};

build-system = with python3Packages; [ setuptools ];

meta = {
description = "Python dispatching library";
homepage = "https://git.libre-soc.org/?p=mdis.git";
Expand Down
32 changes: 32 additions & 0 deletions pkgs/by-name/libresoc-nmigen/modgrammar.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
lib,
python3,
fetchPypi,
}:

python3.pkgs.buildPythonApplication rec {
pname = "modgrammar";
version = "0.10";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-uVfMnMW8xNo7B5XWPTPUIc8o2xhqyrdPg4R96DEfoJo=";
};

build-system = [
python3.pkgs.setuptools
python3.pkgs.wheel
];

pythonImportsCheck = [
"modgrammar"
];

meta = {
description = "Modular grammar-parsing engine";
homepage = "https://pypi.org/project/modgrammar/";
license = lib.licenses.bsd2;
mainProgram = "modgrammar";
};
}
11 changes: 6 additions & 5 deletions pkgs/by-name/libresoc-nmigen/nmigen-soc.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
lib,
python39Packages,
python3Packages,
fetchFromGitLab,
nmigen,
}:
python39Packages.buildPythonPackage rec {
python3Packages.buildPythonPackage rec {
pname = "nmigen-soc";
version = "unstable-2024-03-31";
# python setup.py --version
realVersion = "0.1.dev243+g${lib.substring 0 7 src.rev}";
pyproject = true;

# NOTE(jleightcap): libresoc's nmigen-soc fork has been renamed to https://github.com/amaranth-lang/amaranth-soc.
# suffers from the same rename issue as the previous commit with renaming issue as nmigen/amaranth
Expand All @@ -22,8 +23,8 @@ python39Packages.buildPythonPackage rec {
rev = "fd2aaa336283cff2e46f489bf3897780cd217b8b"; # HEAD @ version date
};

nativeBuildInputs = with python39Packages; [ setuptools-scm ];
propagatedBuildInputs = with python39Packages; [
nativeBuildInputs = with python3Packages; [ setuptools-scm ];
propagatedBuildInputs = with python3Packages; [
nmigen
setuptools
];
Expand All @@ -32,7 +33,7 @@ python39Packages.buildPythonPackage rec {
export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}"
'';

nativeCheckInputs = with python39Packages; [ pytestCheckHook ];
nativeCheckInputs = with python3Packages; [ pytestCheckHook ];

meta = {
description = "Python toolbox for building complex digital hardware";
Expand Down
15 changes: 10 additions & 5 deletions pkgs/by-name/libresoc-nmigen/nmigen.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
lib,
fetchFromGitLab,
git,
python39Packages,
python3Packages,
symbiyosys,
yices,
yosys,
}:
python39Packages.buildPythonPackage rec {
python3Packages.buildPythonPackage rec {
pname = "nmigen";
version = "0-unstable-2022-09-27";
realVersion = "0.3.dev243+g${lib.substring 0 7 src.rev}";
pyproject = true;

# libresoc's nmigen fork has been renamed to https://github.com/amaranth-lang/amaranth
# amaranth is packaged in nixpkgs but we can't just override a few of the attributes the way we did for pyelftools,
Expand All @@ -31,11 +32,11 @@ python39Packages.buildPythonPackage rec {
export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}"
'';

nativeBuildInputs = [ git ] ++ (with python39Packages; [ setuptools-scm ]);
nativeBuildInputs = [ git ] ++ (with python3Packages; [ setuptools-scm ]);

propagatedBuildInputs =
[ yosys ]
++ (with python39Packages; [
++ (with python3Packages; [
jinja2
pyvcd
]);
Expand All @@ -44,7 +45,11 @@ python39Packages.buildPythonPackage rec {
symbiyosys
yices
yosys
] ++ (with python39Packages; [ pytestCheckHook ]);
] ++ (with python3Packages; [ pytestCheckHook ]);

pythonRelaxDeps = [
"pyvcd"
];

# TODO: upstream nixpkgs Amaranth package uses a patch for Python >3.8 compatibility in setuptools:
# https://github.com/amaranth-lang/amaranth/commit/64771a065a280fa683c1e6692383bec4f59f20fa.patch
Expand Down
13 changes: 9 additions & 4 deletions pkgs/by-name/libresoc-nmigen/nmutil.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
lib,
fetchFromLibresoc,
python39Packages,
python3Packages,
symbiyosys,
yices,
nmigen,
pytest-output-to-files,
}:
python39Packages.buildPythonPackage {
python3Packages.buildPythonPackage {
pname = "libresoc-nmutil"; # Libre-SOC's bespoke fork
version = "0-unstable-2022-11-16";
pyproject = true;

src = fetchFromLibresoc {
pname = "nmutil";
Expand All @@ -22,12 +23,16 @@ python39Packages.buildPythonPackage {
sed -i "s/read_ilang/read_rtlil/g" build/lib/nmutil/*.py src/nmutil/*.py
'';

build-system = with python3Packages; [
setuptools
];

propagatedNativeBuildInputs =
[
symbiyosys
yices
]
++ (with python39Packages; [
++ (with python3Packages; [
pyvcd
]);

Expand All @@ -37,7 +42,7 @@ python39Packages.buildPythonPackage {
symbiyosys
yices
]
++ (with python39Packages; [
++ (with python3Packages; [
pytestCheckHook
pytest-xdist
pytest-output-to-files
Expand Down
17 changes: 13 additions & 4 deletions pkgs/by-name/libresoc-nmigen/openpower-isa.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
lib,
python39,
python3,
fetchFromLibresoc,
pkgsCross,
writeShellApplication,
Expand All @@ -12,13 +12,14 @@
mdis,
}:
let
python = python39;
pythonPackages = python39.pkgs;
python = python3;
pythonPackages = python3.pkgs;
in
pythonPackages.buildPythonPackage rec {
name = "libresoc-openpower-isa";
pname = "openpower-isa";
version = "unstable-2024-03-31";
version = "0-unstable-2024-03-31";
pyproject = true;

src = fetchFromLibresoc {
inherit pname;
Expand Down Expand Up @@ -50,6 +51,10 @@ pythonPackages.buildPythonPackage rec {
./prefixed-openpower-isa-tools.patch
];

build-system = with pythonPackages; [
setuptools
];

# Native is the build machine architecture (e.g. x86_64 linux)
# This will run a python emulator of the target architecture, which is PowerPC for this project
# The assembler has to run on native but target PowerPC assembly
Expand All @@ -69,6 +74,10 @@ pythonPackages.buildPythonPackage rec {
pygdbmi
]);

pythonRelaxDeps = [
"pygdbmi"
];

# TODO: potential upstream work
postInstall =
''
Expand Down
11 changes: 6 additions & 5 deletions pkgs/by-name/libresoc-nmigen/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
newScope,
fetchFromGitHub,
python39,
python3,
}:
let
python =
Expand All @@ -28,21 +28,21 @@ let
});
};
in
python39.override {
python3.override {
inherit packageOverrides;
self = python;
};

callPackage = newScope {
python39 = python;
python39Packages = python.pkgs;
python3 = python;
python3Packages = python.pkgs;
};

lib = callPackage ./lib.nix { };
inherit (lib) fetchFromLibresoc;

libresoc-c4m-jtag = callPackage ./libresoc-c4m-jtag.nix {
inherit fetchFromLibresoc nmigen nmigen-soc;
inherit fetchFromLibresoc nmigen-soc modgrammar;
};
libresoc-ieee754fpu = callPackage ./ieee754fpu.nix {
inherit
Expand Down Expand Up @@ -75,6 +75,7 @@ let
inherit fetchFromLibresoc;
};
pytest-output-to-files = callPackage ./pytest-output-to-files.nix { inherit fetchFromLibresoc; };
modgrammar = callPackage ./modgrammar.nix { };
in
callPackage ./soc.nix {
inherit
Expand Down
Loading