# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0

name                xgsch2pcb
version             0.1.3
revision            4
categories          cad science electronics
license             GPL-2+
maintainers         nomaintainer
description         intuitive and user-friendly graphical interface to gsch2pcb
long_description    xgsch2pcb provides an intuitive, user-friendly graphical interface to \
                    the gsch2pcb command-line tool which is used to generate and update a \
                    PCB layout. It works with schematics created by gschem, and layouts \
                    created by pcb. xgsch2pcb also features a "template" functionality for \
                    creating new projects.

homepage            http://wiki.geda-project.org/geda:download
platforms           {darwin any}
supported_archs     noarch
# upstream download site no longer available
# use macports distfile mirrors instead
master_sites        macports_distfiles:xgsch2pcb
checksums           md5     caf84bc0f17b75a2984fea2a64fc2c81 \
                    sha1    5bddd5973c2ecf8c43e03ee3f9484de44f649572
distname            geda-${name}-${version}
depends_build       port:intltool
depends_lib         port:desktop-file-utils \
                    path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \
                    port:pcb \
                    port:py27-pygtk \
                    port:dbus-python27
depends_run         port:geda-gaf

patchfiles          patch-configure.ac.diff \
                    patch-Makefile.am.diff

# no upstream autogen.sh available
# reconfigure using intltoolize and autoreconf for intltool 0.51 compatibility

pre-configure {
    system -W ${worksrcpath} "intltoolize --automake --copy --force"
}

use_autoreconf  yes
autoreconf.args -fvi

configure.python    ${prefix}/bin/python2.7
configure.args      --disable-update-desktop-database

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/gtk-update-icon-cache-2.0 -f -t ${prefix}/share/icons/hicolor"
}
