Trying x2goclient in a test build with the libc++ update, it fails:
c++ -c -std=c++03 -pipe -O2 -fno-wrapv -std=c++03 -O2 -fno-wrapv -Wall -W
-pthread -DCFGCLIENT -D__linux__ -DQT_NO_Dang -I.
-I../../../../local/include/X11/qt4/QtCore
-I../../../../local/include/X11/qt4/QtNetwork -I../../../../local/iclude -I.
-I. -I/usr/local/include -o sharewidget.o src/sharewidget.cpp
In file included from src/sharewidget.cpp:18:
In file included from src/sharewidget.h:21:
In file included from src/configwidget.h:21:
In file included from ../../../../local/include/X11/qt4/QtGui/QFrame:1:
In file included from ../../../../local/include/X11/qt4/QtGui/qframe.h:45:
In file included from ../../../../local/include/X11/qt4/QtGui/qwidget.h:46:
In file included from ../../../../local/include/X11/qt4/QtGui/qwindowdefs.h:45:
In file included from ../../../../local/include/X11/qt4/QtCore/qobjectdefs.h:45:
In file included from ../../../../local/include/X11/qt4/QtCore/qnamespace.h:45:
In file included from ../../../../local/include/X11/qt4/QtCore/qglobal.h:45:
In file included from /usr/include/c++/v1/stddef.h:40:
/usr/include/c++/v1/__config:186:10: fatal error: 'features.h' file not found
#include <features.h>
^~~~~~~~~~~~
1 error generated.
And indeed /usr/include/c++/v1/__config has this:
: // Need to detect which libc we're using if we're on Linux.
: #if defined(__linux__)
: #include <features.h>
: #if !defined(__GLIBC_PREREQ)
: #define __GLIBC_PREREQ(a, b) 0
: #endif // !defined(__GLIBC_PREREQ)
: #endif // defined(__linux__)
In x2goclient release notes, it talks about setting __linux__ in order
to get translated by moc to Q_OS_LINUX which is used across the source:
[ Oleksandr Shneyder ]
* New upstream version (3.99.3.0):
- Add settings for direct RDP connection.
- Implement direct RDP connection using standalone client.
- Build direct RDP feature only for linux.
- Add DEFINES += __linux__ to project file when building linux binaries
(need to define Q_OS_LINUX in moc generator).
[..]
But the port hacks those into Q_OS_UNIX instead:
do-configure:
find ${WRKSRC} -type f -iname "*.cpp" -exec \
perl -pi -e 's,Q_OS_LINUX,Q_OS_UNIX,g;' \
-e 's,#include <linux/fs.h>,,g;' {} \;
find ${WRKSRC} -type f -iname "*.h" -exec \
perl -pi -e 's,Q_OS_LINUX,Q_OS_UNIX,g;' \
-e 's,#include <linux/fs.h>,,g;' {} \;
So it seems like setting __linux__ here probably isn't needed.
With the following diff it builds with both old+new libc++ but I have
no idea how to test. It claims to support RDP but that doesn't seem to
work in the in-tree version and I have no idea about NX.
Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/x2goclient/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- Makefile 26 Jun 2018 16:56:50 -0000 1.7
+++ Makefile 10 Sep 2018 12:50:59 -0000
@@ -3,6 +3,7 @@
COMMENT = Qt4 client for the X2Go system
DISTNAME = x2goclient-4.1.2.1
+REVISION = 0
CATEGORIES = x11
Index: patches/patch-x2goclient_pro
===================================================================
RCS file: /cvs/ports/x11/x2goclient/patches/patch-x2goclient_pro,v
retrieving revision 1.3
diff -u -p -r1.3 patch-x2goclient_pro
--- patches/patch-x2goclient_pro 26 Jun 2018 16:56:50 -0000 1.3
+++ patches/patch-x2goclient_pro 10 Sep 2018 12:50:59 -0000
@@ -11,15 +11,14 @@ Index: x2goclient.pro
RESOURCES += res/resources.qrc
exists(res/txt/git-info) {
-@@ -187,6 +187,11 @@ linux-g++ {
- DEFINES += __linux__
- }
- linux-g++-64 {
-+ message("building $$TARGET with ldap and cups")
-+ LIBS += -lldap -lcups -lX11 -lXpm
-+ DEFINES += __linux__
-+}
-+openbsd-* {
+@@ -190,6 +190,10 @@ linux-g++-64 {
message("building $$TARGET with ldap and cups")
LIBS += -lldap -lcups -lX11 -lXpm
DEFINES += __linux__
++}
++openbsd-* {
++ message("building $$TARGET with ldap and cups")
++ LIBS += -lldap -lcups -lX11 -lXpm
+ }
+ x2go_linux_static {
+ message("linking all libs statically")