summaryrefslogtreecommitdiff
path: root/x11-misc/virtualgl
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-01-12 16:58:08 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-01-12 16:58:08 +0000
commitc8a77dfe4d3d307c1d5dd2650b7297447d8b609d (patch)
tree9ea78393bc3ecd6ab4de449383d4e97e5f3648ae /x11-misc/virtualgl
parent2891d29af8907ce881662f4a02844926d7a293c7 (diff)
gentoo resync : 12.01.2019
Diffstat (limited to 'x11-misc/virtualgl')
-rw-r--r--x11-misc/virtualgl/Manifest5
-rw-r--r--x11-misc/virtualgl/files/virtualgl-2.5.2-openssl-1.1-compat-a974c22141d0ded9ff60a0b903f81e6b484d6ba4.patch168
-rw-r--r--x11-misc/virtualgl/virtualgl-2.5.2-r1.ebuild91
-rw-r--r--x11-misc/virtualgl/virtualgl-2.6.1.ebuild93
-rw-r--r--x11-misc/virtualgl/virtualgl-9999.ebuild93
5 files changed, 450 insertions, 0 deletions
diff --git a/x11-misc/virtualgl/Manifest b/x11-misc/virtualgl/Manifest
index e4f49c3cc31a..cd182577921b 100644
--- a/x11-misc/virtualgl/Manifest
+++ b/x11-misc/virtualgl/Manifest
@@ -2,6 +2,11 @@ AUX vgl-helper.sh 881 BLAKE2B 5373592a2fb784e38c1542aadb4f150937a69f51284bf21337
AUX vgl.confd-r2 629 BLAKE2B 9794409221cc6a95b2f7a48e02063d3c6bcfd66c6b3e1929073947b3794ab1f9e69c76be47b9d06fa4ec9404e3ec4b4f7cc3f0395fc3d09684f346304db6202f SHA512 bab0ad095a2f075a1923f1b58531101bce634c89b30e77c239ee224b58eac3083c7eba4d21bd997a4dc8b6e4cfb0be7b013732bdf37a27a16a3301a098d60c29
AUX vgl.initd-r3 856 BLAKE2B df423f82debf67ef0611c603bf38aa76173044012d3bc5a6276d1325e0d706fc6ff868957d7bc4ea1e14171a7000dabfef4acf3f736e22f9a40c3bdbb4ac0033 SHA512 fcc6c02265e0e2bb1faa00e5da2246b56a7bd8c730faa912904953f5c67eae12bffa99fe57f2a76d199c22956fc1b6ca940fba40972b2afbf73ae7f4f2a0fc7d
AUX vgl.service 254 BLAKE2B 0a0e73228821019a764b1bc3ff61a752b15001018f704739d86eebbf326ee3a0612475cf7a0c360993e1a27c87815626290dfe4d85fc7e1aaa3897ce41f787c2 SHA512 18615552301c52c272bc47f942c47121100c175651b3957ddf996ca40e755d96dd51194ecb599c92e62fbdba3b9245e999ef488c889833009f8eba1c038c38f9
+AUX virtualgl-2.5.2-openssl-1.1-compat-a974c22141d0ded9ff60a0b903f81e6b484d6ba4.patch 5047 BLAKE2B 75dadf6d80456a702a3591b04b771410768e65c009da576502ada0fd192f480b20c6e0b12e470950be3306df7944f3b6bd890d0f4f97b778052eda63309cc0ea SHA512 a7d7dfc54f1fb00c00e8ae3011c7a28b4029f20049b9d792e2e8833fba79eb64f57c6ca6778d6d8bf4f383a2b08013e0d3b3db869ed8c08da549c89f095c4d3d
DIST VirtualGL-2.5.2.tar.gz 1172965 BLAKE2B 2aac9db4fdbec49c5251f9ba85fda81efd5025891a124991e9787e9bf869b054e419c6c377c0dcf5988a1785c16159c12a4c45d5d7419f3d6c17a09316dfd7e6 SHA512 a3156f663c03e611a98a083bb12bea47820cdadc9f064e20431fddec55aae560f09b133f5254a24d7da01b64be2672d27713d7f6605eaca2d9d83090a070fafd
+DIST VirtualGL-2.6.1.tar.gz 1278335 BLAKE2B 62abb082eb8c82fecff33dd5b5036ebaead99b837cf0dc42581790863f09814858fd7a23a479c0c4ac5e59a4cc99af58903016a5109a6636191ce98d6da3d0bd SHA512 36580e55e11ba3e93945d62e865fe0b63ecd5aa1ee3889fb4d0940c68da06737fff4689a77638f5c8c57dbc9d020ba821bdec9aa2f6b2f0f144b18f1c3d8c5e5
+EBUILD virtualgl-2.5.2-r1.ebuild 2616 BLAKE2B 36f0a927e0663913194c94c42d8e0f88f6cbae7bafe46dd5f7aa304377904c5b289743f62acb52660a36cce054885c552e6625c696b8f09c99bcab0dbc942380 SHA512 1dab9b93693e26a3cf3823237a377a72b177ef0ab9c038570d7bfb5ae2e7352f23d5e0cb0972b751f2457607839498022586adcec2ef98fece098fd5336dacd2
EBUILD virtualgl-2.5.2.ebuild 2507 BLAKE2B 70374ee9d5ac16a917e3755d3fa2e6228a045e502d57d7060f2a63a7e457524422e588a693870a3ea3da15462925e1a4f761a8a7de868090436afbaccd9b9c17 SHA512 c30fa84d7876b8389a81d52f4f6981419ef3630acbd54ffe8263b5c9beec71c59e14a270a6138e7be10de668b2aaf9c6054e70eb57ac22d9f8b86de905c37f81
+EBUILD virtualgl-2.6.1.ebuild 2625 BLAKE2B 58e25d1fc1235b4b560aebf2b9fc5fe95521a2a1cbc34a4a60eec583fa4251bbe5347cd44c56712a2c5e19e8e5282596197021b031cad2e3f35bc716deadd697 SHA512 731403a3fdd9630e634ada1b0f73d7a5ac75522e9fc313bf0b63ff5bb51165f9d1aea10910f3656168b381a6786c97be1e8e9aeb9af0d661a1bd21f00cda8db0
+EBUILD virtualgl-9999.ebuild 2625 BLAKE2B 58e25d1fc1235b4b560aebf2b9fc5fe95521a2a1cbc34a4a60eec583fa4251bbe5347cd44c56712a2c5e19e8e5282596197021b031cad2e3f35bc716deadd697 SHA512 731403a3fdd9630e634ada1b0f73d7a5ac75522e9fc313bf0b63ff5bb51165f9d1aea10910f3656168b381a6786c97be1e8e9aeb9af0d661a1bd21f00cda8db0
MISC metadata.xml 736 BLAKE2B b0fef33f453e573f7742dff774acdd66aae3a8ed586718eb2c88fb5776c8c8040a94285971022ea52a47a702911a6d0f0f669e0cc8facac09d127a73ab6d083d SHA512 b1d37b1974a1db8cb9080279863708a6c1e50a86114ccfb17540980c178093ae6617b1bdfa470e73899277b44af231e41ec2b28504da5e335c0e34d509457600
diff --git a/x11-misc/virtualgl/files/virtualgl-2.5.2-openssl-1.1-compat-a974c22141d0ded9ff60a0b903f81e6b484d6ba4.patch b/x11-misc/virtualgl/files/virtualgl-2.5.2-openssl-1.1-compat-a974c22141d0ded9ff60a0b903f81e6b484d6ba4.patch
new file mode 100644
index 000000000000..d5d923f89d1b
--- /dev/null
+++ b/x11-misc/virtualgl/files/virtualgl-2.5.2-openssl-1.1-compat-a974c22141d0ded9ff60a0b903f81e6b484d6ba4.patch
@@ -0,0 +1,168 @@
+Patch modified to apply to VirtualGL 2.5.2, before
+1b82bceb3723b24ea5dc32edffbe019a8a37ab39 reformatted whitespace
+
+
+From a974c22141d0ded9ff60a0b903f81e6b484d6ba4 Mon Sep 17 00:00:00 2001
+From: DRC <information@virtualgl.org>
+Date: Mon, 16 Apr 2018 15:06:07 -0500
+Subject: [PATCH] OpenSSL improvements
+
+- Fix build issues with OpenSSL 1.1 (OpenSSL 1.1 and later no longer
+ provides CRYPTO_set_locking_callback(), since locking is now performed
+ internally.)
+- Detect whether the platform has /dev/urandom at compile time, rather
+ than assuming that all Sun and SGI machines don't have it (Solaris 10
+ and later supports /dev/urandom.)
+---
+ ChangeLog.md | 2 ++
+ include/Socket.h | 8 ++++++--
+ util/CMakeLists.txt | 5 +++++
+ util/Socket.cpp | 25 ++++++++++++++++---------
+ 4 files changed, 29 insertions(+), 11 deletions(-)
+
+diff --git a/ChangeLog.md b/ChangeLog.md
+index 3632c1d8..5c9bff84 100644
+--- a/ChangeLog.md
++++ b/ChangeLog.md
+@@ -52,6 +52,8 @@ a subsequent segfault when VTK tried to call `glBlendFuncSeparate()`.
+ VirtualGL's implementation of `glXGetVisualFromFBConfig()` now returns NULL
+ unless the FB config has a corresponding visual on the 3D X server.
+
++6. VirtualGL can now be built and run with OpenSSL 1.1.
++
+
+ 2.5.2
+ =====
+diff --git a/include/Socket.h b/include/Socket.h
+index dfe45e3a..f7409956 100644
+--- a/include/Socket.h
++++ b/include/Socket.h
+@@ -1,6 +1,6 @@
+ /* Copyright (C)2004 Landmark Graphics Corporation
+ * Copyright (C)2005 Sun Microsystems, Inc.
+- * Copyright (C)2014, 2016 D. R. Commander
++ * Copyright (C)2014, 2016, 2018 D. R. Commander
+ *
+ * This library is free software and may be redistributed and/or modified under
+ * the terms of the wxWindows Library License, Version 3.1 or (at your option)
+@@ -23,7 +23,7 @@
+ #endif
+ #include <openssl/ssl.h>
+ #include <openssl/err.h>
+-#if defined(sun) || defined(sgi)
++#if !defined(HAVE_DEVURANDOM) && !defined(_WIN32)
+ #include <openssl/rand.h>
+ #endif
+ #endif
+@@ -161,15 +161,19 @@ namespace vglutil
+
+ #ifdef USESSL
+
++ #if OPENSSL_VERSION_NUMBER < 0x10100000L
+ static void lockingCallback(int mode, int type, const char *file,
+ int line)
+ {
+ if(mode&CRYPTO_LOCK) cryptoLock[type].lock();
+ else cryptoLock[type].unlock();
+ }
++ #endif
+
+ static bool sslInit;
++ #if OPENSSL_VERSION_NUMBER < 0x10100000L
+ static CriticalSection cryptoLock[CRYPTO_NUM_LOCKS];
++ #endif
+ bool doSSL; SSL_CTX *sslctx; SSL *ssl;
+
+ #endif
+diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt
+index 65ef59e7..ed1dfb39 100644
+--- a/util/CMakeLists.txt
++++ b/util/CMakeLists.txt
+@@ -13,6 +13,11 @@ target_link_libraries(bmptest vglutil)
+ add_executable(pftest pftest.c)
+ target_link_libraries(pftest vglutil)
+
++if(EXISTS /dev/urandom)
++ message(STATUS "Using /dev/urandom for random number generation")
++ add_definitions(-DHAVE_DEVURANDOM)
++endif()
++
+ add_library(vglsocket STATIC Socket.cpp)
+ target_link_libraries(vglsocket vglutil)
+ if(WIN32)
+diff --git a/util/Socket.cpp b/util/Socket.cpp
+index 0d230841..b41c25e9 100644
+--- a/util/Socket.cpp
++++ b/util/Socket.cpp
+@@ -1,6 +1,6 @@
+ /* Copyright (C)2004 Landmark Graphics Corporation
+ * Copyright (C)2005 Sun Microsystems, Inc.
+- * Copyright (C)2014, 2016 D. R. Commander
++ * Copyright (C)2014, 2016, 2018 D. R. Commander
+ *
+ * This library is free software and may be redistributed and/or modified under
+ * the terms of the wxWindows Library License, Version 3.1 or (at your option)
+@@ -43,32 +43,37 @@ typedef socklen_t SOCKLEN_T;
+
+ #ifdef USESSL
+ bool Socket::sslInit=false;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ CriticalSection Socket::cryptoLock[CRYPTO_NUM_LOCKS];
+ #endif
++#endif
+ CriticalSection Socket::mutex;
+ int Socket::instanceCount=0;
+
+
+ #ifdef USESSL
+
+-static void progressCallback(int p, int n, void *arg)
+-{
+-}
+-
+-
+ static EVP_PKEY *newPrivateKey(int bits)
+ {
++ BIGNUM *bn = NULL;
++ RSA *rsa = NULL;
+ EVP_PKEY *pk=NULL;
+
+ try
+ {
++ if(!(bn = BN_new())) _throwssl();
++ if(!BN_set_word(bn, RSA_F4)) _throwssl();
++ if(!(rsa = RSA_new())) _throwssl();
++ if(!RSA_generate_key_ex(rsa, bits, bn, NULL)) _throwssl();
+ if(!(pk=EVP_PKEY_new())) _throwssl();
+- if(!EVP_PKEY_assign_RSA(pk, RSA_generate_key(bits, 0x10001,
+- progressCallback, NULL))) _throwssl();
++ if(!EVP_PKEY_assign_RSA(pk, rsa)) _throwssl();
++ BN_free(bn);
+ return pk;
+ }
+ catch (...)
+ {
++ if(bn) BN_free(bn);
++ if(rsa) RSA_free(rsa);
+ if(pk) EVP_PKEY_free(pk);
+ throw;
+ }
+@@ -147,7 +152,7 @@ Socket::Socket(bool doSSL_)
+ #ifdef USESSL
+ if(!sslInit && doSSL)
+ {
+- #if defined(sun) || defined(sgi)
++ #if !defined(HAVE_DEVURANDOM) && !defined(_WIN32)
+ char buf[128]; int i;
+ srandom(getpid());
+ for(i = 0; i < 128; i++)
+@@ -158,7 +163,9 @@ Socket::Socket(bool doSSL_)
+ SSL_load_error_strings();
+ ERR_load_crypto_strings();
+ CRYPTO_set_id_callback(Thread::threadID);
++ #if OPENSSL_VERSION_NUMBER < 0x10100000L
+ CRYPTO_set_locking_callback(lockingCallback);
++ #endif
+ SSL_library_init();
+ sslInit = true;
+ char *env = NULL;
diff --git a/x11-misc/virtualgl/virtualgl-2.5.2-r1.ebuild b/x11-misc/virtualgl/virtualgl-2.5.2-r1.ebuild
new file mode 100644
index 000000000000..aa35612ba1ba
--- /dev/null
+++ b/x11-misc/virtualgl/virtualgl-2.5.2-r1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-multilib flag-o-matic multilib systemd
+
+DESCRIPTION="Run OpenGL applications remotely with full 3D hardware acceleration"
+HOMEPAGE="https://www.virtualgl.org/"
+
+MY_PN="VirtualGL"
+MY_P="${MY_PN}-${PV}"
+S="${WORKDIR}/${MY_P}"
+SRC_URI="mirror://sourceforge/${PN}/files/${PV}/${MY_P}.tar.gz"
+
+SLOT="0"
+LICENSE="LGPL-2.1 wxWinLL-3.1 FLTK"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="libressl ssl"
+
+RDEPEND="
+ ssl? (
+ !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+ )
+ media-libs/libjpeg-turbo[${MULTILIB_USEDEP}]
+ x11-libs/libX11[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXv[${MULTILIB_USEDEP}]
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ amd64? ( abi_x86_32? (
+ >=media-libs/libjpeg-turbo-1.3.0-r3[abi_x86_32]
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ >=x11-libs/libXv-1.0.10[abi_x86_32]
+ >=virtual/glu-9.0-r1[abi_x86_32]
+ >=virtual/opengl-7.0-r1[abi_x86_32]
+ ) )
+"
+DEPEND="${RDEPEND}"
+PATCHES=(
+ "${FILESDIR}/virtualgl-2.5.2-openssl-1.1-compat-a974c22141d0ded9ff60a0b903f81e6b484d6ba4.patch"
+)
+
+src_prepare() {
+ # Use /var/lib, bug #428122
+ sed -e "s#/etc/opt#/var/lib#g" -i doc/unixconfig.txt doc/index.html doc/advancedopengl.txt \
+ server/vglrun.in server/vglgenkey server/vglserver_config || die
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ # Completely breaks steam/wine for discrete graphics otherwise
+ # see https://github.com/VirtualGL/virtualgl/issues/16
+ append-ldflags "-Wl,--no-as-needed"
+
+ abi_configure() {
+ local mycmakeargs=(
+ -DVGL_USESSL="$(usex ssl)"
+ -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/"${PF}"
+ -DTJPEG_INCLUDE_DIR=/usr/include
+ -DCMAKE_INSTALL_LIBDIR=/usr/$(get_libdir)
+ -DTJPEG_LIBRARY=/usr/$(get_libdir)/libturbojpeg.so
+ -DCMAKE_LIBRARY_PATH=/usr/$(get_libdir)
+ )
+ cmake-utils_src_configure
+ }
+ multilib_parallel_foreach_abi abi_configure
+}
+
+src_install() {
+ cmake-multilib_src_install
+
+ # Make config dir
+ dodir /var/lib/VirtualGL
+ fowners root:video /var/lib/VirtualGL
+ fperms 0750 /var/lib/VirtualGL
+ newinitd "${FILESDIR}/vgl.initd-r3" vgl
+ newconfd "${FILESDIR}/vgl.confd-r2" vgl
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vgl-helper.sh"
+ systemd_dounit "${FILESDIR}/vgl.service"
+
+ # Rename glxinfo to vglxinfo to avoid conflict with x11-apps/mesa-progs
+ mv "${D}"/usr/bin/{,v}glxinfo || die
+
+ # Remove license files, bug 536284
+ rm "${D}"/usr/share/doc/${PF}/{LGPL.txt*,LICENSE*} || die
+}
diff --git a/x11-misc/virtualgl/virtualgl-2.6.1.ebuild b/x11-misc/virtualgl/virtualgl-2.6.1.ebuild
new file mode 100644
index 000000000000..05ef6a703773
--- /dev/null
+++ b/x11-misc/virtualgl/virtualgl-2.6.1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-multilib flag-o-matic multilib systemd
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/VirtualGL/${PN}.git"
+ inherit git-r3
+else
+ MY_PN="VirtualGL"
+ MY_P="${MY_PN}-${PV}"
+ S="${WORKDIR}/${MY_P}"
+ SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~x86"
+fi
+
+DESCRIPTION="Run OpenGL applications remotely with full 3D hardware acceleration"
+HOMEPAGE="https://www.virtualgl.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 wxWinLL-3.1 FLTK"
+IUSE="libressl ssl"
+
+RDEPEND="
+ ssl? (
+ !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+ )
+ media-libs/libjpeg-turbo[${MULTILIB_USEDEP}]
+ x11-libs/libX11[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXv[${MULTILIB_USEDEP}]
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ amd64? ( abi_x86_32? (
+ >=media-libs/libjpeg-turbo-1.3.0-r3[abi_x86_32]
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ >=x11-libs/libXv-1.0.10[abi_x86_32]
+ >=virtual/glu-9.0-r1[abi_x86_32]
+ >=virtual/opengl-7.0-r1[abi_x86_32]
+ ) )
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # Use /var/lib, bug #428122
+ sed -e "s#/etc/opt#/var/lib#g" -i doc/unixconfig.txt doc/index.html doc/advancedopengl.txt \
+ server/vglrun.in server/vglgenkey server/vglserver_config || die
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ # Completely breaks steam/wine for discrete graphics otherwise
+ # see https://github.com/VirtualGL/virtualgl/issues/16
+ append-ldflags "-Wl,--no-as-needed"
+
+ abi_configure() {
+ local mycmakeargs=(
+ -DVGL_USESSL="$(usex ssl)"
+ -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/"${PF}"
+ -DTJPEG_INCLUDE_DIR=/usr/include
+ -DCMAKE_INSTALL_LIBDIR=/usr/$(get_libdir)
+ -DTJPEG_LIBRARY=/usr/$(get_libdir)/libturbojpeg.so
+ -DCMAKE_LIBRARY_PATH=/usr/$(get_libdir)
+ )
+ cmake-utils_src_configure
+ }
+ multilib_parallel_foreach_abi abi_configure
+}
+
+src_install() {
+ cmake-multilib_src_install
+
+ # Make config dir
+ dodir /var/lib/VirtualGL
+ fowners root:video /var/lib/VirtualGL
+ fperms 0750 /var/lib/VirtualGL
+ newinitd "${FILESDIR}/vgl.initd-r3" vgl
+ newconfd "${FILESDIR}/vgl.confd-r2" vgl
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vgl-helper.sh"
+ systemd_dounit "${FILESDIR}/vgl.service"
+
+ # Rename glxinfo to vglxinfo to avoid conflict with x11-apps/mesa-progs
+ mv "${D}"/usr/bin/{,v}glxinfo || die
+
+ # Remove license files, bug 536284
+ rm "${D}"/usr/share/doc/${PF}/{LGPL.txt*,LICENSE*} || die
+}
diff --git a/x11-misc/virtualgl/virtualgl-9999.ebuild b/x11-misc/virtualgl/virtualgl-9999.ebuild
new file mode 100644
index 000000000000..05ef6a703773
--- /dev/null
+++ b/x11-misc/virtualgl/virtualgl-9999.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-multilib flag-o-matic multilib systemd
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/VirtualGL/${PN}.git"
+ inherit git-r3
+else
+ MY_PN="VirtualGL"
+ MY_P="${MY_PN}-${PV}"
+ S="${WORKDIR}/${MY_P}"
+ SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~x86"
+fi
+
+DESCRIPTION="Run OpenGL applications remotely with full 3D hardware acceleration"
+HOMEPAGE="https://www.virtualgl.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 wxWinLL-3.1 FLTK"
+IUSE="libressl ssl"
+
+RDEPEND="
+ ssl? (
+ !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+ )
+ media-libs/libjpeg-turbo[${MULTILIB_USEDEP}]
+ x11-libs/libX11[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXv[${MULTILIB_USEDEP}]
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ amd64? ( abi_x86_32? (
+ >=media-libs/libjpeg-turbo-1.3.0-r3[abi_x86_32]
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ >=x11-libs/libXv-1.0.10[abi_x86_32]
+ >=virtual/glu-9.0-r1[abi_x86_32]
+ >=virtual/opengl-7.0-r1[abi_x86_32]
+ ) )
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # Use /var/lib, bug #428122
+ sed -e "s#/etc/opt#/var/lib#g" -i doc/unixconfig.txt doc/index.html doc/advancedopengl.txt \
+ server/vglrun.in server/vglgenkey server/vglserver_config || die
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ # Completely breaks steam/wine for discrete graphics otherwise
+ # see https://github.com/VirtualGL/virtualgl/issues/16
+ append-ldflags "-Wl,--no-as-needed"
+
+ abi_configure() {
+ local mycmakeargs=(
+ -DVGL_USESSL="$(usex ssl)"
+ -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/"${PF}"
+ -DTJPEG_INCLUDE_DIR=/usr/include
+ -DCMAKE_INSTALL_LIBDIR=/usr/$(get_libdir)
+ -DTJPEG_LIBRARY=/usr/$(get_libdir)/libturbojpeg.so
+ -DCMAKE_LIBRARY_PATH=/usr/$(get_libdir)
+ )
+ cmake-utils_src_configure
+ }
+ multilib_parallel_foreach_abi abi_configure
+}
+
+src_install() {
+ cmake-multilib_src_install
+
+ # Make config dir
+ dodir /var/lib/VirtualGL
+ fowners root:video /var/lib/VirtualGL
+ fperms 0750 /var/lib/VirtualGL
+ newinitd "${FILESDIR}/vgl.initd-r3" vgl
+ newconfd "${FILESDIR}/vgl.confd-r2" vgl
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vgl-helper.sh"
+ systemd_dounit "${FILESDIR}/vgl.service"
+
+ # Rename glxinfo to vglxinfo to avoid conflict with x11-apps/mesa-progs
+ mv "${D}"/usr/bin/{,v}glxinfo || die
+
+ # Remove license files, bug 536284
+ rm "${D}"/usr/share/doc/${PF}/{LGPL.txt*,LICENSE*} || die
+}