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

github.setup                LibVNC libvncserver 0.9.15 LibVNCServer-
revision                    0
checksums                   rmd160  66dc509eace987ee8584f7534410cd632c2f01c6 \
                            sha256  62352c7795e231dfce044beb96156065a05a05c974e5de9e023d688d8ff675d7 \
                            size    600387

name                        LibVNCServer
categories                  devel
maintainers                 {ryandesign @ryandesign} openmaintainer
license                     GPL-2+

description                 library for writing VNC servers and clients

long_description            ${name} is a library to make it easier to write \
                            programs that use the RFB (Remote Frame Buffer) \
                            protocol to implement a VNC server or client.

homepage                    https://libvnc.github.io
github.tarball_from         archive

depends_build-append        path:bin/pkg-config:pkgconfig

depends_lib-append          port:cyrus-sasl2 \
                            path:lib/pkgconfig/gnutls.pc:gnutls \
                            path:include/turbojpeg.h:libjpeg-turbo \
                            port:libgcrypt \
                            port:libpng \
                            port:zlib

compiler.thread_local_storage yes

configure.args              -DWITH_EXAMPLES=OFF \
                            -DWITH_FFMPEG=OFF \
                            -DWITH_GCRYPT=ON \
                            -DWITH_GNUTLS=ON \
                            -DWITH_GTK=OFF \
                            -DWITH_JPEG=ON \
                            -DWITH_LIBSSH2=OFF \
                            -DWITH_LZO=ON \
                            -DWITH_OPENSSL=OFF \
                            -DWITH_PNG=ON \
                            -DWITH_SASL=ON \
                            -DWITH_SDL=OFF \
                            -DWITH_SYSTEMD=OFF \
                            -DWITH_ZLIB=ON

test.run                    yes
test.env                    DYLD_LIBRARY_PATH=${build.dir}

post-destroot {
    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} \
        AUTHORS \
        COPYING \
        ChangeLog \
        HISTORY.md \
        NEWS.md \
        README.md \
        SECURITY.md \
        ${destroot}${docdir}
}
