nixpkgs-suyu/pkgs/applications/science/electronics/kicad/default.nix

73 lines
2.1 KiB
Nix
Raw Normal View History

2018-07-26 14:47:07 +02: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 15:37:59 +02:00
, wrapGAppsHook
2018-07-26 14:47:07 +02:00
, oceSupport ? true, opencascade
, ngspiceSupport ? true, libngspice
, swig, python, pythonPackages
2018-07-26 14:47:07 +02:00
}:
2018-07-26 14:47:07 +02:00
assert ngspiceSupport -> libngspice != null;
2016-03-31 04:26:54 +02:00
2018-07-26 14:47:07 +02:00
with lib;
stdenv.mkDerivation rec {
name = "kicad-${version}";
series = "5.0";
version = "5.0.2";
2016-03-31 04:26:54 +02:00
2018-07-26 14:47:07 +02:00
src = fetchurl {
url = "https://launchpad.net/kicad/${series}/${version}/+download/kicad-${version}.tar.xz";
sha256 = "10605rr10x0353n6yk2z095ydnkd1i6j1ncbq64pfxdn5vkhcd1g";
2018-07-26 14:47:07 +02:00
};
2018-07-26 14:47:07 +02:00
postPatch = ''
substituteInPlace CMakeModules/KiCadVersion.cmake \
--replace no-vcs-found ${version}
'';
cmakeFlags = [
"-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.
"-DCMAKE_CXX_FLAGS=-I${pythonPackages.wxPython}/include/wx-3.0"
] ++ optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade}" ]
++ optional (ngspiceSupport) "-DKICAD_SPICE=ON";
2018-07-26 14:47:07 +02:00
2018-07-31 15:37:59 +02:00
nativeBuildInputs = [
2018-08-13 01:47:02 +02:00
cmake
2018-07-31 15:37:59 +02:00
doxygen
pkgconfig
wrapGAppsHook
pythonPackages.wrapPython
];
pythonPath = [ pythonPackages.wxPython ];
propagatedBuildInputs = [ pythonPackages.wxPython ];
2018-07-26 14:47:07 +02:00
buildInputs = [
libGLU_combined zlib libX11 wxGTK pcre libXdmcp gettext glew glm libpthreadstubs
cairo curl openssl boost
swig python
2018-07-26 14:47:07 +02:00
] ++ optional (oceSupport) opencascade
++ optional (ngspiceSupport) libngspice;
2018-07-31 15:37:59 +02:00
# 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 04:26:54 +02:00
meta = {
description = "Free Software EDA Suite";
homepage = http://www.kicad-pcb.org/;
2018-07-26 14:47:07 +02:00
license = licenses.gpl2;
maintainers = with maintainers; [ berce ];
platforms = with platforms; linux;
};
}