# -*- 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
# $Id: Portfile 118024 2014-03-19 16:47:29Z macsforever2000@macports.org $

PortSystem          1.0

name                pcb
version             20140316

categories          x11 graphics
maintainers         nomaintainer
license             GPL-2+

description         Printed Circuit Board Layout Tool
long_description    PCB is an interactive printed circuit board editor for the \
                    X11 window system. PCB includes a rats nest feature, design \
                    rule checking, and can provide industry standard RS-274-X \
                    (Gerber), NC drill, and centroid data (X-Y data) output for \
                    use in the board fabrication and assembly process. PCB offers \
                    high end features such as an autorouter and trace optimizer \
                    which can tremendously reduce layout time.

homepage            http://pcb.sourceforge.net
master_sites        sourceforge
platforms           darwin

checksums           md5     d3bc42a703aed651f1e7011b235be467 \
                    rmd160  70ef878227ad52c83ce4499373550e7a8d807dd4 \
                    sha1    ec714ff136d1817e500e1a9e654e786883b9501e \
                    sha256  82c4f39438ee4e278196a3b67ef021145dcfbb00519508ccf51aa7832121c950
                    

depends_build       port:intltool \
                    port:pkgconfig
depends_run         bin:wish:tk
depends_lib         port:dbus \
                    port:gd2 \
                    port:gtk2 \
                    port:gtkglext \
                    port:mesa

configure.args      --mandir=${prefix}/share/man \
                    --infodir=${prefix}/share/info \
                    --disable-update-desktop-database \
                    --enable-dbus \
                    --disable-update-mime-database

post-extract {
    file copy ${worksrcpath}/gts/gts.h ${worksrcpath}/gts/pcbgts.h
}

post-patch {
    #rename pcb's builtin gts library so it won't conflict with port gts
    reinplace "s|gts.h|pcbgts.h|"  ${worksrcpath}/gts/Makefile.in \
                                   ${worksrcpath}/src/toporouter.h
    reinplace "s|gts.a|pcbgts.a|g" ${worksrcpath}/gts/Makefile.in \
                                   ${worksrcpath}/src/Makefile.in
}

post-configure {
    #hackish, couldn't disable OS X SDKs' OpenGL in configure script
    reinplace "s|#define HAVE_OPENGL_GL_H 1||"  ${worksrcpath}/config.h
    reinplace "s|#define HAVE_OPENGL_GLU_H 1||" ${worksrcpath}/config.h
}

build.env           LC_CTYPE=en_US.ISO8859-1
