From 7dc05fed4f27268995be0101f96d81ff78d18666 Mon Sep 17 00:00:00 2001 From: Evils Date: Fri, 23 Apr 2021 05:55:43 +0200 Subject: [PATCH] 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 a52e974cff8 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? --- .../science/electronics/kicad/base.nix | 108 +++++++++++------- .../science/electronics/kicad/default.nix | 5 +- 2 files changed, 71 insertions(+), 42 deletions(-) diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix index 1a5c0de5fb7f..e5119af49529 100644 --- a/pkgs/applications/science/electronics/kicad/base.nix +++ b/pkgs/applications/science/electronics/kicad/base.nix @@ -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 diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix index 81c687c07ece..9d27b59dd5bd 100644 --- a/pkgs/applications/science/electronics/kicad/default.nix +++ b/pkgs/applications/science/electronics/kicad/default.nix @@ -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"