diff --git a/games/flightgear/Makefile b/games/flightgear/Makefile index 5a0068fb1d08..f955cf419c59 100644 --- a/games/flightgear/Makefile +++ b/games/flightgear/Makefile @@ -1,66 +1,67 @@ PORTNAME= flightgear PORTVERSION= 2020.3.18 +PORTREVISION= 1 CATEGORIES= games MASTER_SITES= SF/flightgear/release-${PORTVERSION:R} MAINTAINER= martymac@FreeBSD.org COMMENT= FlightGear flight simulator WWW= https://www.flightgear.org/ LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libpng.so:graphics/png \ libboost_thread.so:devel/boost-libs \ libfltk.so:x11-toolkits/fltk \ libfreetype.so:print/freetype2 \ libosg.so:graphics/osg \ libspeex.so:audio/speex \ libspeexdsp.so:audio/speexdsp \ libcurl.so:ftp/curl \ libudev.so:devel/libudev-devd \ libexpat.so:textproc/expat2 \ libSimGearCore.so:devel/simgear BUILD_DEPENDS= ${LOCALBASE}/lib/libplibsl.a:x11-toolkits/plib \ ${LOCALBASE}/include/linux/input.h:devel/evdev-proto \ ${LOCALBASE}/share/flightgear/version:games/flightgear-data RUN_DEPENDS= ${LOCALBASE}/lib/libplibsl.a:x11-toolkits/plib \ ${LOCALBASE}/share/flightgear/version:games/flightgear-data # Disable ninja, see https://sourceforge.net/p/flightgear/codetickets/2118/ USES= alias cmake:noninja compiler:c++11-lang cpe dos2unix gl jpeg \ openal:al,alut sqlite tar:bzip2 xorg USE_XORG= ice sm x11 xext xft xi xinerama xmu xt USE_GL= gl glew glu glut DOS2UNIX_REGEX= .*\.(c|h|cxx|cpp|hxx|hpp) CMAKE_ARGS+= -DSYSTEM_SQLITE:BOOL=ON \ -DENABLE_HID_INPUT:BOOL=OFF \ -DFG_DATA_DIR:PATH=${LOCALBASE}/share/${PORTNAME} \ -DCMAKE_INSTALL_MANDIR:PATH=${MANPREFIX}/man \ -DFGCOM_DATA_PATH:PATH=${DATADIR} LDFLAGS+= -L${LOCALBASE}/lib LDFLAGS_i386= -Wl,-znotext OPTIONS_DEFINE= DBUS QT5 OPTIONS_DEFAULT= DBUS QT5 DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DBUS_USES= pkgconfig DBUS_CMAKE_ON= -DUSE_DBUS:BOOL=ON DBUS_CMAKE_OFF= -DUSE_DBUS:BOOL=OFF QT5_CMAKE_ON= -DENABLE_QT:BOOL=ON QT5_CMAKE_OFF= -DENABLE_QT:BOOL=OFF QT5_USES= qt:5 QT5_USE= QT=core,buildtools,linguisttools,gui,declarative,network,qmake,widgets,svg post-patch: # Avoid conflict with C++20 - used version file is flightgear-version @${RM} ${WRKSRC}/version .include .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150 LDFLAGS_i386+= -Wl,--no-check-dynamic-relocations .endif .include diff --git a/games/flightgear/files/patch-3rdparty-joystick-jsBSD.cxx b/games/flightgear/files/patch-3rdparty-joystick-jsBSD.cxx index 115d2bd2db8b..299a4933f9c7 100644 --- a/games/flightgear/files/patch-3rdparty-joystick-jsBSD.cxx +++ b/games/flightgear/files/patch-3rdparty-joystick-jsBSD.cxx @@ -1,10 +1,85 @@ ---- 3rdparty/joystick/jsBSD.cxx.orig 2020-05-28 21:56:43 UTC +--- 3rdparty/joystick/jsBSD.cxx.orig 2023-04-07 17:57:15 UTC +++ 3rdparty/joystick/jsBSD.cxx @@ -52,6 +52,7 @@ #include #include +#include #include #include #include +@@ -198,6 +199,8 @@ static int joy_initialize_hid(struct os_specific_s *os + interesting_hid = TRUE; + if (page == HUP_GENERIC_DESKTOP) + { ++ int range; ++ int matched; + switch(usage) { + case HUG_X: + case HUG_RX: +@@ -221,6 +224,65 @@ static int joy_initialize_hid(struct os_specific_s *os + (*num_axes)++; + os->axes_usage[*num_axes] = usage; + (*num_axes)++; ++ } ++ range = h.logical_maximum - h.logical_minimum + 1; ++ matched = 0; ++ if (((h.logical_minimum == 0) || (h.logical_minimum == 1)) && (h.unit == HUM_DEGREE) && (h.unit_exponent == 0) && ((range == 4) || (range == 8))) { ++ int resolution = (h.physical_maximum - h.physical_minimum) / (h.logical_maximum - h.logical_minimum); ++ for (int i = h.logical_minimum; i <= h.logical_maximum; i++) { ++ const int degrees = (i - h.logical_minimum) * resolution + h.physical_minimum; ++ switch (degrees) { ++ case 0: ++ hatmap_x[i] = 0; ++ hatmap_y[i] = -1; ++ matched++; ++ break; ++ case 45: ++ hatmap_x[i] = 1; ++ hatmap_y[i] = -1; ++ matched++; ++ break; ++ case 90: ++ hatmap_x[i] = 1; ++ hatmap_y[i] = 0; ++ matched++; ++ break; ++ case 135: ++ hatmap_x[i] = 1; ++ hatmap_y[i] = 1; ++ matched++; ++ break; ++ case 180: ++ hatmap_x[i] = 0; ++ hatmap_y[i] = 1; ++ matched++; ++ break; ++ case 225: ++ hatmap_x[i] = -1; ++ hatmap_y[i] = 1; ++ matched++; ++ break; ++ case 270: ++ hatmap_x[i] = -1; ++ hatmap_y[i] = 0; ++ matched++; ++ break; ++ case 315: ++ hatmap_x[i] = -1; ++ hatmap_y[i] = -1; ++ matched++; ++ break; ++ } ++ } ++ if (matched == range) { ++ if (h.logical_minimum == 0) { ++ hatmap_x[h.logical_maximum + 1] = 0; ++ hatmap_y[h.logical_maximum + 1] = 0; ++ } else { ++ hatmap_x[0] = 0; ++ hatmap_y[0] = 0; ++ } ++ } + } + break; + default: