Files
nixpkgs/pkgs/by-name/ki/kikit/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

113 lines
2.2 KiB
Nix

{
bc,
zip,
lib,
fetchFromGitHub,
bats,
buildPythonApplication,
pythonOlder,
callPackage,
kicad,
numpy,
click,
markdown2,
openscad,
pytestCheckHook,
commentjson,
wxpython,
pcbnewtransition,
pybars3,
versioneer,
shapely,
setuptools,
nix-update-script,
}:
let
solidpython = callPackage ./solidpython { };
in
buildPythonApplication rec {
pname = "kikit";
version = "1.7.2";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "yaqwsx";
repo = "KiKit";
tag = "v${version}";
hash = "sha256-HSAQJJqJMVh44wgOQm+0gteShLogklBFuIzWtoVTf9I=";
# Upstream uses versioneer, which relies on gitattributes substitution.
# This leads to non-reproducible archives on GitHub.
# See https://github.com/NixOS/nixpkgs/issues/84312
postFetch = ''
rm "$out/kikit/_version.py"
'';
};
build-system = [
setuptools
];
dependencies = [
kicad
numpy
click
markdown2
# OpenSCAD is an optional dependency (see
# https://github.com/yaqwsx/KiKit/blob/v1.5.0/docs/installation/intro.md#optional-dependencies).
openscad
commentjson
# https://github.com/yaqwsx/KiKit/issues/575
wxpython
pcbnewtransition
pybars3
shapely
# https://github.com/yaqwsx/KiKit/issues/576
solidpython
];
nativeBuildInputs = [
versioneer
bc
zip
];
nativeCheckInputs = [
pytestCheckHook
bats
];
pythonImportsCheck = [
"kikit"
];
postPatch = ''
# Recreate _version.py, deleted at fetch time due to non-reproducibility.
echo 'def get_versions(): return {"version": "${version}"}' > kikit/_version.py
'';
preCheck = ''
export PATH=$PATH:$out/bin
make test-system
# pytest needs to run in a subdir. See https://github.com/yaqwsx/KiKit/blob/v1.3.0/Makefile#L43
cd test/units
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Automation for KiCAD boards";
homepage = "https://github.com/yaqwsx/KiKit/";
changelog = "https://github.com/yaqwsx/KiKit/releases/tag/${src.tag}";
maintainers = with lib.maintainers; [
jfly
matusf
];
teams = with lib.teams; [ ngi ];
license = lib.licenses.mit;
};
}