From owner-svn-ports-head@freebsd.org Wed Jun 28 11:19:35 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF104D9F508; Wed, 28 Jun 2017 11:19:35 +0000 (UTC) (envelope-from martymac@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82E3C74D17; Wed, 28 Jun 2017 11:19:35 +0000 (UTC) (envelope-from martymac@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5SBJY4A067818; Wed, 28 Jun 2017 11:19:34 GMT (envelope-from martymac@FreeBSD.org) Received: (from martymac@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5SBJYG4067816; Wed, 28 Jun 2017 11:19:34 GMT (envelope-from martymac@FreeBSD.org) Message-Id: <201706281119.v5SBJYG4067816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: martymac set sender to martymac@FreeBSD.org using -f From: Ganael LAPLANCHE Date: Wed, 28 Jun 2017 11:19:34 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r444567 - in head/emulators/dolphin-emu: . files X-SVN-Group: ports-head X-SVN-Commit-Author: martymac X-SVN-Commit-Paths: in head/emulators/dolphin-emu: . files X-SVN-Commit-Revision: 444567 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 11:19:35 -0000 Author: martymac Date: Wed Jun 28 11:19:34 2017 New Revision: 444567 URL: https://svnweb.freebsd.org/changeset/ports/444567 Log: Backport c5b3b52d553d: enable libusb hotplug on FreeBSD 11+ PR: 220223 Submitted by: jbeich Modified: head/emulators/dolphin-emu/Makefile head/emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp Modified: head/emulators/dolphin-emu/Makefile ============================================================================== --- head/emulators/dolphin-emu/Makefile Wed Jun 28 11:06:54 2017 (r444566) +++ head/emulators/dolphin-emu/Makefile Wed Jun 28 11:19:34 2017 (r444567) @@ -3,7 +3,7 @@ PORTNAME= dolphin-emu PORTVERSION= 5.0 -PORTREVISION= 7 +PORTREVISION= 8 CATEGORIES= emulators MAINTAINER= martymac@FreeBSD.org Modified: head/emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp ============================================================================== --- head/emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp Wed Jun 28 11:06:54 2017 (r444566) +++ head/emulators/dolphin-emu/files/patch-Source-Core-InputCommon-GCAdapter.cpp Wed Jun 28 11:19:34 2017 (r444567) @@ -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 +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 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)