kicad-unstable: wrap
use wxGTK31 brings hiDPI support no python shell...
This commit is contained in:
parent
e5daa9501b
commit
6477f717e3
@ -1,57 +1,161 @@
|
|||||||
{ wxGTK, lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, zlib
|
{ lib, stdenv, fetchFromGitLab, cmake, libGLU, libGL, zlib, wxGTK
|
||||||
, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig
|
, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig
|
||||||
, doxygen, pcre, libpthreadstubs, libXdmcp
|
, doxygen, pcre, libpthreadstubs, libXdmcp, makeWrapper, gnome3
|
||||||
|
, gsettings-desktop-schemas, librsvg, hicolor-icon-theme, cups
|
||||||
|
, fetchpatch, kicad-libraries, lndir
|
||||||
|
|
||||||
, oceSupport ? true, opencascade
|
, oceSupport ? true, opencascade
|
||||||
|
, withOCCT ? false, opencascade-occt
|
||||||
, ngspiceSupport ? true, libngspice
|
, ngspiceSupport ? true, libngspice
|
||||||
, scriptingSupport ? true, swig, python, wxPython
|
, scriptingSupport ? true, swig, python, pythonPackages, wxPython
|
||||||
|
, debug ? false, valgrind
|
||||||
|
, with3d ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
||||||
assert ngspiceSupport -> libngspice != null;
|
assert ngspiceSupport -> libngspice != null;
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
# oce on aarch64 fails a test
|
||||||
|
let
|
||||||
|
withOCC = (stdenv.isAarch64 && (withOCCT || oceSupport)) || (!stdenv.isAarch64 && withOCCT);
|
||||||
|
withOCE = oceSupport && !stdenv.isAarch64 && !withOCC;
|
||||||
|
|
||||||
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "kicad-unstable";
|
pname = "kicad-unstable";
|
||||||
version = "2018-06-12";
|
version = "2019-12-05";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitLab {
|
||||||
owner = "KICad";
|
group = "kicad";
|
||||||
repo = "kicad-source-mirror";
|
owner = "code";
|
||||||
rev = "bc7bd107d980da147ad515aeae0469ddd55c2368";
|
repo = "kicad";
|
||||||
sha256 = "11nsx52pd3jr2wbzr11glmcs1a9r7z1mqkqx6yvlm0awbgd8qlv8";
|
rev = "65ef8c18944947c3305619032bd1aedbe8b99d64";
|
||||||
|
sha256 = "0p0bm2yb34gqwks3qppwzgf5nylmn85psx2wwgk34yc8hs1p7yq0";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://github.com/johnbeard/kicad/commit/dfb1318a3989e3d6f9f2ac33c924ca5030ea273b.patch";
|
||||||
|
sha256 = "00ifd3fas8lid8svzh1w67xc8kyx89qidp7gm633r014j3kjkgcd";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace CMakeModules/KiCadVersion.cmake \
|
substituteInPlace CMakeModules/KiCadVersion.cmake \
|
||||||
--replace no-vcs-found ${version}
|
--replace "unknown" ${version}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
makeFlags = optional (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
|
||||||
|
|
||||||
cmakeFlags =
|
cmakeFlags =
|
||||||
optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade}" ]
|
optionals (scriptingSupport) [
|
||||||
++ optional (ngspiceSupport) "-DKICAD_SPICE=ON"
|
|
||||||
++ optionals (scriptingSupport) [
|
|
||||||
"-DKICAD_SCRIPTING=ON"
|
"-DKICAD_SCRIPTING=ON"
|
||||||
"-DKICAD_SCRIPTING_MODULES=ON"
|
"-DKICAD_SCRIPTING_MODULES=ON"
|
||||||
"-DKICAD_SCRIPTING_WXPYTHON=ON"
|
"-DKICAD_SCRIPTING_PYTHON3=ON"
|
||||||
# nix installs wxPython headers in wxPython package, not in wxwidget
|
"-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
|
||||||
# as assumed. We explicitely set the header location.
|
]
|
||||||
"-DCMAKE_CXX_FLAGS=-I${wxPython}/include/wx-3.0"
|
++ optional (!scriptingSupport)
|
||||||
];
|
"-DKICAD_SCRIPTING=OFF"
|
||||||
|
++ optional (ngspiceSupport) "-DKICAD_SPICE=ON"
|
||||||
|
++ 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"
|
||||||
|
]
|
||||||
|
;
|
||||||
|
|
||||||
|
pythonPath =
|
||||||
|
optionals (scriptingSupport)
|
||||||
|
[ wxPython pythonPackages.six ];
|
||||||
|
|
||||||
|
nativeBuildInputs =
|
||||||
|
[ cmake doxygen pkgconfig lndir ]
|
||||||
|
++ optionals (scriptingSupport)
|
||||||
|
[ pythonPackages.wrapPython makeWrapper ]
|
||||||
|
;
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake doxygen pkgconfig ];
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
libGLU libGL zlib libX11 wxGTK pcre libXdmcp gettext glew glm libpthreadstubs
|
libGLU libGL zlib libX11 wxGTK pcre libXdmcp gettext
|
||||||
cairo curl openssl boost
|
glew glm libpthreadstubs cairo curl openssl boost
|
||||||
] ++ optional (oceSupport) opencascade
|
]
|
||||||
|
++ optionals (scriptingSupport) [ swig python wxPython ]
|
||||||
++ optional (ngspiceSupport) libngspice
|
++ optional (ngspiceSupport) libngspice
|
||||||
++ optionals (scriptingSupport) [ swig python wxPython ];
|
++ optional (withOCE) opencascade
|
||||||
|
++ optional (withOCC) opencascade-occt
|
||||||
|
++ optional (debug) valgrind
|
||||||
|
;
|
||||||
|
|
||||||
|
doInstallCheck = (!debug);
|
||||||
|
installCheckTarget = "test";
|
||||||
|
|
||||||
|
dontStrip = debug;
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
mkdir -p $out/share
|
||||||
|
lndir ${kicad-libraries.i18n}/share $out/share
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeWrapperArgs = [
|
||||||
|
"--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share"
|
||||||
|
"--prefix XDG_DATA_DIRS : ${gnome3.defaultIconTheme}/share"
|
||||||
|
"--prefix XDG_DATA_DIRS : ${wxGTK.gtk}/share/gsettings-schemas/${wxGTK.gtk.name}"
|
||||||
|
"--prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
|
||||||
|
# wrapGAppsHook did these, as well, no idea if it matters...
|
||||||
|
"--prefix XDG_DATA_DIRS : ${cups}/share"
|
||||||
|
"--prefix GIO_EXTRA_MODULES : ${gnome3.dconf}/lib/gio/modules"
|
||||||
|
|
||||||
|
"--set KISYSMOD ${kicad-libraries.footprints}/share/kicad/modules"
|
||||||
|
"--set KICAD_SYMBOL_DIR ${kicad-libraries.symbols}/share/kicad/library"
|
||||||
|
"--set KICAD_TEMPLATE_DIR ${kicad-libraries.templates}/share/kicad/template"
|
||||||
|
"--prefix KICAD_TEMPLATE_DIR : ${kicad-libraries.symbols}/share/kicad/template"
|
||||||
|
"--prefix KICAD_TEMPLATE_DIR : ${kicad-libraries.footprints}/share/kicad/template"
|
||||||
|
]
|
||||||
|
++ optionals (ngspiceSupport) [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
|
||||||
|
++ optionals (with3d) [ "--set KISYS3DMOD ${kicad-libraries.packages3d}/share/kicad/modules/packages3d" ]
|
||||||
|
|
||||||
|
# infinisil's workaround for #39493
|
||||||
|
++ [ "--set GDK_PIXBUF_MODULE_FILE ${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" ]
|
||||||
|
;
|
||||||
|
|
||||||
|
# can't add $out stuff to makeWrapperArgs...
|
||||||
|
# wrapGAppsHook added the $out/share, though i noticed no difference without it
|
||||||
|
preFixup =
|
||||||
|
optionalString (scriptingSupport) '' buildPythonPath "$out $pythonPath"
|
||||||
|
'' +
|
||||||
|
'' wrapProgram $out/bin/kicad $makeWrapperArgs --prefix XDG_DATA_DIRS : $out/share ''
|
||||||
|
+ optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
|
||||||
|
'' +
|
||||||
|
'' wrapProgram $out/bin/pcbnew $makeWrapperArgs --prefix XDG_DATA_DIRS : $out/share ''
|
||||||
|
+ optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
|
||||||
|
'' +
|
||||||
|
'' wrapProgram $out/bin/eeschema $makeWrapperArgs --prefix XDG_DATA_DIRS : $out/share ''
|
||||||
|
+ optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
|
||||||
|
'' +
|
||||||
|
'' wrapProgram $out/bin/gerbview $makeWrapperArgs --prefix XDG_DATA_DIRS : $out/share ''
|
||||||
|
+ optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
|
||||||
|
'' +
|
||||||
|
'' wrapProgram $out/bin/pcb_calculator $makeWrapperArgs --prefix XDG_DATA_DIRS : $out/share ''
|
||||||
|
+ optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
|
||||||
|
'' +
|
||||||
|
'' wrapProgram $out/bin/pl_editor $makeWrapperArgs --prefix XDG_DATA_DIRS : $out/share ''
|
||||||
|
+ optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
|
||||||
|
'' +
|
||||||
|
'' wrapProgram $out/bin/bitmap2component $makeWrapperArgs ''
|
||||||
|
+ optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
|
||||||
|
''
|
||||||
|
;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Free Software EDA Suite, Nightly Development Build";
|
description = "Free Software EDA Suite, Nightly Development Build";
|
||||||
homepage = http://www.kicad-pcb.org/;
|
homepage = "https://www.kicad-pcb.org/";
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
maintainers = with maintainers; [ berce ];
|
maintainers = with maintainers; [ evils kiwi berce ];
|
||||||
platforms = with platforms; linux;
|
platforms = with platforms; linux;
|
||||||
broken = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -24206,9 +24206,13 @@ in
|
|||||||
};
|
};
|
||||||
kicad-with-packages3d = kicad.overrideAttrs (old: { modules = old.modules ++ [ old.passthru.packages3d ]; });
|
kicad-with-packages3d = kicad.overrideAttrs (old: { modules = old.modules ++ [ old.passthru.packages3d ]; });
|
||||||
|
|
||||||
kicad-unstable = python.pkgs.callPackage ../applications/science/electronics/kicad/unstable.nix {
|
kicad-unstable = callPackage ../applications/science/electronics/kicad/unstable.nix {
|
||||||
wxGTK = wxGTK30;
|
# wxGTK31 currently introduces an issue with opening the python interpreter in pcbnew
|
||||||
boost = boost160;
|
wxGTK = wxGTK31.override { withGtk2 = false; };
|
||||||
|
pythonPackages = python3Packages;
|
||||||
|
python = python3;
|
||||||
|
wxPython = python3Packages.wxPython_4_0;
|
||||||
|
debug = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
librepcb = libsForQt5.callPackage ../applications/science/electronics/librepcb { };
|
librepcb = libsForQt5.callPackage ../applications/science/electronics/librepcb { };
|
||||||
|
Loading…
Reference in New Issue
Block a user