# -*- 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 89145 2012-01-19 22:14:11Z ryandesign@macports.org $

PortSystem          1.0

name                magic
version             7.5.214
revision            1
set major           [lindex [split ${version} .] 0]
categories          science
maintainers         waqar openmaintainer
description         A VLSI Layout System

long_description    Magic is a venerable VLSI layout tool, written in the \
                    1980's at Berkeley. Magic is widely cited as being the \
                    easiest tool to use for circuit layout, even for people \
                    who ultimately rely on commercial tools for their product \
                    design flow.

platforms           darwin

homepage            http://opencircuitdesign.com/magic

master_sites        http://opencircuitdesign.com/magic/archive

extract.suffix      .tgz

depends_lib         port:tcl port:tk port:blt port:mesa

checksums           rmd160  00a1c576407d593b10fe9b3aeadf22d577439e7c \
                    sha256  c809d4b497acfa69da729d06e0b4ceaab9b4eada89c38f79056f82db943667ab

patchfiles          patch-scripts-configure.in.diff

use_autoreconf      yes
autoreconf.dir      ${worksrcpath}/scripts

use_parallel_build  no

post-build {
    # The build and install don't notice when essential files don't get built,
    # so we must exit for it when it fails. #32934
    foreach f {ext2sim/exttosim.dylib ext2spice/exttospice.dylib magic/tclmagic.dylib} {
        if {![file exists ${worksrcpath}/${f}]} {
            return -code error "${f} did not get built"
        }
    }
}

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     ${name}-(${major}\\.\[0-9.\]+)${extract.suffix}
