2018-07-26 13:47:07 +01:00
|
|
|
{ wxGTK, lib, stdenv, fetchurl, cmake, libGLU_combined, zlib
|
|
|
|
, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig
|
|
|
|
, doxygen, pcre, libpthreadstubs, libXdmcp
|
2018-07-31 14:37:59 +01:00
|
|
|
, wrapGAppsHook
|
2018-07-26 13:47:07 +01:00
|
|
|
, oceSupport ? true, opencascade
|
|
|
|
, ngspiceSupport ? true, libngspice
|
2018-07-31 14:37:59 +01:00
|
|
|
, scriptingSupport ? true, swig, python, pythonPackages
|
2018-07-26 13:47:07 +01:00
|
|
|
}:
|
2010-08-31 09:19:28 +01:00
|
|
|
|
2018-07-26 13:47:07 +01:00
|
|
|
assert ngspiceSupport -> libngspice != null;
|
2016-03-31 03:26:54 +01:00
|
|
|
|
2018-07-26 13:47:07 +01:00
|
|
|
with lib;
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "kicad-${version}";
|
|
|
|
series = "5.0";
|
|
|
|
version = "5.0.0";
|
2016-03-31 03:26:54 +01:00
|
|
|
|
2018-07-26 13:47:07 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://launchpad.net/kicad/${series}/${version}/+download/kicad-${version}.tar.xz";
|
|
|
|
sha256 = "17nqjszyvd25wi6550j981whlnb1wxzmlanljdjihiki53j84x9p";
|
|
|
|
};
|
2016-08-25 22:11:27 +01:00
|
|
|
|
2018-07-26 13:47:07 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeModules/KiCadVersion.cmake \
|
|
|
|
--replace no-vcs-found ${version}
|
2010-08-31 09:19:28 +01:00
|
|
|
'';
|
2010-08-22 13:09:47 +01:00
|
|
|
|
2018-07-26 13:47:07 +01:00
|
|
|
cmakeFlags =
|
|
|
|
optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade}" ]
|
|
|
|
++ optional (ngspiceSupport) "-DKICAD_SPICE=ON"
|
|
|
|
++ optionals (scriptingSupport) [
|
|
|
|
"-DKICAD_SCRIPTING=ON"
|
|
|
|
"-DKICAD_SCRIPTING_MODULES=ON"
|
|
|
|
"-DKICAD_SCRIPTING_WXPYTHON=ON"
|
|
|
|
# nix installs wxPython headers in wxPython package, not in wxwidget
|
|
|
|
# as assumed. We explicitely set the header location.
|
2018-07-31 14:37:59 +01:00
|
|
|
"-DCMAKE_CXX_FLAGS=-I${pythonPackages.wxPython}/include/wx-3.0"
|
2018-07-26 13:47:07 +01:00
|
|
|
];
|
|
|
|
|
2018-07-31 14:37:59 +01:00
|
|
|
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 ];
|
|
|
|
|
2018-07-26 13:47:07 +01:00
|
|
|
buildInputs = [
|
|
|
|
libGLU_combined zlib libX11 wxGTK pcre libXdmcp gettext glew glm libpthreadstubs
|
|
|
|
cairo curl openssl boost
|
|
|
|
] ++ optional (oceSupport) opencascade
|
|
|
|
++ optional (ngspiceSupport) libngspice
|
2018-07-31 14:37:59 +01:00
|
|
|
++ 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[@]}"
|
|
|
|
'';
|
2016-03-31 03:26:54 +01:00
|
|
|
|
2010-08-22 13:09:47 +01:00
|
|
|
meta = {
|
|
|
|
description = "Free Software EDA Suite";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.kicad-pcb.org/;
|
2018-07-26 13:47:07 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ berce ];
|
|
|
|
platforms = with platforms; linux;
|
2010-08-22 13:09:47 +01:00
|
|
|
};
|
|
|
|
}
|