2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
, pdm-backend
|
2020-04-24 23:36:52 +00:00
|
|
|
, pyvcd
|
|
|
|
, jinja2
|
2021-02-13 14:23:35 +00:00
|
|
|
, importlib-resources
|
|
|
|
, importlib-metadata
|
2021-05-20 23:08:51 +00:00
|
|
|
, git
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# for tests
|
2020-09-25 04:45:31 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, symbiyosys
|
|
|
|
, yices
|
2021-07-14 22:03:04 +00:00
|
|
|
, yosys
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "amaranth";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.4.5";
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-01-13 20:06:32 +00:00
|
|
|
owner = "amaranth-lang";
|
|
|
|
repo = "amaranth";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-g9dn6gUTdFHz9GMWHERsRLWHoI3E7vjuQDK0usbZO7g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
git
|
2023-10-09 19:29:22 +00:00
|
|
|
pdm-backend
|
2021-07-14 22:03:04 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2021-02-13 14:23:35 +00:00
|
|
|
jinja2
|
2021-07-14 22:03:04 +00:00
|
|
|
pyvcd
|
2021-02-13 14:23:35 +00:00
|
|
|
] ++
|
|
|
|
lib.optional (pythonOlder "3.9") importlib-resources ++
|
|
|
|
lib.optional (pythonOlder "3.8") importlib-metadata;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-07-14 22:03:04 +00:00
|
|
|
pytestCheckHook
|
|
|
|
symbiyosys
|
|
|
|
yices
|
|
|
|
yosys
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
pythonImportsCheck = [ "amaranth" ];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-01-13 20:06:32 +00:00
|
|
|
description = "A modern hardware definition language and toolchain based on Python";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "amaranth-rpc";
|
2022-01-13 20:06:32 +00:00
|
|
|
homepage = "https://amaranth-lang.org/docs/amaranth";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ emily thoughtpolice pbsds ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|