DESCRIPTION = "library for easy implementation of a RDP/VNC server"
HOMEPAGE = "https://libvnc.github.io"
SECTION = "libs"
PRIORITY = "optional"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=361b6b837cad26c6900a926b62aada5f"

PACKAGECONFIG ??= " \
    gcrypt \
    gnutls \
    jpeg \
    png \
    ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)} \
    sdl \
    zlib \
"
PACKAGECONFIG[gcrypt] = ",,libgcrypt,libgcrypt"
PACKAGECONFIG[gnutls] = ",,gnutls"
PACKAGECONFIG[jpeg] = ",-DWITH_JPEG=OFF,jpeg"
PACKAGECONFIG[openssl] = ",-DWITH_OPENSSL=OFF,openssl"
PACKAGECONFIG[png] = ",-DWITH_PNG=OFF,libpng,libpng"
PACKAGECONFIG[systemd] = ",,systemd"
PACKAGECONFIG[sdl] = ",,libsdl2"
PACKAGECONFIG[zlib] = ",,zlib"

inherit cmake

SRC_URI = "git://github.com/LibVNC/libvncserver"
SRCREV = "f997b5a75fa171d79c5e568b7157fba83c8d8355"

S = "${WORKDIR}/git"

DESCRIPTION = "library for easy implementation of a RDP/VNC server"
HOMEPAGE = "https://libvnc.github.io"
SECTION = "libs"
PRIORITY = "optional"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=361b6b837cad26c6900a926b62aada5f"

PACKAGECONFIG ??= " \
    gcrypt \
    gnutls \
    jpeg \
    lzo \
    png \
    ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)} \
    sdl \
    zlib \
"
PACKAGECONFIG[gcrypt] = ",,libgcrypt,libgcrypt"
PACKAGECONFIG[gnutls] = ",,gnutls"
PACKAGECONFIG[jpeg] = ",-DWITH_JPEG=OFF,jpeg"
PACKAGECONFIG[lzo] = ",-DWITH_LZO=OFF,lzo"
PACKAGECONFIG[openssl] = ",-DWITH_OPENSSL=OFF,openssl"
PACKAGECONFIG[png] = ",-DWITH_PNG=OFF,libpng,libpng"
PACKAGECONFIG[systemd] = ",,systemd"
PACKAGECONFIG[sdl] = ",,libsdl2"
PACKAGECONFIG[zlib] = ",,zlib"

inherit cmake

SRC_URI = "git://github.com/LibVNC/libvncserver"
SRCREV = "c0a23857a5c42b45b6d22ccf7218becd1fa69402"


S = "${WORKDIR}/git"

Update to latest commit post 0.9.12
libvncserver: Update to latest commit post 0.9.12

Update to latest git HEAD rather than just 0.9.12 since
that includes a fix for CVE-2018-15127.

Support for lzo in addition to a bundled minilzo was added
upstream so add a PACKAGECONFIG[lzo] and add it to the default config.

Signed-off-by: Randy MacLeod <66029b0d2fa503460967b26015a70d119fe79359@windriver.com>
Signed-off-by: Khem Raj <729d64b6f67515e258459a5f6d20ec88b2caf8df@gmail.com>
