commit:     bee10b04b6f7eaaaf0396f9f44b2c262f8726295
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  1 16:07:53 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar  1 16:08:18 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bee10b04

net-misc/turbovnc: make SSL optional (openssl or gnutls)

OpenSSL is preferred.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/turbovnc/turbovnc-2.2.6.ebuild | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/net-misc/turbovnc/turbovnc-2.2.6.ebuild 
b/net-misc/turbovnc/turbovnc-2.2.6.ebuild
index c6879d50e22..9c47e973cb1 100644
--- a/net-misc/turbovnc/turbovnc-2.2.6.ebuild
+++ b/net-misc/turbovnc/turbovnc-2.2.6.ebuild
@@ -12,6 +12,7 @@ 
SRC_URI="https://sourceforge.net/projects/turbovnc/files/${PV}/${P}.tar.gz/downl
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64"
+IUSE="+ssl gnutls"
 
 DEPEND="
        app-arch/bzip2
@@ -22,6 +23,10 @@ DEPEND="
        virtual/opengl
        x11-libs/libX11
        x11-libs/libXext
+       ssl? (
+               !gnutls? ( dev-libs/openssl:= )
+               gnutls? ( net-libs/gnutls:= )
+       )
        !net-misc/tigervnc
 "
 RDEPEND="
@@ -44,6 +49,23 @@ src_configure() {
                -DXKB_DFLT_RULES=base
        )
 
+       if use ssl ; then
+               # We prefer OpenSSL, so default to that if SSL is enabled
+               if use gnutls ; then
+                       mycmakeargs+=( -DTVNC_USETLS="GnuTLS" )
+               else
+                       # Link properly against OpenSSL to ensure
+                       # we catch e.g. ABI change
+                       # (i.e. don't dlopen it)
+                       mycmakeargs+=(
+                               -DTVNC_USETLS=ON
+                               -DTVNC_DLOPENSSL=0
+                       )
+               fi
+       else
+               mycmakeargs+=( -DTVNC_USETLS=OFF )
+       fi
+
        if use java ; then
                export JAVACFLAGS="$(java-pkg_javac-args)"
                export JNI_CFLAGS="$(java-pkg_get-jni-cflags)"

Reply via email to