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

View File

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