Files
nixpkgs/pkgs/development/python-modules/amaranth/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

86 lines
1.6 KiB
Nix

{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
pdm-backend,
jschon,
pyvcd,
jinja2,
importlib-resources,
importlib-metadata,
git,
# for tests
pytestCheckHook,
sby,
yices,
yosys,
}:
buildPythonPackage rec {
pname = "amaranth";
version = "0.5.8";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "amaranth-lang";
repo = "amaranth";
tag = "v${version}";
hash = "sha256-hqMgyQJRz1/5C9KB3nAI2RKPZXZUl3zhfZbk9M1hTxs=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "pdm-backend~=2.3.0" "pdm-backend>=2.3.0"
'';
nativeBuildInputs = [ git ];
build-system = [ pdm-backend ];
dependencies = [
jschon
jinja2
pyvcd
]
++ lib.optional (pythonOlder "3.9") importlib-resources
++ lib.optional (pythonOlder "3.8") importlib-metadata;
nativeCheckInputs = [
pytestCheckHook
sby
yices
yosys
];
pythonImportsCheck = [ "amaranth" ];
disabledTests = [
"verilog"
"test_reversible"
"test_distance"
];
disabledTestPaths = [
# Subprocesses
"tests/test_examples.py"
# Verification failures
"tests/test_lib_fifo.py"
];
meta = {
description = "Modern hardware definition language and toolchain based on Python";
homepage = "https://amaranth-lang.org/docs/amaranth";
changelog = "https://github.com/amaranth-lang/amaranth/blob/${src.tag}/docs/changes.rst";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [
thoughtpolice
pbsds
];
mainProgram = "amaranth-rpc";
};
}