# $Id: Portfile 117433 2014-02-26 06:52:50Z mww@macports.org $

PortSystem 1.0

name                4th
version             3.62.2
categories          lang
platforms           darwin
maintainers         mww
license             LGPL-3
description         very small Forth compiler
long_description    4tH is a very small Forth compiler that can create \
                    bytecode, C-embeddable bytecode, standalone executables, \
                    but also works fine as a scripting language. It supports \
                    over 85% of the ANS Forth CORE wordset and features \
                    conditional compilation, pipes, files, assertions, forward \
                    declarations, recursion, include files, etc.

homepage            http://thebeez.home.xs4all.nl/4tH/
master_sites        sourceforge:forth-4th
distname            ${distname}-unix
checksums           rmd160  4ca87b31652097e5ec043d6e6cdf245518cb7ff9 \
                    sha256  7d4eeb52402d4c647141cb02e131723c90d77fe5fb70ca7780faf843cad94a2e
patchfiles          patch-Makefile.OSX.diff

worksrcdir          ${worksrcdir}/sources

variant universal   {}

post-extract { xinstall -m 755 ${filespath}/configure ${worksrcpath} }

configure.cppflags-delete -I${prefix}/include
configure.ldflags-delete -L${prefix}/lib
configure.env-append PREFIX=${prefix}
build.args          -f Makefile.OSX
destroot.args       -f Makefile.OSX

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc
    file copy ${worksrcpath}/../documentation ${destroot}${prefix}/share/doc/${name}
    file copy ${worksrcpath}/../4th ${destroot}${prefix}/share/doc/${name}/
    file rename ${destroot}${prefix}/share/doc/4th/4th.1 \
        ${destroot}${prefix}/share/man/man1/4th.1
}

livecheck.type      regex
livecheck.url       http://www.xs4all.nl/~thebeez/4tH/download.html
livecheck.regex     4th-(\[a-z0-9\\.\]+)-unix.tar.gz
