1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, amaranth
5, setuptools
6, setuptools-scm
7}:
8
9buildPythonPackage rec {
10 pname = "amaranth-soc";
11 version = "unstable-2021-12-10";
12 # python setup.py --version
13 realVersion = "0.1.dev49+g${lib.substring 0 7 src.rev}";
14
15 src = fetchFromGitHub {
16 owner = "amaranth-lang";
17 repo = "amaranth-soc";
18 rev = "217d4ea76ad3b3bbf146980d168bc7b3b9d95a18";
19 sha256 = "dMip82L7faUn16RDeG3NgMv0nougpwTwDWLX0doD2YA=";
20 };
21
22 nativeBuildInputs = [ setuptools-scm ];
23 propagatedBuildInputs = [ setuptools amaranth ];
24
25 preBuild = ''
26 export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}"
27 '';
28
29 meta = with lib; {
30 description = "System on Chip toolkit for Amaranth HDL";
31 homepage = "https://github.com/amaranth-lang/amaranth-soc";
32 license = licenses.bsd2;
33 maintainers = with maintainers; [ emily thoughtpolice ];
34 };
35}