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
48 lines
973 B
Nix
48 lines
973 B
Nix
{
|
|
lib,
|
|
stdenv,
|
|
cmake,
|
|
libSrc,
|
|
stepreduce,
|
|
parallel,
|
|
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
|
|
];
|
|
|
|
postInstall =
|
|
lib.optionalString (name == "packages3d") ''
|
|
find $out -type f -name '*.step' | parallel 'stepreduce {} {} && zip -9 {.}.stpZ {} && rm {}'
|
|
''
|
|
+ lib.optionalString (name == "footprints") ''
|
|
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";
|
|
}
|