kicad: properly wrap wxPython

This commit is contained in:
Jörg Thalheim 2018-07-31 14:37:59 +01:00
parent a4c932fa51
commit 611f0ed188
2 changed files with 27 additions and 9 deletions

View File

@ -1,10 +1,10 @@
{ wxGTK, lib, stdenv, fetchurl, cmake, libGLU_combined, zlib
, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig
, doxygen, pcre, libpthreadstubs, libXdmcp
, wrapGAppsHook
, oceSupport ? true, opencascade
, ngspiceSupport ? true, libngspice
, scriptingSupport ? true, swig, python, wxPython
, scriptingSupport ? true, swig, python, pythonPackages
}:
assert ngspiceSupport -> libngspice != null;
@ -34,17 +34,36 @@ stdenv.mkDerivation rec {
"-DKICAD_SCRIPTING_WXPYTHON=ON"
# nix installs wxPython headers in wxPython package, not in wxwidget
# as assumed. We explicitely set the header location.
"-DCMAKE_CXX_FLAGS=-I${wxPython}/include/wx-3.0"
"-DCMAKE_CXX_FLAGS=-I${pythonPackages.wxPython}/include/wx-3.0"
];
# https://www.mail-archive.com/kicad-developers@lists.launchpad.net/msg29840.html
nativeBuildInputs = [ (cmake.override {majorVersion = "3.10";}) doxygen pkgconfig ];
nativeBuildInputs = [
# https://www.mail-archive.com/kicad-developers@lists.launchpad.net/msg29840.html
(cmake.override {majorVersion = "3.10";})
doxygen
pkgconfig
wrapGAppsHook
pythonPackages.wrapPython
];
pythonPath = [ pythonPackages.wxPython ];
propagatedBuildInputs = [ pythonPackages.wxPython ];
buildInputs = [
libGLU_combined zlib libX11 wxGTK pcre libXdmcp gettext glew glm libpthreadstubs
cairo curl openssl boost
] ++ optional (oceSupport) opencascade
++ optional (ngspiceSupport) libngspice
++ optionals (scriptingSupport) [ swig python wxPython ];
++ optionals (scriptingSupport) [ swig python ];
# this breaks other applications in kicad
dontWrapGApps = true;
preFixup = ''
buildPythonPath "$out $pythonPath"
gappsWrapperArgs+=(--set PYTHONPATH "$program_PYTHONPATH")
wrapProgram "$out/bin/kicad" "''${gappsWrapperArgs[@]}"
'';
meta = {
description = "Free Software EDA Suite";

View File

@ -11829,7 +11829,7 @@ with pkgs;
sofia_sip = callPackage ../development/libraries/sofia-sip { };
soil = callPackage ../development/libraries/soil { };
sonic = callPackage ../development/libraries/sonic { };
soprano = callPackage ../development/libraries/soprano { };
@ -20744,7 +20744,6 @@ with pkgs;
kicad = callPackage ../applications/science/electronics/kicad {
wxGTK = wxGTK30;
inherit (pythonPackages) wxPython;
boost = boost160;
};
@ -20909,7 +20908,7 @@ with pkgs;
spyder = pythonPackages.spyder;
openspace = callPackage ../applications/science/astronomy/openspace { };
stellarium = libsForQt5.callPackage ../applications/science/astronomy/stellarium { };
tulip = callPackage ../applications/science/misc/tulip {