# -*- 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                    gst
version                 3.2.5
revision                4
categories              lang
platforms               darwin
maintainers             nomaintainer
license                 GPL-2+ LGPL-2.1+

description             Free implementation of Smalltalk-80

long_description        GNU Smalltalk is a free implementation of the \
                        Smalltalk-80 language which runs on most versions on \
                        Unix and, in general, everywhere you can find a \
                        POSIX-compliance library. An uncommon feature of it is \
                        that it is well-versed to scripting tasks and headless \
                        processing.

homepage                http://smalltalk.gnu.org/
master_sites            gnu:smalltalk
distname                smalltalk-${version}

checksums               rmd160  04cc87b31e8288fc6a8ce756612d40d91ce40cde \
                        sha256  06e574e818ec49f0555d948ae53b1453d8c1df59ef597dad911a4fd1ffba1cce \
                        size    5779293

depends_build           port:zip \
                        port:gawk \
                        port:pkgconfig

depends_lib             port:libsigsegv \
                        port:libffi \
                        port:gdbm \
                        port:gmp \
                        path:lib/pkgconfig/gnutls.pc:gnutls \
                        port:libiconv \
                        port:ncurses \
                        port:readline \
                        port:libtool \
                        path:lib/pkgconfig/cairo.pc:cairo \
                        port:sqlite3 \
                        port:expat \
                        port:zlib \
                        port:libsdl

configure.cppflags-append \
                        -DUSE_INTERP_RESULT

configure.args          --infodir=${prefix}/share/info \
                        --mandir=${prefix}/share/man \
                        --enable-disassembler \
                        --enable-preemption \
                        --with-system-libltdl \
                        --with-system-libffi \
                        --with-system-libsigsegv \
                        --without-tcl \
                        --without-tk \
                        --disable-gtk

configure.args-append   --with-lispdir=${prefix}/share/emacs/site-lisp \
                        --with-lispstartdir=${prefix}/share/emacs/site-lisp/site-start.d

test.run                yes
test.target             check

default_variants +gtk +tcltk

variant gtk description {enable GTK+ bindings} {
    depends_lib-append  path:lib/pkgconfig/gtk+-2.0.pc:gtk2
    configure.args-replace \
                        --disable-gtk \
                        --enable-gtk
}

variant tcltk description {Build the Tcl/Tk module} {
    depends_lib-append  port:tcl port:tk
    configure.args-replace \
                       --without-tcl \
                       --with-tcl
    configure.args-replace \
                       --without-tk \
                       --with-tk
}

livecheck.regex         smalltalk-(\\d+(?:\\.\\d+)*)${extract.suffix}
