aboutsummaryrefslogtreecommitdiffstats
path: root/emulators
diff options
context:
space:
mode:
authormartymac <martymac@FreeBSD.org>2017-06-28 19:19:34 +0800
committermartymac <martymac@FreeBSD.org>2017-06-28 19:19:34 +0800
commit1e63322609e62a7acb0b7a539df5a5efc3a7fe50 (patch)
tree99bce5c394a5e77e4587c46202d891cde2b35ca6 /emulators
parent175a80f217dfa4d45f3b13bca7145a8e6edf255e (diff)
downloadfreebsd-ports-gnome-1e63322609e62a7acb0b7a539df5a5efc3a7fe50.tar.gz
freebsd-ports-gnome-1e63322609e62a7acb0b7a539df5a5efc3a7fe50.tar.zst
freebsd-ports-gnome-1e63322609e62a7acb0b7a539df5a5efc3a7fe50.zip
Backport c5b3b52d553d: enable libusb hotplug on FreeBSD 11+
PR: 220223 Submitted by: jbeich
Diffstat (limited to 'emulators')
-rw-r--r--emulators/dolphin-emu/Makefile2
-rw-r--r--emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp51
2 files changed, 24 insertions, 29 deletions
diff --git a/emulators/dolphin-emu/Makefile b/emulators/dolphin-emu/Makefile
index b8e3320081fe..8180a1f260ea 100644
--- a/emulators/dolphin-emu/Makefile
+++ b/emulators/dolphin-emu/Makefile
@@ -3,7 +3,7 @@
PORTNAME= dolphin-emu
PORTVERSION= 5.0
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= emulators
MAINTAINER= martymac@FreeBSD.org
diff --git a/emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp b/emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp
index 3e8a547f8964..dec5a7f29699 100644
--- a/emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp
+++ b/emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp
@@ -1,38 +1,33 @@
---- Source/Core/InputCommon/GCAdapter.cpp.orig 2016-12-01 10:27:29.504018310 +0000
-+++ Source/Core/InputCommon/GCAdapter.cpp 2016-12-01 10:30:44.024005984 +0000
-@@ -50,7 +50,7 @@
+commit c5b3b52d553d
+Author: Jeffrey Pfau <jeffrey@endrift.com>
+Date: Mon Dec 26 22:50:36 2016 -0800
+
+ InputCommon: Fix FreeBSD 11 libusb incompatibilities
+---
+ Source/Core/InputCommon/GCAdapter.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- Source/Core/InputCommon/GCAdapter.cpp.orig 2016-06-24 08:09:07 UTC
++++ Source/Core/InputCommon/GCAdapter.cpp
+@@ -49,7 +49,11 @@ static std::function<void(void)> s_detect_callback;
+
static bool s_libusb_driver_not_supported = false;
static libusb_context* s_libusb_context = nullptr;
++#if defined(__FreeBSD__) && __FreeBSD__ >= 11
++static bool s_libusb_hotplug_enabled = true;
++#else
static bool s_libusb_hotplug_enabled = false;
--#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
-+#if !defined(__FreeBSD__) && defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
++#endif
+ #if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
static libusb_hotplug_callback_handle s_hotplug_handle;
#endif
-
-@@ -76,7 +76,7 @@
- }
- }
-
--#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
-+#if !defined(__FreeBSD__) && defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
- static int HotplugCallback(libusb_context* ctx, libusb_device* dev, libusb_hotplug_event event, void* user_data)
- {
- if (event == LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED)
-@@ -101,7 +101,7 @@
- Common::SetCurrentThreadName("GC Adapter Scanning Thread");
+@@ -102,7 +106,9 @@ static void ScanThreadFunc()
NOTICE_LOG(SERIALINTERFACE, "GC Adapter scanning thread started");
--#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
-+#if !defined(__FreeBSD__) && defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
+ #if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
++#ifndef __FreeBSD__
s_libusb_hotplug_enabled = libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) != 0;
++#endif
if (s_libusb_hotplug_enabled)
{
-@@ -321,7 +321,7 @@
- void Shutdown()
- {
- StopScanThread();
--#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
-+#if !defined(__FreeBSD__) && defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
- if (s_libusb_hotplug_enabled)
- libusb_hotplug_deregister_callback(s_libusb_context, s_hotplug_handle);
- #endif
+ if (libusb_hotplug_register_callback(s_libusb_context, (libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT), LIBUSB_HOTPLUG_ENUMERATE, 0x057e, 0x0337, LIBUSB_HOTPLUG_MATCH_ANY, HotplugCallback, nullptr, &s_hotplug_handle) != LIBUSB_SUCCESS)