svn commit: r502969 - in head/games/flightgear: . files
Ganael LAPLANCHE
martymac at FreeBSD.org
Wed May 29 15:45:07 UTC 2019
Author: martymac
Date: Wed May 29 15:45:06 2019
New Revision: 502969
URL: https://svnweb.freebsd.org/changeset/ports/502969
Log:
Re-enable EVENT_INPUT support on 13-CURRENT
Patch has been accepted upstream, see:
https://sourceforge.net/p/flightgear/flightgear/merge-requests/165/
so we use it as a backport, waiting for next Flightgear version.
PR: 237835
Submitted by: Aaron Farias <timido at ubuntu.com>
Added:
head/games/flightgear/files/patch-src-Input-FGLinuxEventInput.cxx (contents, props changed)
Modified:
head/games/flightgear/Makefile
Modified: head/games/flightgear/Makefile
==============================================================================
--- head/games/flightgear/Makefile Wed May 29 15:29:18 2019 (r502968)
+++ head/games/flightgear/Makefile Wed May 29 15:45:06 2019 (r502969)
@@ -3,7 +3,7 @@
PORTNAME= flightgear
PORTVERSION= 2018.3.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= games
MASTER_SITES= SF/flightgear/release-${PORTVERSION:R}
@@ -22,7 +22,8 @@ LIB_DEPENDS= libpng.so:graphics/png \
libcurl.so:ftp/curl \
libudev.so:devel/libudev-devd
BUILD_DEPENDS= ${LOCALBASE}/lib/libplibsl.a:x11-toolkits/plib \
- ${LOCALBASE}/lib/libSimGearCore.a:devel/simgear
+ ${LOCALBASE}/lib/libSimGearCore.a:devel/simgear \
+ ${LOCALBASE}/include/linux/input.h:devel/evdev-proto
RUN_DEPENDS= ${LOCALBASE}/lib/libplibsl.a:x11-toolkits/plib \
${LOCALBASE}/lib/libSimGearCore.a:devel/simgear \
${LOCALBASE}/share/flightgear/version:games/flightgear-data
@@ -59,15 +60,4 @@ post-patch:
@${REINPLACE_CMD} -Ei .c++20 '/file|set_prop/s/version[[:>:]]/&.txt/' \
${WRKSRC}/CMakeLists.txt
-.include <bsd.port.pre.mk>
-
-# XXX Disable EVENT_INPUT on 13-CURRENT to avoid crashing during startup
-# See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237835
-# and: https://svnweb.freebsd.org/base?view=revision&revision=340387
-.if ${OSVERSION} >= 1300003
-CMAKE_ARGS+= -DEVENT_INPUT:BOOL=OFF
-.else
-BUILD_DEPENDS+= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Added: head/games/flightgear/files/patch-src-Input-FGLinuxEventInput.cxx
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/flightgear/files/patch-src-Input-FGLinuxEventInput.cxx Wed May 29 15:45:06 2019 (r502969)
@@ -0,0 +1,29 @@
+Avoid crashing when udev_device_get_parent() returns a NULL pointer
+
+Backport from commit 66e6afb
+
+--- src/Input/FGLinuxEventInput.cxx.orig
++++ src/Input/FGLinuxEventInput.cxx
+@@ -481,13 +481,15 @@ void FGLinuxEventInput::postinit()
+ struct udev_device *dev = udev_device_new_from_syspath(udev, path);
+ const char * node = udev_device_get_devnode(dev);
+
+- dev = udev_device_get_parent( dev );
+- const char * name = udev_device_get_sysattr_value(dev,"name");
+- const char * serial = udev_device_get_sysattr_value(dev, "serial");
+- SG_LOG(SG_INPUT,SG_DEBUG, "name=" << (name?name:"<null>") << ", node=" << (node?node:"<null>"));
+- if( name && node ) {
+- std::string serialString = serial ? serial : std::string{};
+- AddDevice( new FGLinuxInputDevice(name, node, serialString) );
++ struct udev_device * parent_dev = udev_device_get_parent( dev );
++ if ( parent_dev != NULL ) {
++ const char * name = udev_device_get_sysattr_value(parent_dev,"name");
++ const char * serial = udev_device_get_sysattr_value(parent_dev, "serial");
++ SG_LOG(SG_INPUT,SG_DEBUG, "name=" << (name?name:"<null>") << ", node=" << (node?node:"<null>"));
++ if( name && node ) {
++ std::string serialString = serial ? serial : std::string{};
++ AddDevice( new FGLinuxInputDevice(name, node, serialString) );
++ }
+ }
+
+ udev_device_unref(dev);
More information about the svn-ports-all
mailing list