@@ -1,28 +1,49 @@
1−{ stdenv, fetchFromGitHub, cmake, mesa, wxGTK, zlib, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig, doxygen }:
1+{ wxGTK, lib, stdenv, fetchFromGitHub, cmake, mesa, zlib
2+, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig
3+, doxygen, pcre, libpthreadstubs, libXdmcp
24
5+, oceSupport ? true, opencascade_oce
6+, ngspiceSupport ? true, ngspice
7+, scriptingSupport ? true, swig, python, wxPython
8+}:
9+
10+with lib;
311stdenv.mkDerivation rec {
412 name = "kicad-unstable-${version}";
513 version = "2017-12-11";
614
715 src = fetchFromGitHub {
8− owner = "KICad";
9− repo = "kicad-source-mirror";
10− rev = "1955f252265c38a313f6c595d6c4c637f38fd316";
11− sha256 = "15cc81h7nh5dk6gj6mc4ylcgdznfriilhb43n1g3xwyq3s8iaibz";
12− };
16+ owner = "KICad";
17+ repo = "kicad-source-mirror";
18+ rev = "1955f252265c38a313f6c595d6c4c637f38fd316";
19+ sha256 = "15cc81h7nh5dk6gj6mc4ylcgdznfriilhb43n1g3xwyq3s8iaibz";
20+ };
1321
14− cmakeFlags = ''
15− -DKICAD_SKIP_BOOST=ON
16− '';
22+ cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Nightly" ]
23+ ++ optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade_oce}" ]
24+ ++ optional (ngspiceSupport) "-DKICAD_SPICE=ON"
25+ ++ optionals (scriptingSupport) [
26+ "-DKICAD_SCRIPTING=ON"
27+ "-DKICAD_SCRIPTING_MODULES=ON"
28+ "-DKICAD_SCRIPTING_WXPYTHON=ON"
29+ # nix installs wxPython headers in wxPython package, not in wxwidget
30+ # as assumed. We explicitely set the header location.
31+ "-DCMAKE_CXX_FLAGS=-I${wxPython}/include/wx-3.0"
32+ ];
1733
18− nativeBuildInputs = [ pkgconfig ];
19− buildInputs = [ cmake mesa wxGTK zlib libX11 gettext glew glm cairo curl openssl boost doxygen ];
34+ nativeBuildInputs = [ cmake doxygen pkgconfig ];
35+ buildInputs = [
36+ mesa zlib libX11 wxGTK pcre libXdmcp gettext glew glm libpthreadstubs
37+ cairo curl openssl boost
38+ ] ++ optional (oceSupport) opencascade_oce
39+ ++ optional (ngspiceSupport) ngspice
40+ ++ optionals (scriptingSupport) [ swig python wxPython ];
2041
2142 meta = {
2243 description = "Free Software EDA Suite, Nightly Development Build";
2344 homepage = http://www.kicad-pcb.org/;
24− license = stdenv.lib.licenses.gpl2;
25− maintainers = with stdenv.lib.maintainers; [ berce ];
26− platforms = with stdenv.lib.platforms; linux;
45+ license = licenses.gpl2;
46+ maintainers = with maintainers; [ berce ];
47+ platforms = with platforms; linux;
2748 };
2849}