Merge pull request #44122 from bgamari/kicad-0.5

kicad: 4.0.7 -> 5.0.0

authored by Jörg Thalheim and committed by GitHub 9cff8652 e858b285

+54 -53
+54 -53
pkgs/applications/science/electronics/kicad/default.nix
··· 1 - { stdenv, fetchurl, cmake, libGLU_combined, wxGTK, zlib, libX11, gettext, glew, cairo, curl, openssl, boost, pkgconfig, doxygen }: 2 3 stdenv.mkDerivation rec { 4 name = "kicad-${version}"; 5 - series = "4.0"; 6 - version = "4.0.7"; 7 - 8 - srcs = [ 9 - (fetchurl { 10 - url = "https://code.launchpad.net/kicad/${series}/${version}/+download/kicad-${version}.tar.xz"; 11 - sha256 = "1hgxan9321szgyqnkflb0q60yjf4yvbcc4cpwhm0yz89qrvlq1q9"; 12 - }) 13 - 14 - (fetchurl { 15 - url = "http://downloads.kicad-pcb.org/libraries/kicad-library-${version}.tar.gz"; 16 - sha256 = "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"; 17 - }) 18 - 19 - (fetchurl { 20 - url = "http://downloads.kicad-pcb.org/libraries/kicad-footprints-${version}.tar.gz"; 21 - sha256 = "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"; 22 - }) 23 - ]; 24 25 - sourceRoot = "kicad-${version}"; 26 27 - cmakeFlags = '' 28 - -DKICAD_SKIP_BOOST=ON 29 - -DKICAD_BUILD_VERSION=${version} 30 - -DKICAD_REPO_NAME=stable 31 ''; 32 33 - enableParallelBuilding = true; # often fails on Hydra: fatal error: pcb_plot_params_lexer.h: No such file or directory 34 35 - nativeBuildInputs = [ pkgconfig ]; 36 - buildInputs = [ cmake libGLU_combined wxGTK zlib libX11 gettext glew cairo curl openssl boost doxygen ]; 37 38 - # They say they only support installs to /usr or /usr/local, 39 - # so we have to handle this. 40 - patchPhase = '' 41 - sed -i -e 's,/usr/local/kicad,'$out,g common/gestfich.cpp 42 - ''; 43 44 - postUnpack = '' 45 - pushd $(pwd) 46 - ''; 47 48 - postInstall = '' 49 - popd 50 - 51 - pushd kicad-library-* 52 - cmake -DCMAKE_INSTALL_PREFIX=$out 53 - make $MAKE_FLAGS 54 - make install 55 - popd 56 57 - pushd kicad-footprints-* 58 - mkdir -p $out/share/kicad/modules 59 - cp -R *.pretty $out/share/kicad/modules/ 60 - popd 61 ''; 62 - 63 64 meta = { 65 description = "Free Software EDA Suite"; 66 homepage = http://www.kicad-pcb.org/; 67 - license = stdenv.lib.licenses.gpl2; 68 - maintainers = with stdenv.lib.maintainers; [viric]; 69 - platforms = with stdenv.lib.platforms; linux; 70 - hydraPlatforms = []; # 'output limit exceeded' error on hydra 71 }; 72 }
··· 1 + { wxGTK, lib, stdenv, fetchurl, cmake, libGLU_combined, zlib 2 + , libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig 3 + , doxygen, pcre, libpthreadstubs, libXdmcp 4 + , wrapGAppsHook 5 + , oceSupport ? true, opencascade 6 + , ngspiceSupport ? true, libngspice 7 + , swig, python, pythonPackages 8 + }: 9 + 10 + assert ngspiceSupport -> libngspice != null; 11 12 + with lib; 13 stdenv.mkDerivation rec { 14 name = "kicad-${version}"; 15 + series = "5.0"; 16 + version = "5.0.0"; 17 18 + src = fetchurl { 19 + url = "https://launchpad.net/kicad/${series}/${version}/+download/kicad-${version}.tar.xz"; 20 + sha256 = "17nqjszyvd25wi6550j981whlnb1wxzmlanljdjihiki53j84x9p"; 21 + }; 22 23 + postPatch = '' 24 + substituteInPlace CMakeModules/KiCadVersion.cmake \ 25 + --replace no-vcs-found ${version} 26 ''; 27 28 + cmakeFlags = [ 29 + "-DKICAD_SCRIPTING=ON" 30 + "-DKICAD_SCRIPTING_MODULES=ON" 31 + "-DKICAD_SCRIPTING_WXPYTHON=ON" 32 + # nix installs wxPython headers in wxPython package, not in wxwidget 33 + # as assumed. We explicitely set the header location. 34 + "-DCMAKE_CXX_FLAGS=-I${pythonPackages.wxPython}/include/wx-3.0" 35 + ] ++ optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade}" ] 36 + ++ optional (ngspiceSupport) "-DKICAD_SPICE=ON"; 37 38 + nativeBuildInputs = [ 39 + # https://www.mail-archive.com/kicad-developers@lists.launchpad.net/msg29840.html 40 + (cmake.override {majorVersion = "3.10";}) 41 + doxygen 42 + pkgconfig 43 + wrapGAppsHook 44 + pythonPackages.wrapPython 45 + ]; 46 + pythonPath = [ pythonPackages.wxPython ]; 47 + propagatedBuildInputs = [ pythonPackages.wxPython ]; 48 49 + buildInputs = [ 50 + libGLU_combined zlib libX11 wxGTK pcre libXdmcp gettext glew glm libpthreadstubs 51 + cairo curl openssl boost 52 + swig python 53 + ] ++ optional (oceSupport) opencascade 54 + ++ optional (ngspiceSupport) libngspice; 55 56 + # this breaks other applications in kicad 57 + dontWrapGApps = true; 58 59 + preFixup = '' 60 + buildPythonPath "$out $pythonPath" 61 + gappsWrapperArgs+=(--set PYTHONPATH "$program_PYTHONPATH") 62 63 + wrapProgram "$out/bin/kicad" "''${gappsWrapperArgs[@]}" 64 ''; 65 66 meta = { 67 description = "Free Software EDA Suite"; 68 homepage = http://www.kicad-pcb.org/; 69 + license = licenses.gpl2; 70 + maintainers = with maintainers; [ berce ]; 71 + platforms = with platforms; linux; 72 }; 73 }