diff options
author | Gabriel Ebner <gebner@gebner.org> | 2020-01-03 20:14:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-03 20:14:07 +0100 |
commit | 3604ae8394483d6a5e68a026cec0032aa91e592c (patch) | |
tree | 0c66aa67b117ec1ab4dc30085b1fd8d2fbb53999 /pkgs/applications/science/electronics/kicad/libraries.nix | |
parent | f4adb7c4d897485559c4f8b35f1be653e28e6893 (diff) | |
parent | e4786f3a1c75b6e2cc9b77063d0937801ce43b11 (diff) | |
download | nixpkgs-3604ae8394483d6a5e68a026cec0032aa91e592c.tar nixpkgs-3604ae8394483d6a5e68a026cec0032aa91e592c.tar.gz nixpkgs-3604ae8394483d6a5e68a026cec0032aa91e592c.tar.bz2 nixpkgs-3604ae8394483d6a5e68a026cec0032aa91e592c.tar.lz nixpkgs-3604ae8394483d6a5e68a026cec0032aa91e592c.tar.xz nixpkgs-3604ae8394483d6a5e68a026cec0032aa91e592c.tar.zst nixpkgs-3604ae8394483d6a5e68a026cec0032aa91e592c.zip |
Merge pull request #74259 from Evils-Devils/kicad-unstable
kicad: cleanup, fix and update
Diffstat (limited to 'pkgs/applications/science/electronics/kicad/libraries.nix')
-rw-r--r-- | pkgs/applications/science/electronics/kicad/libraries.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/applications/science/electronics/kicad/libraries.nix b/pkgs/applications/science/electronics/kicad/libraries.nix new file mode 100644 index 00000000000..53e190d2749 --- /dev/null +++ b/pkgs/applications/science/electronics/kicad/libraries.nix @@ -0,0 +1,64 @@ +{ lib, stdenv, cmake, gettext +, fetchFromGitHub, fetchFromGitLab +, version, libSources +}: + +# callPackage libraries { +# version = "unstable"; +# libs.symbols = { +# rev = "09f9.."; +# sha256 = "..."; +# }; +# }; +with lib; +let + mkLib = name: 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" { }; + templates = mkLib "templates" { }; + footprints = mkLib "footprints" { }; + packages3d = mkLib "packages3d" { + hydraPlatforms = []; # this is a ~1 GiB download, occupies ~5 GiB in store + }; + + # 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 + }; +} |