# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils wxwidgets DESCRIPTION="Electronic schematic diagrams and printed circuit board creation." HOMEPAGE="http://www.lis.inpg.fr/realise_au_lis/kicad/" SRC_URI="ftp://iut-tice.ujf-grenoble.fr/cao/sources/kicad-sources-2006-03-21.zip ftp://iut-tice.ujf-grenoble.fr/cao/kicad-2006-03-21-RC2.tgz ftp://iut-tice.ujf-grenoble.fr/cao/doc_components-2006-03-07.zip" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="unicode" DEPEND=">=x11-libs/wxGTK-2.6 media-gfx/wings" S=${WORKDIR}/kicad-dev pkg_setup() { # Tell wxwidgets.eclass the version we need. We pick the latest on the system. WX_GTK_VER=$(`ls /usr/bin/wx-config* | sort | tail -n 1` --release) # Check for proper wxGTK USE flags. if usev unicode; then need-wxwidgets unicode || die "You need to install wxGTK with unicode support." else need-wxwidgets gtk2 || die "You need to install wxGTK with gtk2 support." fi built_with_use ">=x11-libs/wxGTK-${WX_GTK_VER}" opengl || die "You need to install wxGTK with opengl support." } src_unpack() { unpack ${A} || die "Unpack failed" epatch ${FILESDIR}/kicad-20060321.patch # Note for future versions. # This is how the above patch was generated (in this order) : # sed -i -e "s/make -k -f/make -f/" ${S}/makefile.gtk # sed -i -e "s/gl,png,jpeg,zlib/core,base,net,html,gl/" ${S}/libs.linux # sed -i -e "s/png,jpeg,zlib/core,base,net,html,xrc/" ${S}/libs.linux # sed -i -e "s/-Wall -O2/-Wall/" ${S}/*/makefile.* # sed -i -e "s/LD = gcc/LD = c++/" ${S}/*/makefile.* # sed -i -e "s/gcc/gcc \$(CFLAGS)/" ${S}/*/makefile.* # sed -i -e "s/gcc/gcc \$(CFLAGS)/" ${S}/*/*/makefile.* sed -i -e "s:wx-config:${WX_CONFIG}:" ${S}/libs.* sed -i -e "s:wx-config:${WX_CONFIG}:" ${S}/*/makefile.* } src_compile() { emake -f makefile.gtk || die "make failed" } src_install() { # kicad doesn't use the autotools yet exeinto /usr/lib/${P}/linux doexe eeschema/eeschema doexe pcbnew/pcbnew doexe cvpcb/cvpcb doexe kicad/kicad doexe gerbview/gerbview exeinto /usr/lib/${P}/linux/plugins doexe eeschema/plugins/netlist_form_pads-pcb insinto /usr/share/pixmaps newins ${WORKDIR}/kicad/linux/kicad_icon.png kicad.png # kicad requires everything to be in the same place make_wrapper kicad "/usr/lib/${P}/linux/kicad" cp -a ${WORKDIR}/kicad/library ${D}/usr/lib/${P}/ cp -a ${WORKDIR}/kicad/modules ${D}/usr/lib/${P}/ cp -a ${WORKDIR}/kicad/demos ${D}/usr/lib/${P}/ cp -a ${WORKDIR}/kicad/internat ${D}/usr/lib/${P}/ cp -a ${WORKDIR}/kicad/help ${D}/usr/lib/${P}/ cp -a ${WORKDIR}/kicad/template ${D}/usr/lib/${P}/ cp -a ${WORKDIR}/doc ${D}/usr/lib/${P}/library cd ${WORKDIR}/kicad dodoc author.txt copyright.txt news.txt contrib.txt version.txt make_desktop_entry kicad Kicad kicad.png Electronics }