# $Id: Portfile 62245 2010-01-01 20:40:43Z nox@macports.org $

PortSystem 1.0

name          tcl
version       8.5.8
# Tk (x11/tk) port depends on this version
categories    lang
maintainers   mww openmaintainer
platforms     darwin freebsd
description   Tool Command Language
long_description \
  Tcl (Tool Command Language) is a very powerful but easy to learn dynamic \
  programming language, suitable for a very wide range of uses, including web \
  and desktop applications, networking, administration, testing and many more. \
  Open source and business-friendly, Tcl is a mature yet evolving language \
  that is truly cross platform, easily deployed and highly extensible.

homepage      http://www.tcl.tk/
master_sites  sourceforge

checksums           md5     7f123e53b3daaaba2478d3af5a0752e3 \
                    sha1    21de27a24633c7550383bc7c35736e9acd5cb3a8 \
                    rmd160  dfba63e9a3896350b88f592301fbe6669a60b5c1

dist_subdir     tcltk
distname        ${name}${version}-src
worksrcdir      ${name}${version}/unix
configure.args  --mandir=${prefix}/share/man --disable-corefoundation
configure.cppflags-delete  -I${prefix}/include
configure.ldflags-delete   -L${prefix}/lib

destroot.destdir  INSTALL_ROOT=${destroot}
post-destroot {
    ln -s tclsh8.5 ${destroot}${prefix}/bin/tclsh
    ln -s libtcl8.5.dylib ${destroot}${prefix}/lib/libtcl.dylib
}

# dont enable threads by default as Tcl uses thread-local storage which makes
# passing Tcl_Obj* around between threads fatal
variant threads description {add multithreading support} {
    configure.args-append --enable-threads
}

variant memdebug description {enable memory debugging support} {
    configure.args-append --enable-symbols=mem
}

platform darwin {
    configure.args-append tcl_cv_type_64bit="long long"
}

# Files with failing tests: socket.test
test.run      yes

livecheck.type  regex
livecheck.regex {Tcl/Tk (\d+(?:\.\d+)*)</a>}
