1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 luna-usb,
11}:
12
13buildPythonPackage rec {
14 pname = "luna-soc";
15 version = "0.3.2";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "greatscottgadgets";
20 repo = "luna-soc";
21 tag = version;
22 hash = "sha256-Rks1wC0CR5FSu4TrE1thzolT3QBd0yh7q+SxZ1U+pB4=";
23 };
24
25 postPatch = ''
26 substituteInPlace pyproject.toml \
27 --replace-fail '"setuptools-git-versioning<2"' "" \
28 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
29 '';
30
31 build-system = [
32 setuptools
33 ];
34
35 dependencies = [ luna-usb ];
36
37 # has no tests
38 doCheck = false;
39
40 pythonImportsCheck = [
41 "luna_soc"
42 ];
43
44 meta = {
45 changelog = "https://github.com/greatscottgadgets/luna-soc/releases/tag/${src.tag}";
46 description = "Amaranth HDL library for building USB-capable SoC designs";
47 homepage = "https://github.com/greatscottgadgets/luna-soc";
48 license = lib.licenses.bsd3;
49 maintainers = with lib.maintainers; [ carlossless ];
50 };
51}