nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pdm-backend,
6 jschon,
7 pyvcd,
8 jinja2,
9 git,
10
11 # for tests
12 pytestCheckHook,
13 sby,
14 yices,
15 yosys,
16}:
17
18buildPythonPackage rec {
19 pname = "amaranth";
20 version = "0.5.8";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "amaranth-lang";
25 repo = "amaranth";
26 tag = "v${version}";
27 hash = "sha256-hqMgyQJRz1/5C9KB3nAI2RKPZXZUl3zhfZbk9M1hTxs=";
28 };
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace-fail "pdm-backend~=2.3.0" "pdm-backend>=2.3.0"
33 '';
34
35 nativeBuildInputs = [ git ];
36
37 build-system = [ pdm-backend ];
38
39 dependencies = [
40 jschon
41 jinja2
42 pyvcd
43 ];
44
45 nativeCheckInputs = [
46 pytestCheckHook
47 sby
48 yices
49 yosys
50 ];
51
52 pythonImportsCheck = [ "amaranth" ];
53
54 disabledTests = [
55 "verilog"
56 "test_reversible"
57 "test_distance"
58 ];
59
60 disabledTestPaths = [
61 # Subprocesses
62 "tests/test_examples.py"
63 # Verification failures
64 "tests/test_lib_fifo.py"
65 ];
66
67 meta = {
68 description = "Modern hardware definition language and toolchain based on Python";
69 homepage = "https://amaranth-lang.org/docs/amaranth";
70 changelog = "https://github.com/amaranth-lang/amaranth/blob/${src.tag}/docs/changes.rst";
71 license = lib.licenses.bsd2;
72 maintainers = with lib.maintainers; [
73 thoughtpolice
74 pbsds
75 ];
76 mainProgram = "amaranth-rpc";
77 };
78}