aboutsummaryrefslogtreecommitdiff
path: root/clef/nix/pkgs/interactive_html_bom.nix
blob: 2ed69ed78150d4527a216d6633ef06bc46d3f1ea (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
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
62
{
  python3Packages,
  writeText,
  kicad-small,

  fetchFromGitHub,

  version ? "v2.9.0",
  thisSrc ? fetchFromGitHub {
    owner = "openscopeproject";
    repo = "interactivehtmlbom";
    rev = version;
    hash = "sha256-jUHEI0dWMFPQlXei3+0m1ruHzpG1hcRnxptNOXzXDqQ=";
  },

  dummySetupPy ? writeText "setup.py" ''
    #!/usr/bin/env python3
    # vim: set ft=python :

    from setuptools import setup, find_packages
    import sys

    packages = find_packages(include=['InteractiveHtmlBom', 'InteractiveHtmlBom.*'])

    setup(
      name="InteractiveHtmlBom",
      version='${version}',
      packages=packages,
      install_requires=['wxpython>=4.0', 'jsonschema>=4.1'],
      entry_points={
        'console_scripts': [
          'generate_interactive_bom=InteractiveHtmlBom.generate_interactive_bom:main'
        ]
      }
    )
  '',
}:

let
  src = thisSrc;

in python3Packages.buildPythonApplication {
  pname = "interactive_html_bom";

  inherit
    version
    src
    ;

  preBuild = ''
    cp -nv ${dummySetupPy} setup.py
    rm pyproject.toml
  '';

  dependencies = with python3Packages; [
    wxpython
    jsonschema
    kicad-small.base
  ];

  doCheck = false;
}