From 5ca3511f5672e527d20c5fb712581eb6739cead0 Mon Sep 17 00:00:00 2001 From: Bert Moens Date: Wed, 13 Dec 2017 21:01:06 +0100 Subject: [PATCH 1/5] wxPython: enable headers --- pkgs/development/python-modules/wxPython/3.0.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/wxPython/3.0.nix b/pkgs/development/python-modules/wxPython/3.0.nix index ab7b44019c54..abce4cf44e0c 100644 --- a/pkgs/development/python-modules/wxPython/3.0.nix +++ b/pkgs/development/python-modules/wxPython/3.0.nix @@ -43,6 +43,9 @@ buildPythonPackage rec { # remove wxPython's darwin hack that interference with python-2.7-distutils-C++.patch substituteInPlace config.py \ --replace "distutils.unixccompiler.UnixCCompiler = MyUnixCCompiler" "" + # set the WXPREFIX to $out instead of the storepath of wxwidgets + substituteInPlace config.py \ + --replace "WXPREFIX = getWxConfigValue('--prefix')" "WXPREFIX = '$out'" # this check is supposed to only return false on older systems running non-framework python substituteInPlace src/osx_cocoa/_core_wrap.cpp \ --replace "return wxPyTestDisplayAvailable();" "return true;" @@ -62,7 +65,7 @@ buildPythonPackage rec { buildPhase = ""; installPhase = '' - ${python.interpreter} setup.py install WXPORT=${if stdenv.isDarwin then "osx_cocoa" else "gtk2"} NO_HEADERS=1 BUILD_GLCANVAS=${if openglSupport then "1" else "0"} UNICODE=1 --prefix=$out + ${python.interpreter} setup.py install WXPORT=${if stdenv.isDarwin then "osx_cocoa" else "gtk2"} NO_HEADERS=0 BUILD_GLCANVAS=${if openglSupport then "1" else "0"} UNICODE=1 --prefix=$out wrapPythonPrograms ''; From af5272f599f7edf9dc541898321e0bf2eee926a2 Mon Sep 17 00:00:00 2001 From: Bert Moens Date: Mon, 11 Dec 2017 14:37:01 +0100 Subject: [PATCH 2/5] kicad: add unstable version --- .../science/electronics/kicad/unstable.nix | 28 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/applications/science/electronics/kicad/unstable.nix diff --git a/pkgs/applications/science/electronics/kicad/unstable.nix b/pkgs/applications/science/electronics/kicad/unstable.nix new file mode 100644 index 000000000000..9dd2b67b834f --- /dev/null +++ b/pkgs/applications/science/electronics/kicad/unstable.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchFromGitHub, cmake, mesa, wxGTK, zlib, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig, doxygen }: + +stdenv.mkDerivation rec { + name = "kicad-unstable-${version}"; + version = "2017-12-11"; + + src = fetchFromGitHub { + owner = "KICad"; + repo = "kicad-source-mirror"; + rev = "1955f252265c38a313f6c595d6c4c637f38fd316"; + sha256 = "15cc81h7nh5dk6gj6mc4ylcgdznfriilhb43n1g3xwyq3s8iaibz"; + }; + + cmakeFlags = '' + -DKICAD_SKIP_BOOST=ON + ''; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ cmake mesa wxGTK zlib libX11 gettext glew glm cairo curl openssl boost doxygen ]; + + meta = { + description = "Free Software EDA Suite, Nightly Development Build"; + homepage = http://www.kicad-pcb.org/; + license = stdenv.lib.licenses.gpl2; + maintainers = with stdenv.lib.maintainers; [ berce ]; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 57c15125d2a3..abb213b8c041 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19017,6 +19017,11 @@ with pkgs; boost = boost160; }; + kicad-unstable = callPackage ../applications/science/electronics/kicad/unstable.nix { + wxGTK = wxGTK30; + boost = boost160; + }; + ngspice = callPackage ../applications/science/electronics/ngspice { }; pcb = callPackage ../applications/science/electronics/pcb { }; From 5e0344dce9ca61e87209193967e453dc04264b00 Mon Sep 17 00:00:00 2001 From: Bert Moens Date: Mon, 11 Dec 2017 20:38:08 +0100 Subject: [PATCH 3/5] kicad: add support for oce, ngspice and scripting --- .../science/electronics/kicad/unstable.nix | 49 +++++++++++++------ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/science/electronics/kicad/unstable.nix b/pkgs/applications/science/electronics/kicad/unstable.nix index 9dd2b67b834f..ba5e5f79702b 100644 --- a/pkgs/applications/science/electronics/kicad/unstable.nix +++ b/pkgs/applications/science/electronics/kicad/unstable.nix @@ -1,28 +1,49 @@ -{ stdenv, fetchFromGitHub, cmake, mesa, wxGTK, zlib, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig, doxygen }: +{ wxGTK, lib, stdenv, fetchFromGitHub, cmake, mesa, zlib +, libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig +, doxygen, pcre, libpthreadstubs, libXdmcp +, oceSupport ? true, opencascade_oce +, ngspiceSupport ? true, ngspice +, scriptingSupport ? true, swig, python, wxPython +}: + +with lib; stdenv.mkDerivation rec { name = "kicad-unstable-${version}"; version = "2017-12-11"; src = fetchFromGitHub { - owner = "KICad"; - repo = "kicad-source-mirror"; - rev = "1955f252265c38a313f6c595d6c4c637f38fd316"; - sha256 = "15cc81h7nh5dk6gj6mc4ylcgdznfriilhb43n1g3xwyq3s8iaibz"; - }; + owner = "KICad"; + repo = "kicad-source-mirror"; + rev = "1955f252265c38a313f6c595d6c4c637f38fd316"; + sha256 = "15cc81h7nh5dk6gj6mc4ylcgdznfriilhb43n1g3xwyq3s8iaibz"; + }; - cmakeFlags = '' - -DKICAD_SKIP_BOOST=ON - ''; + cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Nightly" ] + ++ optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade_oce}" ] + ++ 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. + "-DCMAKE_CXX_FLAGS=-I${wxPython}/include/wx-3.0" + ]; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ cmake mesa wxGTK zlib libX11 gettext glew glm cairo curl openssl boost doxygen ]; + nativeBuildInputs = [ cmake doxygen pkgconfig ]; + buildInputs = [ + mesa zlib libX11 wxGTK pcre libXdmcp gettext glew glm libpthreadstubs + cairo curl openssl boost + ] ++ optional (oceSupport) opencascade_oce + ++ optional (ngspiceSupport) ngspice + ++ optionals (scriptingSupport) [ swig python wxPython ]; meta = { description = "Free Software EDA Suite, Nightly Development Build"; homepage = http://www.kicad-pcb.org/; - license = stdenv.lib.licenses.gpl2; - maintainers = with stdenv.lib.maintainers; [ berce ]; - platforms = with stdenv.lib.platforms; linux; + license = licenses.gpl2; + maintainers = with maintainers; [ berce ]; + platforms = with platforms; linux; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index abb213b8c041..a4ce52bc6603 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19017,7 +19017,7 @@ with pkgs; boost = boost160; }; - kicad-unstable = callPackage ../applications/science/electronics/kicad/unstable.nix { + kicad-unstable = python.pkgs.callPackage ../applications/science/electronics/kicad/unstable.nix { wxGTK = wxGTK30; boost = boost160; }; From f3141570417b7352317dbf80e8c027b49e6ef454 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 17 Dec 2017 04:48:15 +0000 Subject: [PATCH 4/5] kicad-unstable: set version --- pkgs/applications/science/electronics/kicad/unstable.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/electronics/kicad/unstable.nix b/pkgs/applications/science/electronics/kicad/unstable.nix index ba5e5f79702b..c04b0f3a6227 100644 --- a/pkgs/applications/science/electronics/kicad/unstable.nix +++ b/pkgs/applications/science/electronics/kicad/unstable.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { sha256 = "15cc81h7nh5dk6gj6mc4ylcgdznfriilhb43n1g3xwyq3s8iaibz"; }; - cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Nightly" ] + cmakeFlags = [ "-DKICAD_VERSION=${version}" ] ++ optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade_oce}" ] ++ optional (ngspiceSupport) "-DKICAD_SPICE=ON" ++ optionals (scriptingSupport) [ From c780dba59c8db4fb0524ef74e216e0041ba82e14 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 17 Dec 2017 05:02:51 +0000 Subject: [PATCH 5/5] kicad: show version --- pkgs/applications/science/electronics/kicad/unstable.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/electronics/kicad/unstable.nix b/pkgs/applications/science/electronics/kicad/unstable.nix index c04b0f3a6227..f954bf5b70ca 100644 --- a/pkgs/applications/science/electronics/kicad/unstable.nix +++ b/pkgs/applications/science/electronics/kicad/unstable.nix @@ -19,8 +19,13 @@ stdenv.mkDerivation rec { sha256 = "15cc81h7nh5dk6gj6mc4ylcgdznfriilhb43n1g3xwyq3s8iaibz"; }; - cmakeFlags = [ "-DKICAD_VERSION=${version}" ] - ++ optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade_oce}" ] + postPatch = '' + substituteInPlace CMakeModules/KiCadVersion.cmake \ + --replace no-vcs-found ${version} + ''; + + cmakeFlags = + optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade_oce}" ] ++ optional (ngspiceSupport) "-DKICAD_SPICE=ON" ++ optionals (scriptingSupport) [ "-DKICAD_SCRIPTING=ON"