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

github.setup        rdesktop rdesktop 1.9.0 v
github.tarball_from releases
revision            1
categories          net
license             GPL-3+
maintainers         nomaintainer

description         Windows Terminal Server Client
long_description    \
    rdesktop is an RDP client to access Microsoft Terminal Server based services.\
    \
    The variant called w2k-license-hack is a backported patch from an rdesktop \
    1.1 patchset which was not integrated into the latest version -- it will \
    announce the client as Windows 2000 machine causing the Terminal Server to \
    provide a license for free. Please argue over this with your own \
    conscience.

platforms           darwin freebsd

homepage            https://www.rdesktop.org/

universal_variant   no

depends_build-append \
                    port:pkgconfig
depends_lib-append  port:gmp \
                    path:lib/pkgconfig/gnutls.pc:gnutls \
                    port:libao \
                    port:libiconv \
                    port:libsamplerate \
                    port:libtasn1 \
                    port:nettle \
                    port:xorg-libX11 \
                    port:xorg-libXcursor \
                    port:xorg-libXrandr

use_autoreconf      yes
autoreconf.args     -fvi

configure.args      --mandir=${prefix}/share/man \
                    --with-libiconv-prefix=${prefix} \
                    --with-sound=libao \
                    --disable-credssp \
                    --disable-smartcard

build.target        rdesktop

checksums           rmd160  a403d660585dc4f8433ea885359e4452148a2c98 \
                    sha256  473c2f312391379960efe41caad37852c59312bc8f100f9b5f26609ab5704288 \
                    size    368980

variant w2k_license_hack description {will announce the client as Windows 2000 machine} {
    patchfiles patch-licence.c
}

variant smartcard description {enables smartcard forwarding (possibly broken)} {
    configure.args-replace  --disable-credssp   --enable-credssp
    configure.args-replace  --disable-smartcard --enable-smartcard
}
