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

73 lines
2 KiB
Nix
Raw Normal View History

2017-05-03 01:59:27 +02:00
{ stdenv, fetchurl, fetchbzr, cmake, mesa, wxGTK, zlib, libX11, gettext, glew, cairo, curl, openssl, boost, pkgconfig, doxygen }:
stdenv.mkDerivation rec {
name = "kicad-${version}";
2016-03-31 04:26:54 +02:00
series = "4.0";
2017-09-09 13:05:07 +02:00
version = "4.0.7";
2016-03-31 04:26:54 +02:00
srcs = [
(fetchurl {
url = "https://code.launchpad.net/kicad/${series}/${version}/+download/kicad-${version}.tar.xz";
2017-09-09 13:05:07 +02:00
sha256 = "1hgxan9321szgyqnkflb0q60yjf4yvbcc4cpwhm0yz89qrvlq1q9";
2016-03-31 04:26:54 +02:00
})
2016-03-31 04:26:54 +02:00
(fetchurl {
url = "http://downloads.kicad-pcb.org/libraries/kicad-library-${version}.tar.gz";
2017-09-09 13:05:07 +02:00
sha256 = "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv";
2016-03-31 04:26:54 +02:00
})
(fetchurl {
url = "http://downloads.kicad-pcb.org/libraries/kicad-footprints-${version}.tar.gz";
2017-09-09 13:05:07 +02:00
sha256 = "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j";
2016-03-31 04:26:54 +02:00
})
];
2016-03-31 04:26:54 +02:00
sourceRoot = "kicad-${version}";
cmakeFlags = ''
-DKICAD_SKIP_BOOST=ON
-DKICAD_BUILD_VERSION=${version}
-DKICAD_REPO_NAME=stable
'';
2016-03-31 04:26:54 +02:00
enableParallelBuilding = true; # often fails on Hydra: fatal error: pcb_plot_params_lexer.h: No such file or directory
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cmake mesa wxGTK zlib libX11 gettext glew cairo curl openssl boost doxygen ];
# They say they only support installs to /usr or /usr/local,
# so we have to handle this.
patchPhase = ''
sed -i -e 's,/usr/local/kicad,'$out,g common/gestfich.cpp
'';
2016-03-31 04:26:54 +02:00
postUnpack = ''
pushd $(pwd)
'';
postInstall = ''
2016-03-31 04:26:54 +02:00
popd
pushd kicad-library-*
cmake -DCMAKE_INSTALL_PREFIX=$out
make $MAKE_FLAGS
make install
2016-03-31 04:26:54 +02:00
popd
2016-03-31 04:26:54 +02:00
pushd kicad-footprints-*
mkdir -p $out/share/kicad/modules
cp -R *.pretty $out/share/kicad/modules/
popd
'';
2016-03-31 04:26:54 +02:00
meta = {
description = "Free Software EDA Suite";
homepage = http://www.kicad-pcb.org/;
license = stdenv.lib.licenses.gpl2;
maintainers = with stdenv.lib.maintainers; [viric];
platforms = with stdenv.lib.platforms; linux;
2017-09-29 01:41:09 +02:00
hydraPlatforms = []; # 'output limit exceeded' error on hydra
};
}