kicad: update & cleanup

minor simplification, fix base version

split i18n and get from gitlab

correct wrapper pythonpath, cleanup build output

update & fake git describe

correct base.nix to fit contributing.md
This commit is contained in:
Evils
2020-01-02 03:45:34 +01:00
parent 6119ca27bb
commit e4786f3a1c
4 changed files with 76 additions and 54 deletions
@@ -1,6 +1,6 @@
{ lib, stdenv, fetchFromGitHub, cmake, gettext
, version
, libSources
{ lib, stdenv, cmake, gettext
, fetchFromGitHub, fetchFromGitLab
, version, libSources
}:
# callPackage libraries {
@@ -13,33 +13,52 @@
with lib;
let
mkLib = name: attrs:
stdenv.mkDerivation ({
name = "kicad-${name}-${version}";
src = fetchFromGitHub ({
owner = "KiCad";
repo = "kicad-${name}";
rev = version;
inherit name;
} // (libSources.${name} or {}));
nativeBuildInputs = [ cmake ];
} // attrs);
stdenv.mkDerivation (
{
pname = "kicad-${name}";
version = "${version}";
src = fetchFromGitHub (
{
owner = "KiCad";
repo = "kicad-${name}";
rev = version;
inherit name;
} // (libSources.${name} or { })
);
nativeBuildInputs = [ cmake ];
meta.license = licenses.cc-by-sa-40;
} // attrs
);
in
{
symbols = mkLib "symbols" {
meta.license = licenses.cc-by-sa-40;
};
templates = mkLib "templates" {
meta.license = licenses.cc-by-sa-40;
};
footprints = mkLib "footprints" {
meta.license = licenses.cc-by-sa-40;
};
i18n = mkLib "i18n" {
buildInputs = [ gettext ];
meta.license = licenses.gpl2; # https://github.com/KiCad/kicad-i18n/issues/3
};
symbols = mkLib "symbols" { };
templates = mkLib "templates" { };
footprints = mkLib "footprints" { };
packages3d = mkLib "packages3d" {
hydraPlatforms = []; # this is a ~1 GiB download, occupies ~5 GiB in store
meta.license = licenses.cc-by-sa-40;
};
# 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}";
version = "${version}";
src = fetchFromGitLab (
{
group = "kicad";
owner = "code";
repo = "kicad-${name}";
rev = version;
inherit name;
} // (libSources.${name} or { })
);
buildInputs = [ gettext ];
nativeBuildInputs = [ cmake ];
meta.license = licenses.gpl2; # https://github.com/KiCad/kicad-i18n/issues/3
};
}