git: 3d9903862da8 - main - devel/godot-tools: fix joystick driver code

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Thu, 20 Feb 2025 23:28:13 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3d9903862da8e530ebbc38840e23867c91e4c08f

commit 3d9903862da8e530ebbc38840e23867c91e4c08f
Author:     Chédotal Julien <rjdi@wanadoo.fr>
AuthorDate: 2025-02-19 15:17:08 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-02-20 23:27:26 +0000

    devel/godot-tools: fix joystick driver code
    
    Approved by:    FreeBSD@ShaneWare.Biz
    PR:             284869
    MFH:            2025Q1
---
 devel/godot-tools/Makefile                                    |  1 +
 devel/godot-tools/files/patch-platform_linuxbsd_detect.py     | 11 +++++++++++
 .../files/patch-platform_linuxbsd_libudev-so__wrap.c          | 11 +++++++++++
 .../files/patch-thirdparty_linuxbsd_headers_udev_libudev.h    | 11 +++++++++++
 4 files changed, 34 insertions(+)

diff --git a/devel/godot-tools/Makefile b/devel/godot-tools/Makefile
index 43e64dd72d98..4d46aa2a5fcb 100644
--- a/devel/godot-tools/Makefile
+++ b/devel/godot-tools/Makefile
@@ -1,4 +1,5 @@
 PKGNAMESUFFIX=	-tools
+PORTREVISION=	3
 
 COMMENT=	Game integrated development environment
 
diff --git a/devel/godot-tools/files/patch-platform_linuxbsd_detect.py b/devel/godot-tools/files/patch-platform_linuxbsd_detect.py
new file mode 100644
index 000000000000..ab0cb61205cb
--- /dev/null
+++ b/devel/godot-tools/files/patch-platform_linuxbsd_detect.py
@@ -0,0 +1,11 @@
+--- platform/linuxbsd/detect.py.orig	2025-02-19 15:17:58.330499000 +0100
++++ platform/linuxbsd/detect.py	2025-02-19 15:20:19.837955000 +0100
+@@ -370,7 +370,7 @@
+     else:
+         env.Append(CPPDEFINES=["XKB_ENABLED"])
+ 
+-    if platform.system() == "Linux":
++    if platform.system() in  ["Linux","FreeBSD"]:
+         env.Append(CPPDEFINES=["JOYDEV_ENABLED"])
+         if env["udev"]:
+             if not env["use_sowrap"]:
diff --git a/devel/godot-tools/files/patch-platform_linuxbsd_libudev-so__wrap.c b/devel/godot-tools/files/patch-platform_linuxbsd_libudev-so__wrap.c
new file mode 100644
index 000000000000..1becd49b36cc
--- /dev/null
+++ b/devel/godot-tools/files/patch-platform_linuxbsd_libudev-so__wrap.c
@@ -0,0 +1,11 @@
+--- platform/linuxbsd/libudev-so_wrap.c.orig	2025-02-19 15:17:47.002070000 +0100
++++ platform/linuxbsd/libudev-so_wrap.c	2025-02-19 15:19:37.278257000 +0100
+@@ -281,7 +281,7 @@
+ int initialize_libudev(int verbose) {
+   void *handle;
+   char *error;
+-  handle = dlopen("libudev.so.1", RTLD_LAZY);
++  handle = dlopen("libudev.so.0", RTLD_LAZY);
+   if (!handle) {
+     if (verbose) {
+       fprintf(stderr, "%s\n", dlerror());
diff --git a/devel/godot-tools/files/patch-thirdparty_linuxbsd_headers_udev_libudev.h b/devel/godot-tools/files/patch-thirdparty_linuxbsd_headers_udev_libudev.h
new file mode 100644
index 000000000000..7ce8d19a4a13
--- /dev/null
+++ b/devel/godot-tools/files/patch-thirdparty_linuxbsd_headers_udev_libudev.h
@@ -0,0 +1,11 @@
+--- thirdparty/linuxbsd_headers/udev/libudev.h.orig	2025-02-19 15:18:28.842768000 +0100
++++ thirdparty/linuxbsd_headers/udev/libudev.h	2025-02-19 15:18:40.913920000 +0100
+@@ -22,7 +22,7 @@
+ #define _LIBUDEV_H_
+ 
+ #include <stdarg.h>
+-#include <sys/sysmacros.h>
++// #include <sys/sysmacros.h>
+ #include <sys/types.h>
+ 
+ #ifdef __cplusplus