aboutsummaryrefslogtreecommitdiff
path: root/hw/clef/nix/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'hw/clef/nix/pkgs')
-rw-r--r--hw/clef/nix/pkgs/default.nix5
-rw-r--r--hw/clef/nix/pkgs/interactive_html_bom.nix69
2 files changed, 74 insertions, 0 deletions
diff --git a/hw/clef/nix/pkgs/default.nix b/hw/clef/nix/pkgs/default.nix
new file mode 100644
index 0000000..a0a9f92
--- /dev/null
+++ b/hw/clef/nix/pkgs/default.nix
@@ -0,0 +1,5 @@
+{
+ pkgs,
+}: {
+ interactiveHtmlBom = pkgs.callPackage ./interactive_html_bom.nix {};
+}
diff --git a/hw/clef/nix/pkgs/interactive_html_bom.nix b/hw/clef/nix/pkgs/interactive_html_bom.nix
new file mode 100644
index 0000000..8adf7a7
--- /dev/null
+++ b/hw/clef/nix/pkgs/interactive_html_bom.nix
@@ -0,0 +1,69 @@
+{
+ python3Packages,
+ writeText,
+ kicad-small,
+
+ fetchFromGitHub,
+
+ version ? "v2.9.0",
+ thisSrc ? fetchFromGitHub {
+ owner = "openscopeproject";
+ repo = "interactivehtmlbom";
+ rev = version;
+ hash = "sha256-jUHEI0dWMFPQlXei3+0m1ruHzpG1hcRnxptNOXzXDqQ=";
+ },
+}:
+
+let
+ src = thisSrc;
+ 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'
+ ]
+ },
+ include_package_data=True
+ )
+ '';
+
+ dummyManifest = writeText "MANIFEST.in" ''
+ recursive-include InteractiveHtmlBom/schema *
+ recursive-include InteractiveHtmlBom/web *
+ recursive-include InteractiveHtmlBom/dialog/bitmaps *
+ '';
+
+in python3Packages.buildPythonApplication {
+ pname = "interactive_html_bom";
+
+ inherit
+ version
+ src
+ ;
+
+ preBuild = ''
+ cp -nv ${dummySetupPy} setup.py
+ cp -nv ${dummyManifest} MANIFEST.in
+ rm pyproject.toml
+ '';
+
+ dependencies = with python3Packages; [
+ wxpython
+ jsonschema
+ kicad-small.base
+ ];
+
+ doCheck = false;
+}