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";
|
|
|
|
# python -m setuptools_scm
|
|
|
|
version = "0.4.dev197+g${lib.substring 0 7 src.rev}";
|
|
|
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "11d5bb19eb34463918c07dc5e2e0eac7dbf822b0";
|
|
|
|
sha256 = "sha256-Ji5oYfF2hKSunAdAQTniv8Ajj6NE/bvW5cvadrGKa+U=";
|
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
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
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";
|
|
|
|
homepage = "https://amaranth-lang.org/docs/amaranth";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
2022-01-13 20:06:32 +00:00
|
|
|
maintainers = with maintainers; [ emily thoughtpolice ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|