diff -ur godot-tools/work/godot-4.2.1-stable/platform/linuxbsd/detect.py godot-tools.patch/work/godot-4.2.1-stable/platform/linuxbsd/detect.py
--- godot-tools/work/godot-4.2.1-stable/platform/linuxbsd/detect.py 2023-12-11 22:14:04.000000000 +0100
+++ godot-tools.patch/work/godot-4.2.1-stable/platform/linuxbsd/detect.py 2025-02-14 19:37:33.532681000 +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 -ur godot-tools/work/godot-4.2.1-stable/platform/linuxbsd/libudev-so_wrap.c godot-tools.patch/work/godot-4.2.1-stable/platform/linuxbsd/libudev-so_wrap.c
--- godot-tools/work/godot-4.2.1-stable/platform/linuxbsd/libudev-so_wrap.c 2023-12-11 22:14:04.000000000 +0100
+++ godot-tools.patch/work/godot-4.2.1-stable/platform/linuxbsd/libudev-so_wrap.c 2025-02-14 19:37:42.116512000 +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 -ur godot-tools/work/godot-4.2.1-stable/thirdparty/linuxbsd_headers/udev/libudev.h godot-tools.patch/work/godot-4.2.1-stable/thirdparty/linuxbsd_headers/udev/libudev.h
--- godot-tools/work/godot-4.2.1-stable/thirdparty/linuxbsd_headers/udev/libudev.h 2023-12-11 22:14:04.000000000 +0100
+++ godot-tools.patch/work/godot-4.2.1-stable/thirdparty/linuxbsd_headers/udev/libudev.h 2025-02-14 19:38:07.248390000 +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