1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 pythonOlder,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 deprecation,
12 prompt-toolkit,
13 pyusb,
14 pyvcd,
15 pyxdg,
16}:
17
18buildPythonPackage rec {
19 pname = "apollo-fpga";
20 version = "1.1.1";
21 pyproject = true;
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "greatscottgadgets";
26 repo = "apollo";
27 tag = "v${version}";
28 hash = "sha256-EDI+bRDePEbkxfQKuDgRsJtlAE0jqcIoQHjpgW0jIoY=";
29 };
30
31 postPatch = ''
32 substituteInPlace pyproject.toml \
33 --replace-fail '"setuptools-git-versioning<2"' "" \
34 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
35 '';
36
37 build-system = [
38 setuptools
39 ];
40
41 dependencies = [
42 deprecation
43 prompt-toolkit
44 pyusb
45 pyvcd
46 pyxdg
47 ];
48
49 # has no tests
50 doCheck = false;
51
52 pythonImportsCheck = [
53 "apollo_fpga"
54 ];
55
56 meta = {
57 changelog = "https://github.com/greatscottgadgets/apollo/releases/tag/v${version}";
58 description = "Microcontroller-based FPGA / JTAG programmer";
59 homepage = "https://github.com/greatscottgadgets/apollo";
60 license = lib.licenses.bsd3;
61 maintainers = with lib.maintainers; [ carlossless ];
62 };
63}