# -*- 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

# -*- 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$
PortSystem      1.0
PortGroup       compilers 1.0

name            eso-tclx84
conflicts       eso-tclx84-devel
version         8.4.1
revision        10

set _name               tclx
set branch              [join [lrange [split ${version} .] 0 1] .]
categories              lang
license                 Permissive Tcl/Tk
maintainers     eso.org:usd-help
description             Tcl with extended command set
long_description        Tclx extends Tcl by providing new operating system interface \
                        commands, extended file control, scanning and status commands \
                        and many others.
homepage                http://tclx.sourceforge.net/

platforms               darwin
distname                ${_name}${version}
dist_subdir    eso-tcltk

worksrcdir              ${_name}${branch}

depends_lib             port:eso-tcl84

set tclv                8.4.20

master_sites            sourceforge:project/tclx/TclX/${version} \
                        sourceforge:project/tcl/Tcl/${tclv}:tcl
distfiles               ${distname}.tar.bz2 \
                        tcl${tclv}-src.tar.gz:tcl

checksums           tclx8.4.1.tar.bz2 \
                    rmd160  253c71aea7ad85ac364d9bda03556628d2e545c6 \
                    sha256  a9b41f606ec6c1268b9c78512e6e1cb533bd9ae3e786e650d111fc16ffe758ec \
                    tcl8.4.20-src.tar.gz \
                    rmd160  27abfdd9d8d518cfc3beff85ca782144710b13e2 \
                    sha256  fcb317b65c69f1d6962057c5622a80980bc22ffadf25c1cc50b6d02ff6c2cf40

compilers.choose  cc cpp cxx
compilers.setup   gcc 

default_variants  +${compilers.gcc_default}
use_parallel_build      no


prefix                  /opt/local/libexec/eso/tcltk-8.4

use_bzip2               yes
extract.only            ${distname}.tar.bz2

post-extract {
    system -W ${distpath} "tar xvfz tcl${tclv}-src.tar.gz -C ${workpath}"
}

configure.cflags-append "-I${workpath}/tcl${tclv}/generic -I${workpath}/tcl${tclv}/unix"

configure.args          --enable-shared \
                        --with-help=Help \
                        --with-tcl=${prefix}/lib \
                        --with-tclinclude=${workpath}/tcl${tclv}/generic/

destroot.target         install-binaries install-libraries

variant universal {}

livecheck.type          regex
livecheck.url           https://sourceforge.net/projects/tclx/files/TclX/
livecheck.regex         "title=\"(\\d+(?:\\.\\d+)*)\" class=\"folder"
