# -*- 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                slang2
conflicts           slang
set my_name         slang
version             2.3.3
revision            0
checksums           rmd160  f19e1759cf7079a03dfa63437388ddd8e1e57e11 \
                    sha256  f9145054ae131973c61208ea82486d5dd10e3c5cdad23b7c4a0617743c8f5a18 \
                    size    1646311

set branch          [join [lrange [split ${version} .] 0 1] .]
categories          lang devel
license             GPL-2+
maintainers         nomaintainer

description         multi-platform programmer's library
long_description \
    S-Lang is a multi-platform programmer's library designed to \
    allow a developer to create robust multi-platform software. \
    It provides facilities required by interactive applications \
    such as display/screen management, keyboard input, keymaps, \
    and so on. The most exciting feature of the library is the \
    slang interpreter that may be easily embedded into a program \
    to make it extensible.

homepage            https://www.jedsoft.org/slang/
master_sites        https://www.jedsoft.org/releases/slang/ \
                    https://www.jedsoft.org/releases/slang/old/

distname            ${my_name}-${version}
use_bzip2           yes

depends_lib         port:libiconv \
                    port:libpng \
                    port:oniguruma6 \
                    port:pcre \
                    port:zlib

configure.args      --without-x

# make[1]: *** No rule to make target `.../src/elfobjs', needed by `.../src/elfobjs/libslang.2.3.2.dylib'.  Stop.
use_parallel_build  no

destroot.args       install_doc_dir=${prefix}/share/doc/${my_name}-${version} \
                    SLSH_DOC_DIR=${prefix}/share/doc/slsh-${version}

post-destroot {
    foreach {lib} [concat [glob -type f ${destroot}${prefix}/lib/*.dylib] \
        [glob ${destroot}${prefix}/lib/slang/v2/modules/*.so]] {
        file attributes ${lib} -permissions 0755
    }
}

test.run            yes
test.target         check

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     >slang-(\\d+(?:\\.\\d+)*)[quotemeta ${extract.suffix}]<
