Skip to content
Snippets Groups Projects
Commit 6479060b authored by Benjamin Koch's avatar Benjamin Koch
Browse files

add nixpkg for KiBot

parent cb001243
No related merge requests found
......@@ -461,6 +461,10 @@
- Nein, kann die Variante nicht. Meh. MAX3485AE*A*SA vs. MAX34*90*AE*G*SA. Letzterer kostet 6€ und ist nicht verfügbar.
- Dann teilen wir lieber die Busse wenn nötig.
- Mal alle Footprints und Symbols durchgehen, die ich selbst gebaut habe. -> Scheint alles zu passen.
- Das mit dem Export für JLC hatte ich schon mal in besser gesehen mit Zusatztools, also insbesondere Rotation korrigieren.
- https://github.com/Bouni/kicad-jlcpcb-tools
- https://github.com/matthewlai/JLCKicadTools
- evtl Kibot und so
TODO und weitere Gedanken:
......
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1670009809,
"narHash": "sha256-yt/dQ32Vz4WenDLu4XeHbnXFxiHbTcnU0WwiLW5Ce6c=",
"path": "/nix/store/0ljv28gdwhlfm9629qaxg95g04jzcf9j-source",
"rev": "660e7737851506374da39c0fa550c202c824a17c",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
{
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; prev = pkgs; in
{
# see https://discourse.nixos.org/t/add-python-package-via-overlay/19783/4
other.pythonPackagesOverlays = (prev.pythonPackagesOverlays or [ ]) ++ [
(python-final: python-prev: {
pybars3 = python-final.callPackage nix/pybars3.nix { };
pymeta3 = python-final.callPackage nix/pymeta3.nix { };
qrcodegen = python-final.callPackage nix/qrcodegen.nix { };
svgutils = python-final.callPackage nix/svgutils.nix { };
})
];
other.python3Packages = self.packages.${system}.python3.pkgs;
packages = with self.other.${system}; rec {
python3 = prev.python39.override {
self = python3;
packageOverrides = prev.lib.composeManyExtensions pythonPackagesOverlays;
};
kikit = python3Packages.callPackage nix/kikit.nix { };
kiauto = python3Packages.callPackage nix/kiauto.nix { };
kibot = python3Packages.buildPythonApplication {
pname = "KiBot";
version = "2";
src = pkgs.fetchFromGitHub {
owner = "INTI-CMNB";
repo = "KiBot";
rev = "v2";
hash = "sha256-ArOKcJLwhLKXNRQIWXzWvMsjC7tJQQoi1kfRHNVdQ+o=";
};
propagatedBuildInputs = (with python3Packages; [
pyaml
requests
markdown2
mistune
qrcode
colorama
numpy
qrcodegen
XlsxWriter
lxml
lark
svgutils
]) ++ (with pkgs; [
openscad
xorg.xorgserver
xvfb-run
blender
git
imagemagick
librsvg
ghostscript
pandoc
]) ++ [
kikit
kiauto
];
# Tests will test more features than we need (and thus need more dependencies) so let's skip them.
doCheck = false;
#postPatch = ''
# #sed -i 's/from .macros import macros, /from .macros import /' kibot/*.py
# echo "def macros():" >>kibot/macros.py
# echo ' """dummy"""' >>kibot/macros.py
# echo ' pass' >>kibot/macros.py
#'';
postInstall = ''
# KiBot seems to have some way of auto-importing stuff and that breaks if there are .pyc files.
# (ERROR:Make sure you used `--no-compile` if you used pip for installation (kibot - kiplot.py:79))
rm $out/lib/python*/site-packages/kibot/__pycache__/*.pyc
'';
};
default = kibot;
};
apps = rec {
kikit = flake-utils.lib.mkApp { drv = self.packages.${system}.kikit; };
kibot = flake-utils.lib.mkApp { drv = self.packages.${system}.kibot; };
default = kibot;
};
devShells.default = with self.packages.${system}; pkgs.mkShell {
packages = [
(python3.withPackages (p: [ kibot ]))
kibot
pkgs.hello
];
};
}
);
}
\ No newline at end of file
{ lib
, fetchFromGitHub
, buildPythonApplication
, psutil
, kicad
, xorg
, xdotool
, libxslt
, imagemagick
, xclip
, x11vnc
, fluxbox
, wmctrl
, xvfbwrapper
}:
buildPythonApplication rec {
pname = "KiAuto";
version = "2.2.5";
src = fetchFromGitHub {
owner = "INTI-CMNB";
repo = pname;
rev = "v${version}";
hash = "sha256-CovbN8squukC47j4A+SEJKX3R67PK/YvTPj0MoUB/Ps=";
};
propagatedBuildInputs = [
kicad
psutil
xvfbwrapper
xorg.xorgserver
xdotool
libxslt
imagemagick
xclip
x11vnc
fluxbox
wmctrl
];
}
\ No newline at end of file
kibot = python3Packages.buildPythonApplication {
pname = "KiBot";
version = "2";
src = pkgs.fetchFromGitHub {
owner = "INTI-CMNB";
repo = "KiBot";
rev = "v2";
hash = "sha256-ArOKcJLwhLKXNRQIWXzWvMsjC7tJQQoi1kfRHNVdQ+o=";
};
propagatedBuildInputs = (with python3Packages; [
pyaml
requests
markdown2
mistune
qrcode
colorama
numpy
qrcodegen
XlsxWriter
lxml
lark
svgutils
]) ++ (with pkgs; [
openscad
xorg.xorgserver
xvfb-run
blender
git
imagemagick
librsvg
ghostscript
pandoc
]) ++ [
kikit
kiauto
];
};
\ No newline at end of file
{ lib
, fetchFromGitHub
, buildPythonApplication
, numpy
, shapely
, click
, markdown2
, pybars3
, kicad
}:
buildPythonApplication {
pname = "KiKit";
src = fetchFromGitHub {
owner = "yaqwsx";
repo = "KiKit";
rev = "c76c51e1dedeb79ad46414541d89c9a031133fef";
sha256 = "1dmyvjm9bllgirli6jr12d2dvy9795qa49j0n2jhsq05hvp0p8gn";
};
version = "c76c51e";
propagatedBuildInputs = [
numpy
shapely
click
markdown2
pybars3
kicad
];
}
# copied from https://github.com/evils/nixpkgs/commit/f3ff36007c85ea201296c03fc55e457f7ff1ebdd
{ lib
, fetchPypi
, buildPythonPackage
, pymeta3
}:
buildPythonPackage rec {
pname = "pybars3";
version = "0.9.7";
src = fetchPypi {
inherit pname version;
sha256 = "0lp2q0gazy8nii9g8ybzfszjfpj7234i5wbajddrqfz50pllgj3a";
};
propagatedBuildInputs = [ pymeta3 ];
# some deprecation notice on the test seemed like a good excuse not to get it working
doCheck = false;
meta = with lib; {
description = "Handlebars.js template support";
homepage = "https://github.com/wbond/pybars3";
license = licenses.lgpl3;
maintainers = with maintainers; [ evils ];
};
}
\ No newline at end of file
# https://github.com/evils/nixpkgs/blob/f3ff36007c85ea201296c03fc55e457f7ff1ebdd/pkgs/development/python-modules/pymeta3/default.nix
{ lib
, fetchPypi
, buildPythonPackage
}:
buildPythonPackage rec {
pname = "pymeta3";
version = "0.5.1";
src = fetchPypi {
pname = "PyMeta3";
inherit version;
sha256 = "1jsvs20qdnflap7qna37n1w4v5k4d34hpvn0py3zbfx9v4ka7g8q";
};
# some deprecation notice on the test seemed like a good excuse not to get it working
doCheck = false;
meta = with lib; {
description = "A Python 3 compatible fork of pymeta";
homepage = "https://github.com/wbond/pymeta3";
license = licenses.mit;
maintainers = with maintainers; [ evils ];
};
}
\ No newline at end of file
{ lib
, fetchPypi
, fetchFromGitHub
, buildPythonPackage
}:
buildPythonPackage rec {
pname = "qrcodegen";
version = "1.8.0";
#src = fetchPypi {
# inherit pname version;
#};
src = let fullSrc = fetchFromGitHub {
owner = "nayuki";
repo = "QR-Code-generator";
rev = "v${version}";
hash = "sha256-aci5SFBRNRrSub4XVJ2luHNZ2pAUegjgQ6pD9kpkaTY=";
}; in "${fullSrc}/python";
}
\ No newline at end of file
{ lib
, fetchPypi
, buildPythonPackage
, lxml
}:
buildPythonPackage rec {
pname = "svgutils";
version = "0.3.4";
src = fetchPypi {
inherit pname version;
hash = "sha256-nvSPRMsdRgp3R90CaUIA/aJeufr23qOSEY3vJpXg4FM=";
};
propagatedBuildInputs = [
lxml
];
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment