about summary refs log tree commit diff
path: root/pkgs/development/python-modules/amaranth-soc/default.nix
blob: b509ec551cf8477f322e10e5e1f3ea91afcc2cf7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ lib
, buildPythonPackage
, fetchFromGitHub
, amaranth
, pdm-backend
}:

buildPythonPackage rec {
  pname = "amaranth-soc";
  version = "0-unstable-2024-02-16";
  pyproject = true;
  # from `pdm show`
  realVersion = "0.1a1.dev1+g${lib.substring 0 7 src.rev}";

  src = fetchFromGitHub {
    owner = "amaranth-lang";
    repo = "amaranth-soc";
    rev = "9f46553aa4289e2a11788a73fade6410a371b162";
    hash = "sha256-ZllDSrZEu16jZtbQ7crQSj3XCbsthueXtaAvyf45dmY=";
  };

  nativeBuildInputs = [ pdm-backend ];
  propagatedBuildInputs = [ amaranth ];

  preBuild = ''
    export PDM_BUILD_SCM_VERSION="${realVersion}"
  '';

  meta = with lib; {
    description = "System on Chip toolkit for Amaranth HDL";
    homepage = "https://github.com/amaranth-lang/amaranth-soc";
    license = licenses.bsd2;
    maintainers = with maintainers; [ emily thoughtpolice pbsds ];
  };
}