kicad: bunch of minor cleanup

squash of the following

kicad: makeFlags: optional -> optionals

kicad: remove -1 in version string, no more patch

should have been removed in a52e974cff

kicad: remove berce as maintainer

kicad: gtk3 -> wxGTK.gtk

use wxGTK.gtk rather than gtk3

add graphviz as doxygen wants it (no idea if doxygen is required...)
  minor compilation warning

kicad: rearrange / sort inputs

separate optional deps and options

kicad: clear some configuration warnings

linux specific stuff that's wanted by something in config

kicad: fix opening bug report in firefox wayland

may be removed when kicad goes native?
This commit is contained in:
Evils 2021-04-23 05:55:43 +02:00
parent 3fe839e78c
commit 7dc05fed4f
2 changed files with 71 additions and 42 deletions

View file

@ -15,30 +15,42 @@
, boost
, pkg-config
, doxygen
, graphviz
, pcre
, libpthreadstubs
, libXdmcp
, lndir
, util-linux
, libselinux
, libsepol
, libthai
, libdatrie
, libxkbcommon
, epoxy
, dbus
, at-spi2-core
, libXtst
, swig
, python
, wxPython
, opencascade
, opencascade-occt
, libngspice
, valgrind
, stable
, baseName
, kicadSrc
, kicadVersion
, i18n
, withOCE
, opencascade
, withOCC
, opencascade-occt
, withNgspice
, libngspice
, withScripting
, swig
, python
, wxPython
, debug
, valgrind
, withI18n
, gtk3
}:
assert lib.asserts.assertMsg (!(withOCE && stdenv.isAarch64)) "OCE fails a test on Aarch64";
@ -56,43 +68,59 @@ stdenv.mkDerivation rec {
# tagged releases don't have "unknown"
# kicad nightlies use git describe --dirty
# nix removes .git, so its approximated here
# "-1" appended to indicate we're adding a patch
postPatch = ''
substituteInPlace CMakeModules/KiCadVersion.cmake \
--replace "unknown" "${builtins.substring 0 10 src.rev}-1" \
--replace "${version}" "${version}-1"
--replace "unknown" "${builtins.substring 0 10 src.rev}" \
'';
makeFlags = optional (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
makeFlags = optionals (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
cmakeFlags =
optionals (withScripting) [
"-DKICAD_SCRIPTING=ON"
"-DKICAD_SCRIPTING_MODULES=ON"
"-DKICAD_SCRIPTING_PYTHON3=ON"
"-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
]
++ optional (!withScripting)
"-DKICAD_SCRIPTING=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"
]
++ optionals (debug) [
"-DCMAKE_BUILD_TYPE=Debug"
"-DKICAD_STDLIB_DEBUG=ON"
"-DKICAD_USE_VALGRIND=ON"
]
;
cmakeFlags = optionals (withScripting) [
"-DKICAD_SCRIPTING=ON"
"-DKICAD_SCRIPTING_MODULES=ON"
"-DKICAD_SCRIPTING_PYTHON3=ON"
"-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
]
++ optional (!withScripting)
"-DKICAD_SCRIPTING=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"
]
++ optionals (debug) [
"-DCMAKE_BUILD_TYPE=Debug"
"-DKICAD_STDLIB_DEBUG=ON"
"-DKICAD_USE_VALGRIND=ON"
];
nativeBuildInputs = [ cmake doxygen pkg-config lndir ];
nativeBuildInputs = [
cmake
doxygen
graphviz
pkg-config
lndir
]
# wanted by configuration on linux, doesn't seem to affect performance
# no effect on closure size
++ optionals (stdenv.isLinux) [
util-linux
libselinux
libsepol
libthai
libdatrie
libxkbcommon
epoxy
dbus.daemon
at-spi2-core
libXtst
];
buildInputs = [
libGLU
@ -100,6 +128,7 @@ stdenv.mkDerivation rec {
zlib
libX11
wxGTK
wxGTK.gtk
pcre
libXdmcp
gettext
@ -110,7 +139,6 @@ stdenv.mkDerivation rec {
curl
openssl
boost
gtk3
]
++ optionals (withScripting) [ swig python wxPython ]
++ optional (withNgspice) libngspice

View file

@ -195,6 +195,8 @@ stdenv.mkDerivation rec {
# wrapGAppsHook did these two as well, no idea if it matters...
"--prefix XDG_DATA_DIRS : ${cups}/share"
"--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)
[
@ -278,8 +280,7 @@ stdenv.mkDerivation rec {
The Programs handle Schematic Capture, and PCB Layout with Gerber output.
'';
license = lib.licenses.gpl3Plus;
# berce seems inactive...
maintainers = with lib.maintainers; [ evils kiwi berce ];
maintainers = with lib.maintainers; [ evils kiwi ];
# kicad is cross platform
platforms = lib.platforms.all;
# despite that, nipkgs' wxGTK for darwin is "wxmac"