# -*- 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
PortGroup           github 1.0
PortGroup           wxWidgets 1.0

name                ucblogo
github.setup        jrincayc ${name}-code 6.2.5 version_
revision            0
checksums           rmd160  df2e35d9e55fed1445c91a201de3df422d9472bd \
                    sha256  8f4033a79c95efd0d4d2fb257b1f45dd7ba33cf7a2c8d942c29b5467ce31a4fa \
                    size    1661845

github.tarball_from releases
distname            ${name}-${version}

categories          lang
maintainers         nomaintainer
description         Berkeley Logo
long_description    Berkeley Logo is a free Logo interpreter.
homepage            https://people.eecs.berkeley.edu/~bh/logo.html
license             GPL-3

depends_lib         port:ncurses

configure.args      --cache-file=/dev/null \
                    --disable-docs \
                    --disable-x11 \
                    ac_cv_path_WX_CONFIG_PATH=no

github.livecheck.regex {([0-9.]+)}

variant wxWidgets description {Use wxWidgets for graphics} {
    if {${os.platform} eq "darwin" && ${os.major} > 15} {
        wxWidgets.use   wxWidgets-3.2
    } elseif {${os.platform} eq "darwin" && ${os.major} > 10} {
        wxWidgets.use   wxWidgets-3.0
    } else {
        wxWidgets.use   wxGTK-3.0
    }

    depends_lib-append port:${wxWidgets.port}

    configure.args-delete ac_cv_path_WX_CONFIG_PATH=no
    configure.args-append --enable-wx --with-wxdir=${wxWidgets.wxdir}

    build.target mac

    destroot.violate_mtree yes
    destroot {
        xinstall -d -m 0755 ${destroot}${applications_dir}
        file copy ${worksrcpath}/${name}.app \
                  ${destroot}${applications_dir}/${name}.app
    }
}
