summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/apollo-fpga/default.nix
blob: 082c6fdfd6efb200cb5844913c59cf9097d60b63 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,

  # build-system
  setuptools,

  # dependencies
  deprecation,
  prompt-toolkit,
  pyusb,
  pyvcd,
  pyxdg,
}:

buildPythonPackage rec {
  pname = "apollo-fpga";
  version = "1.1.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "greatscottgadgets";
    repo = "apollo";
    tag = "v${version}";
    hash = "sha256-EDI+bRDePEbkxfQKuDgRsJtlAE0jqcIoQHjpgW0jIoY=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail '"setuptools-git-versioning<2"' "" \
      --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
  '';

  build-system = [
    setuptools
  ];

  dependencies = [
    deprecation
    prompt-toolkit
    pyusb
    pyvcd
    pyxdg
  ];

  # has no tests
  doCheck = false;

  pythonImportsCheck = [
    "apollo_fpga"
  ];

  meta = {
    changelog = "https://github.com/greatscottgadgets/apollo/releases/tag/v${version}";
    description = "Microcontroller-based FPGA / JTAG programmer";
    homepage = "https://github.com/greatscottgadgets/apollo";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ carlossless ];
  };
}