Skip to content

Commit

Permalink
x11-misc/virtualgl: Fix ISO C++17 does not allow register storage cla…
Browse files Browse the repository at this point in the history
…ss specifier

Closes: https://bugs.gentoo.org/898876
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
  • Loading branch information
listout committed Jun 1, 2023
1 parent a461cd2 commit 37cade6
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
53 changes: 53 additions & 0 deletions x11-misc/virtualgl/files/virtualgl-3.1-drop-register.patch
@@ -0,0 +1,53 @@
https://github.com/VirtualGL/virtualgl/pull/233
From: Brahmajit Das <brahmajit.xyz@gmail.com>
Date: Thu, 1 Jun 2023 14:45:17 +0530
Subject: [PATCH] Dropping use of register keyword

The usage of register keyword was deprecated in c++14 and it's
completely removed in c++17. Found will building virtualgl on gentoo
with clang-16.

Bug: https://bugs.gentoo.org/898876
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
--- a/server/fltk/src/Fl_Text_Buffer.cxx
+++ b/server/fltk/src/Fl_Text_Buffer.cxx
@@ -1286,7 +1286,7 @@ int Fl_Text_Buffer::substitute_null_characters( char *string, int len ) {
** routine if no substitution has been done.
*/
void Fl_Text_Buffer::unsubstitute_null_characters( char *string ) {
- register char * c, subsChar = mNullSubsChar;
+ char * c, subsChar = mNullSubsChar;

if ( subsChar == '\0' )
return;
--- a/server/fltk/src/Fl_arg.cxx
+++ b/server/fltk/src/Fl_arg.cxx
@@ -314,7 +314,7 @@ without express or implied warranty.

static int ReadInteger(char* string, char** NextString)
{
- register int Result = 0;
+ int Result = 0;
int Sign = 1;

if (*string == '+')
@@ -337,7 +337,7 @@ int XParseGeometry(const char* string, int* x, int* y,
unsigned int* width, unsigned int* height)
{
int mask = NoValue;
- register char *strind;
+ char *strind;
unsigned int tempWidth = 0, tempHeight = 0;
int tempX = 0, tempY = 0;
char *nextCharacter;
--- a/util/md5.c
+++ b/util/md5.c
@@ -193,7 +193,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
*/
void MD5Transform(uint32 buf[4], uint32 in[16])
{
- register uint32 a, b, c, d;
+ uint32 a, b, c, d;

a = buf[0];
b = buf[1];
101 changes: 101 additions & 0 deletions x11-misc/virtualgl/virtualgl-3.1-r1.ebuild
@@ -0,0 +1,101 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake-multilib flag-o-matic 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 ~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=""

RDEPEND="
media-libs/libjpeg-turbo[${MULTILIB_USEDEP}]
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
x11-libs/libXtst[${MULTILIB_USEDEP}]
x11-libs/libXv[${MULTILIB_USEDEP}]
x11-libs/xcb-util-keysyms[${MULTILIB_USEDEP}]
virtual/glu[${MULTILIB_USEDEP}]
virtual/opencl[${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/libXtst-1.2.3[abi_x86_32]
>=x11-libs/libXv-1.0.10[abi_x86_32]
x11-libs/xcb-util-keysyms[abi_x86_32]
>=virtual/glu-9.0-r1[abi_x86_32]
virtual/opencl[abi_x86_32]
>=virtual/opengl-7.0-r1[abi_x86_32]
) )
"
DEPEND="${RDEPEND}"

PATCHES=(
"${FILESDIR}"/${PN}-3.1-drop-register.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_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=(
-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/"${PF}"
-DTJPEG_INCLUDE_DIR=/usr/include
-DCMAKE_INSTALL_LIBDIR=/usr/$(get_libdir)/VirtualGL
-DTJPEG_LIBRARY=/usr/$(get_libdir)/libturbojpeg.so
-DCMAKE_LIBRARY_PATH=/usr/$(get_libdir)
)
cmake_src_configure
}
multilib_parallel_foreach_abi abi_configure
}

src_install() {
cmake-multilib_src_install

# Make config dir
keepdir /var/lib/VirtualGL
fowners root:video /var/lib/VirtualGL
fperms 0750 /var/lib/VirtualGL
newinitd "${FILESDIR}/vgl.initd-r4" 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
# and eglinfo to veglinto because of conflict with mesa-progs[egl]
mv "${D}"/usr/bin/{,v}glxinfo || die
mv "${D}"/usr/bin/{,v}eglinfo || die

# Remove license files, bug 536284
rm "${D}"/usr/share/doc/${PF}/{LGPL.txt*,LICENSE*} || die
}

0 comments on commit 37cade6

Please sign in to comment.