kicad: 5.1.12 -> 6.0.0

remove old build conditionals
  the old wrapper env vars are no longer applicable to 6.0.0
  scripting is no longer optional
    though wxPython is still an optional dependency?

add withI18n build option to kicad.base
  i18n was moved to the kicad source, and is disabled by default
    withI18n takes the same default

add withPCM option
  to allow disabling building the Plugin and Content Manager

remove the withOCE option
  the build option was removed in upstream commit:
    1c5c052301b607a0cf8b8ed6681f1db1622a865b

and unconditionally use wxGTK31-gtk3 and wxPython
  the pcb editor's python terminal seems to work with these versions
main
Evils 3 years ago
parent b7f9203059
commit 78f0769183
  1. 39
      pkgs/applications/science/electronics/kicad/base.nix
  2. 49
      pkgs/applications/science/electronics/kicad/default.nix
  3. 24
      pkgs/applications/science/electronics/kicad/versions.nix

@ -35,7 +35,6 @@
, swig
, python
, wxPython
, opencascade
, opencascade-occt
, libngspice
, valgrind
@ -45,21 +44,16 @@
, kicadSrc
, kicadVersion
, i18n
, withOCE
, withOCC
, withNgspice
, withScripting
, withI18n
, withPCM
, debug
, sanitizeAddress
, sanitizeThreads
, withI18n
}:
assert lib.asserts.assertMsg (!(withOCE && stdenv.isAarch64)) "OCE fails a test on Aarch64";
assert lib.asserts.assertMsg (!(withOCC && withOCE))
"Only one of OCC and OCE may be enabled";
assert lib.assertMsg (!(stable && (sanitizeAddress || sanitizeThreads)))
"Only kicad-unstable(-small) supports address/thread sanitation";
assert lib.assertMsg (!(sanitizeAddress && sanitizeThreads))
"'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one.";
@ -75,6 +69,7 @@ stdenv.mkDerivation rec {
# tagged releases don't have "unknown"
# kicad nightlies use git describe --dirty
# nix removes .git, so its approximated here
# "6.99.0" doesn't have "-unknown", yet; so leaving this in case it returns
postPatch = ''
substituteInPlace CMakeModules/KiCadVersion.cmake \
--replace "unknown" "${builtins.substring 0 10 src.rev}" \
@ -82,23 +77,14 @@ stdenv.mkDerivation rec {
makeFlags = optionals (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
cmakeFlags = optionals (stable && withScripting) [
"-DKICAD_SCRIPTING=ON"
"-DKICAD_SCRIPTING_MODULES=ON"
"-DKICAD_SCRIPTING_PYTHON3=ON"
"-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
cmakeFlags = optionals (withScripting) [
"-DKICAD_SCRIPTING_WXPYTHON=ON"
]
++ optionals (!withScripting) [
"-DKICAD_SCRIPTING=OFF"
"-DKICAD_SCRIPTING_WXPYTHON=OFF"
]
++ optional (withNgspice) "-DKICAD_SPICE=ON"
++ optional (!withOCE) "-DKICAD_USE_OCE=OFF"
++ optional (!withOCC) "-DKICAD_USE_OCC=OFF"
++ optionals (withOCE) [
"-DKICAD_USE_OCE=ON"
"-DOCE_DIR=${opencascade}"
]
++ optionals (withOCC) [
"-DKICAD_USE_OCC=ON"
"-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade"
@ -113,6 +99,12 @@ stdenv.mkDerivation rec {
]
++ optionals (sanitizeThreads) [
"-DKICAD_SANITIZE_THREADS=ON"
]
++ optionals (withI18n) [
"-DKICAD_BUILD_I18N=ON"
]
++ optionals (!withPCM) [
"-DKICAD_PCM=OFF"
];
nativeBuildInputs = [
@ -154,20 +146,17 @@ stdenv.mkDerivation rec {
curl
openssl
boost
swig
python
]
# unstable requires swig and python
# wxPython still optional
++ optionals (withScripting || (!stable)) [ swig python ]
++ optional (withScripting) wxPython
++ optional (withNgspice) libngspice
++ optional (withOCE) opencascade
++ optional (withOCC) opencascade-occt
++ optional (debug) valgrind
;
# debug builds fail all but the python test
# 5.1.x fails the eeschema test
doInstallCheck = !debug && !stable;
doInstallCheck = !debug;
installCheckTarget = "test";
dontStrip = debug;

@ -2,8 +2,7 @@
, fetchFromGitLab
, gnome
, dconf
, wxGTK30
, wxGTK31
, wxGTK31-gtk3
, makeWrapper
, gsettings-desktop-schemas
, hicolor-icon-theme
@ -15,7 +14,6 @@
, pname ? "kicad"
, stable ? true
, oceSupport ? false
, withOCE ? false
, withOCCT ? false
, withOCC ? true
, ngspiceSupport ? false
@ -28,7 +26,8 @@
, sanitizeAddress ? false
, sanitizeThreads ? false
, with3d ? true
, withI18n ? true
, withI18n ? false
, withPCM ? true # Plugin and Content Manager
, srcs ? { }
}:
@ -71,8 +70,6 @@
assert withNgspice -> libngspice != null;
assert lib.assertMsg (!ngspiceSupport)
"`nspiceSupport` was renamed to `withNgspice` for the sake of consistency with other kicad nix arguments.";
assert lib.assertMsg (!oceSupport)
"`oceSupport` was renamed to `withOCE` for the sake of consistency with other kicad nix arguments.";
assert lib.assertMsg (!scriptingSupport)
"`scriptingSupport` was renamed to `withScripting` for the sake of consistency with other kicad nix arguments.";
assert lib.assertMsg (!withOCCT)
@ -132,25 +129,9 @@ let
if srcOverridep "libVersion" then srcs.libVersion
else versionsImport.${baseName}.libVersion.version;
wxGTK =
if (stable)
# wxGTK3x may default to withGtk2 = false, see #73145
then
wxGTK30.override
{
withGtk2 = false;
}
# wxGTK31 currently introduces an issue with opening the python interpreter in pcbnew
# but brings high DPI support?
else
wxGTK31.override {
withGtk2 = false;
};
wxGTK = wxGTK31-gtk3;
python = python3;
wxPython = if (stable)
then python.pkgs.wxPython_4_0
else python.pkgs.wxPython_4_1;
wxPython = python.pkgs.wxPython_4_1;
inherit (lib) concatStringsSep flatten optionalString optionals;
in
@ -164,7 +145,7 @@ stdenv.mkDerivation rec {
inherit kicadSrc kicadVersion;
inherit (passthru) i18n;
inherit wxGTK python wxPython;
inherit withI18n withOCC withOCE withNgspice withScripting;
inherit withOCC withNgspice withScripting withI18n withPCM;
inherit debug sanitizeAddress sanitizeThreads;
};
@ -197,27 +178,14 @@ stdenv.mkDerivation rec {
"--prefix GIO_EXTRA_MODULES : ${dconf}/lib/gio/modules"
# required to open a bug report link in firefox-wayland
"--set-default MOZ_DBUS_REMOTE 1"
]
++ optionals (stable)
[
"--set-default KISYSMOD ${footprints}/share/kicad/modules"
"--set-default KICAD_SYMBOL_DIR ${symbols}/share/kicad/library"
"--set-default KICAD_TEMPLATE_DIR ${templates}/share/kicad/template"
"--prefix KICAD_TEMPLATE_DIR : ${symbols}/share/kicad/template"
"--prefix KICAD_TEMPLATE_DIR : ${footprints}/share/kicad/template"
]
++ optionals (stable && with3d) [ "--set-default KISYS3DMOD ${packages3d}/share/kicad/modules/packages3d" ]
++ optionals (!stable)
[
"--set-default KICAD6_FOOTPRINT_DIR ${footprints}/share/kicad/footprints"
"--set-default KICAD6_SYMBOL_DIR ${symbols}/share/kicad/symbols"
"--set-default KICAD6_TEMPLATE_DIR ${templates}/share/kicad/template"
"--prefix KICAD6_TEMPLATE_DIR : ${symbols}/share/kicad/template"
"--prefix KICAD6_TEMPLATE_DIR : ${footprints}/share/kicad/template"
]
++ optionals (!stable && with3d)
++ optionals (with3d)
[
"--set-default KISYS3DMOD ${packages3d}/share/kicad/3dmodels"
"--set-default KICAD6_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels"
]
++ optionals (withNgspice) [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
@ -259,9 +227,6 @@ stdenv.mkDerivation rec {
ln -s ${base}/share/applications $out/share/applications
ln -s ${base}/share/icons $out/share/icons
ln -s ${base}/share/mime $out/share/mime
'' + optionalString (stable) ''
ln -s ${base}/share/appdata $out/share/appdata
'' + optionalString (!stable) ''
ln -s ${base}/share/metainfo $out/share/metainfo
'';

@ -3,25 +3,25 @@
{
"kicad" = {
kicadVersion = {
version = "5.1.12";
version = "6.0.0";
src = {
rev = "84ad8e8a86f13c0697f5cbed8c17977b6545ddc9";
sha256 = "0kgikchqxds3mp71nkg307mr4c1dgv8akbmksz4w9x8jg4i1mfqq";
rev = "d3dd2cf0fa975548d027db88d19b8a88866866d8";
sha256 = "1jrfwyi4zs0rpcpsj01z6687a433nnr56cxbnz12jfg2yafpxk23";
};
};
libVersion = {
version = "5.1.12";
version = "6.0.0";
libSources = {
i18n.rev = "0ad3d7e469e31c8868ad83f90e22a9c18f16aa1f";
i18n.sha256 = "0y51l0r62cnxkvpc21732p3cx7pjvaqjih8193502hlv9kv1j9p6";
symbols.rev = "97c0bfdd2f5ebe952bc90c60f080a8e41da60615";
symbols.sha256 = "1zdajim409570xzis53kmrbdcf7000v2vmc90f49h214lrx2zhr2";
templates.rev = "eca0f632eb76c8f49de4d5a590c83543090d0b7d";
templates.sha256 = "1fbhn1l3j2rwc29aida9b408wif55i23bp9ddcs7dvf83smjm05g";
footprints.rev = "b65732f8ebd7ab894fd638f3f2bf4a4e9b24f653";
footprints.sha256 = "0qpii55dgv2gxqg1qq0dngdnbb9din790qi5qv0l6qqrzx843h5s";
packages3d.rev = "0ddd588650fede09766b704feb15d30bcb6e144f";
packages3d.sha256 = "12w7m5nbk9kcnlnlg4sk1sd7xgb9i2kxfi0jcbd0phs89qyl7wjr";
symbols.rev = "275f22eb9eecd5b6deabdefd82c9a826254d9f23";
symbols.sha256 = "0wjk464l60xknvgc9d870901lqnx296dw7amlh3wg0wf78izarfr";
templates.rev = "3a422b5b0928f3fd31579769d4dee2b009a85a11";
templates.sha256 = "0vbjy1v5923942ma0rqcp1dhylhxk1m4vyfxjxw13sizkrpmlwr1";
footprints.rev = "3ea7895b0817abecaa34276346749a711b0c69f6";
footprints.sha256 = "0jv2plwzhhkfx7a2zankkjkbfzjxv43ab8rqpxzqfq2fnx83q6r5";
packages3d.rev = "e607286d4a48ddf654585b37b45d74416a9a70c7";
packages3d.sha256 = "0vwcbzq42hzjl4f0zjaswmiff1x59hv64g5n00mx1gl0gwngnyla";
};
};
};

Loading…
Cancel
Save