# -*- 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
PortGroup       legacysupport 1.1

# getline
legacysupport.newest_darwin_requires_legacy 10

github.setup    nimble-code spin 6.5.2 version-
revision        0
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.
homepage        http://spinroot.com
checksums       rmd160  a169571ac0796e36e576330966dfb5c0c071696d \
                sha256  b3864e69797e556b75fbbb0b2f9c54084a8eccefb9108732e27568c2611975f6 \
                size    6085037
github.tarball_from tarball

depends_lib-append \
                port:tcl \
                port:tk

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" \
                LDFLAGS="${configure.ldflags}"

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

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

notes           "The ispin command needs X server, either from xquartz port or xorg-server(-legacy)."
