# -*- 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 84550 2011-09-27 21:05:11Z snc@macports.org $

PortSystem 1.0

name             gst
version          3.1
revision         3
categories       lang
maintainers      saispo
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/
platforms        darwin
master_sites     gnu:smalltalk
distname         smalltalk-${version}
checksums               sha1 9b1602bf29d1483d9200d83419dc3cd0fc0d397b

depends_build	 port:zip \
	 	 port:pkgconfig

depends_lib             port:libsigsegv \
                                port:libffi \
                                port:gdbm \
                                port:gmp \
                                port:libiconv \
                                port:ncurses \
                                port:readline

patchfiles      04ac00a8.patch
patch.pre_args  -p1

configure.args  --infodir=${prefix}/share/info \
                                --mandir=${prefix}/share/man \
                                --enable-disassembler \
                                --enable-preemption \
                                --with-system-libffi --with-system-libsigsegv
                                # --enable-jit

test.run                yes
test.target             check

default_variants +gtk +tcltk

variant gtk {
        depends_lib-append port:gtk2
        configure.args-append --enable-gtk
}

variant tcltk {
        depends_lib-append port:tcl port:tk
        configure.args-append --with-tk --with-tcl
}

variant nox conflicts gtk conflicts tcltk {
        configure.args-append \
                --without-x \
                --disable-gtk \
                --without-tk \
                --without-tcl
}

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