1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 amaranth,
6 pdm-backend,
7 unstableGitUpdater,
8}:
9
10buildPythonPackage rec {
11 pname = "amaranth-boards";
12 version = "0-unstable-2025-08-28";
13 pyproject = true;
14 # from `pdm show`
15 realVersion =
16 let
17 tag = builtins.elemAt (lib.splitString "-" version) 0;
18 rev = lib.substring 0 7 src.rev;
19 in
20 "${tag}1.dev1+g${rev}";
21
22 src = fetchFromGitHub {
23 owner = "amaranth-lang";
24 repo = "amaranth-boards";
25 rev = "7e24efe2f6e95afddd0c1b56f1a9423c48caa472";
26 # these files change depending on git branch status
27 postFetch = "rm -f $out/.git_archival.txt $out/.gitattributes";
28 hash = "sha256-NkeSFmbiu5XtUEv/IfaY0P72SVH82HmERfPAHqIY+z8=";
29 };
30
31 build-system = [ pdm-backend ];
32 dependencies = [ amaranth ];
33
34 preBuild = ''
35 export PDM_BUILD_SCM_VERSION="${realVersion}"
36 '';
37
38 # no tests
39 doCheck = false;
40
41 passthru.updateScript = unstableGitUpdater { };
42
43 meta = with lib; {
44 description = "Board definitions for Amaranth HDL";
45 homepage = "https://github.com/amaranth-lang/amaranth-boards";
46 license = licenses.bsd2;
47 maintainers = with maintainers; [
48 thoughtpolice
49 pbsds
50 ];
51 };
52}