# -*- 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           active_variants 1.1
PortGroup           cmake 1.1

name                putty
version             0.80
categories          security net
maintainers         nomaintainer
license             MIT

description         a free implementation of Telnet and SSH, along with an \
                    xterm terminal emulator

long_description    PuTTY is ${description}

homepage            https://www.chiark.greenend.org.uk/~sgtatham/putty/
master_sites        ftp://ftp.chiark.greenend.org.uk/users/sgtatham/putty-${version}/ \
                    https://the.earth.li/~sgtatham/putty/${version}/

checksums           rmd160  2399fd6bb070bf7c1d7e2500d4d58b9e2ccc87d9 \
                    sha256  2013c83a721b1753529e9090f7c3830e8fe4c80a070ccce764539badb3f67081 \
                    size    2831433

depends_build-append    port:pkgconfig
configure.args-append   -DPUTTY_GTK_VERSION=0

pre-configure {
    configure.cflags-delete -DNDEBUG
}

variant gui description {Build the GUI tools (including putty itself)} {
    depends_lib-append      path:lib/pkgconfig/gtk+-3.0.pc:gtk3
    require_active_variants gtk3 x11
    configure.args-append   -DPUTTY_GTK_VERSION=3
}

default_variants +gui

livecheck.type      regex
livecheck.url       ${homepage}download.html
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
