2019-12-15 11:26:23 +00:00
|
|
|
{ lib, stdenv, cmake, gettext
|
|
|
|
, fetchFromGitHub, fetchFromGitLab
|
|
|
|
, version, libSources
|
2019-11-26 11:02:49 +00:00
|
|
|
}:
|
|
|
|
|
2019-12-14 16:01:15 +00:00
|
|
|
# callPackage libraries {
|
|
|
|
# version = "unstable";
|
|
|
|
# libs.symbols = {
|
|
|
|
# rev = "09f9..";
|
|
|
|
# sha256 = "...";
|
|
|
|
# };
|
|
|
|
# };
|
2019-11-26 11:02:49 +00:00
|
|
|
with lib;
|
|
|
|
let
|
2020-03-16 23:27:18 +00:00
|
|
|
mkLib = name:
|
2020-03-28 00:39:57 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "kicad-${name}";
|
2020-08-07 07:46:49 +01:00
|
|
|
# Use the revision instead of `version` (which is an ISO 8601 date)
|
|
|
|
# to prevent duplicating the library when just the date changed
|
|
|
|
version = "${builtins.substring 0 10 libSources.${name}.rev}";
|
2020-03-28 00:39:57 +00:00
|
|
|
src = fetchFromGitHub (
|
|
|
|
{
|
|
|
|
owner = "KiCad";
|
|
|
|
repo = "kicad-${name}";
|
|
|
|
rev = version;
|
|
|
|
inherit name;
|
|
|
|
} // (libSources.${name} or { })
|
|
|
|
);
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
meta = rec {
|
|
|
|
license = licenses.cc-by-sa-40;
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
# the 3d models are a ~1 GiB download and occupy ~5 GiB in store.
|
|
|
|
# this would exceed the hydra output limit
|
|
|
|
hydraPlatforms = if (name == "packages3d" ) then [ ] else platforms;
|
2020-03-16 23:27:18 +00:00
|
|
|
};
|
2020-03-28 00:39:57 +00:00
|
|
|
};
|
2019-11-26 11:02:49 +00:00
|
|
|
in
|
2019-12-06 03:53:28 +00:00
|
|
|
{
|
2020-03-16 23:27:18 +00:00
|
|
|
symbols = mkLib "symbols";
|
|
|
|
templates = mkLib "templates";
|
|
|
|
footprints = mkLib "footprints";
|
|
|
|
packages3d = mkLib "packages3d";
|
2019-12-15 11:26:23 +00:00
|
|
|
|
|
|
|
# i18n is a special case, not actually a library
|
|
|
|
# more a part of kicad proper, but also optional and separate
|
|
|
|
# since their move to gitlab they're keeping it in a separate path
|
|
|
|
# kicad has no way to find i18n except through a path relative to its install path
|
|
|
|
# therefore this is being linked into ${kicad-base}/share/
|
|
|
|
# and defined here to make use of the rev & sha256's brought here for the libs
|
|
|
|
i18n = let name = "i18n"; in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "kicad-${name}";
|
2020-08-07 07:46:49 +01:00
|
|
|
version = "${builtins.substring 0 10 libSources.${name}.rev}";
|
2019-12-15 11:26:23 +00:00
|
|
|
src = fetchFromGitLab (
|
|
|
|
{
|
|
|
|
group = "kicad";
|
|
|
|
owner = "code";
|
|
|
|
repo = "kicad-${name}";
|
|
|
|
rev = version;
|
|
|
|
inherit name;
|
|
|
|
} // (libSources.${name} or { })
|
|
|
|
);
|
|
|
|
buildInputs = [ gettext ];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-03-28 00:39:57 +00:00
|
|
|
meta = {
|
|
|
|
license = licenses.gpl2; # https://github.com/KiCad/kicad-i18n/issues/3
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
};
|
2019-12-15 11:26:23 +00:00
|
|
|
};
|
2019-11-26 11:02:49 +00:00
|
|
|
}
|