# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sci-electronics/pcb/pcb-20081128-r1.ebuild,v 1.8 2011/03/06 09:27:50 jlec Exp $ EAPI="2" inherit fdo-mime DESCRIPTION="GPL Electronic Design Automation: Printed Circuit Board editor" HOMEPAGE="http://www.gpleda.org/" SRC_URI="http://geda.seul.org/dist/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64 ppc x86" IUSE="dbus doc gif gtk jpeg motif nelma nls png xrender threads tk" RDEPEND="gif? ( >=media-libs/gd-2.0.23 ) gtk? ( x11-libs/gtk+:2 x11-libs/pango dbus? ( sys-apps/dbus ) ) jpeg? ( >=media-libs/gd-2.0.23[jpeg] ) motif? ( !gtk? ( >=x11-libs/openmotif-2.3:0 dbus? ( sys-apps/dbus ) xrender? ( >=x11-libs/libXrender-0.9 ) ) ) nelma? ( >=media-libs/gd-2.0.23 ) nls? ( virtual/libintl ) png? ( >=media-libs/gd-2.0.23[png] ) tk? ( >=dev-lang/tk-8 )" DEPEND="${RDEPEND} >=dev-util/intltool-0.35 dev-util/pkgconfig nls? ( sys-devel/gettext )" pkg_setup() { if use gtk && use motif; then elog "Can only build for GTK+ or Motif/Lesstif GUI. GTK+ has priority." fi if !(use gtk || use motif); then elog "Building without GUI, make sure you know what you are doing." fi if use dbus && !(use gtk || use motif); then elog "dbus needs GTK or Motif/Lesstif GUI. Try USE=-dbus or USE=gtk or USE=motif." fi if (use gtk || (! use gtk && ! use motif)) && (use xrender); then elog "The XRender extension is only usable with the Motif/Lesstif GUI." fi } src_prepare() { # src/hid/batch/hid.conf is missing in the 20081128 snapshot cp src/hid/gtk/hid.conf src/hid/batch/ sed -i -e 's/example//' -e 's/tutorial//' -e 's/ win32//' Makefile.in || die "sed failed" sed -i -e 's/DOC=doc/DOC="doc example tutorial"/' configure || die "sed failed" sed -i -e 's/$(pkgdatadir)/$(docdir)/' {example,tutorial}/Makefile.in || die "sed failed" } src_configure() { local myconf if use gtk ; then myconf="--with-gui=gtk $(use_enable dbus) --disable-xrender" elif use motif ; then myconf="--with-gui=lesstif $(use_enable dbus) $(use_enable xrender)" else myconf="--with-gui=batch --disable-xrender --disable-dbus" fi local exporters="bom gerber ps" if (use png || use jpeg || use gif) ; then exporters="${exporters} png" fi use nelma && exporters="${exporters} nelma" use tk || export WISH="/bin/true" econf \ ${myconf} \ $(use_enable doc) \ $(use_enable gif) \ $(use_enable jpeg) \ $(use_enable nls) \ $(use_enable png) \ $(use_enable threads threads posix) \ --with-exporters="${exporters}" \ --disable-dependency-tracking \ --disable-rpath \ --disable-update-mime-database \ --disable-update-desktop-database \ --docdir="/usr/share/doc/${PF}" } src_install() { emake DESTDIR="${D}" install || die "install failed" dodoc AUTHORS README NEWS ChangeLog } pkg_postinst() { fdo-mime_mime_database_update fdo-mime_desktop_database_update } pkg_postrm() { fdo-mime_mime_database_update fdo-mime_desktop_database_update }