mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
See https://gitlab.com/kicad/code/kicad/-/tree/10.0.0?ref_type=tags and https://www.kicad.org/blog/2026/03/Version-10.0.0-Released/ for further reference.
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
cmake,
|
|
libSrc,
|
|
compressStep,
|
|
stepreduce,
|
|
parallel,
|
|
python3,
|
|
zip,
|
|
}:
|
|
let
|
|
mkLib =
|
|
name:
|
|
stdenv.mkDerivation {
|
|
pname = "kicad-${name}";
|
|
version = builtins.substring 0 10 (libSrc name).rev;
|
|
|
|
src = libSrc name;
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
]
|
|
++ lib.optionals (name == "packages3d") [
|
|
stepreduce
|
|
parallel
|
|
zip
|
|
]
|
|
++ lib.optionals (name == "symbols") [
|
|
python3
|
|
];
|
|
|
|
postInstall =
|
|
lib.optionalString (name == "packages3d") ''
|
|
find $out -type f -name '*.step' | parallel 'stepreduce {} {} ${lib.optionalString compressStep "&& zip -j -9 {.}.stpZ {} && rm {}"}'
|
|
''
|
|
+ lib.optionalString ((name == "footprints") && compressStep) ''
|
|
grep -rl '\.step' $out | xargs sed -i 's/\.step/.stpZ/g'
|
|
'';
|
|
|
|
meta = {
|
|
license = lib.licenses.cc-by-sa-40;
|
|
platforms = lib.platforms.all;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
symbols = mkLib "symbols";
|
|
templates = mkLib "templates";
|
|
footprints = mkLib "footprints";
|
|
packages3d = mkLib "packages3d";
|
|
}
|