# -*- 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
PortGroup       github 1.0
github.setup    nimble-code spin 6.5.2 version-
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
categories      devel
maintainers     {jann @roederja} openmaintainer
license         SPIN
description     The Spin model checker

long_description \
    SPIN is a general tool for verifying the correctness of \
    distributed software (software design) in a rigorous and \
    mostly automated fashion.

notes           "The ispin command needs an X server. Either from the xorg-server port or from\
                 www.xquartz.org"

homepage        http://spinroot.com
checksums       rmd160  a169571ac0796e36e576330966dfb5c0c071696d \
                sha256  b3864e69797e556b75fbbb0b2f9c54084a8eccefb9108732e27568c2611975f6 \
                size    6085037
depends_lib     port:tk port:tcl
use_configure   no
use_parallel_build no

pre-patch   {
    file rename ${worksrcpath}/optional_gui/ispin.tcl ${worksrcpath}/optional_gui/ispin
}

build.post_args CC="${configure.cc}" \
                CFLAGS="${configure.cflags} -O2 -DNXT -DMAC"

destroot.post_args INSTALL=install \
                   "${destroot.destdir}/${prefix}"

post-destroot    {
    xinstall -m 0755 ${worksrcpath}/optional_gui/ispin \
        ${destroot}${prefix}/bin
}
