# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sci-electronics/kicad/kicad-20070702.ebuild,v 1.5 2008/02/09 12:09:49 calchan Exp $ inherit eutils wxwidgets multilib DESCRIPTION="Electronic Schematic and PCB design tools (EDA)." HOMEPAGE="http://kicad.sourceforge.net" SRC_URI="mirror://gentoo/${PF}.tar.bz2 http://downloads.sourceforge.net/kicad/${PF}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" IUSE="doc kicad-library debug static" DEPEND=">=x11-libs/wxGTK-2.8 >=dev-util/cmake-2.4.6 dev-libs/boost kicad-library? ( >=sci-electronics/kicad-library-1.0 ) doc? ( >=sci-electronics/kicad-doc-1.0 )" pkg_setup() { # Tell wxwidgets.eclass which version we need WX_GTK_VER="2.8" # Ask for the correct wxGTK configuration if use static; then built_with_use "x11-libs/wxGTK" static || die "You need to install statically linked wxGTK. Configure it with --enable-monolithic --disable-shared." else built_without_use "x11-libs/wxGTK" static || die "You need to install dinamically linked wxGTK. Configure it with --disable-monolithic --enable-shared." fi built_with_use "x11-libs/wxGTK" opengl || die "You need to install wxGTK with opengl support." } src_compile() { local myconf # General options. myconf="-DCMAKE_INSTALL_PREFIX=/usr \ -DLIB_INSTALL_DIR=/usr/$(get_libdir)" if use debug; then myconf="${myconf} -DCMAKE_BUILD_TYPE=Debug" else myconf="${myconf} -DCMAKE_BUILD_TYPE=Release" fi if use static; then myconf="${myconf} -DwxWidgets_USE_STATIC=ON" else myconf="${myconf} -DwxWidgets_USE_STATIC=OFF" fi cd "${WORKDIR}/${PN}" cmake ${myconf} || die emake || die } src_install() { cd "${WORKDIR}/${PN}" emake DESTDIR="${D}" install || die #newicon bitmaps/icon_kicad.png ${PN}.png #make_desktop_entry ${PN} ${PN} ${PN} } pkg_postinst() { if !(use kicad-library) ; then elog "If the schematic and/or board editors complain about missing libraries when" elog "you open old projects, you will have to enable 'kicad-library' USE flag." fi if !(use doc) ; then elog "If the KiCad programs complain about missing Help, you will have" elog "to enable 'doc' USE flag." fi elog "" elog "You may want to emerge media-gfx/wings if you want to create 3D models of components." }