From f250b006b1575ff3da6f039c709042ff38a3f80d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 7 Sep 2023 13:12:43 +1000 Subject: [PATCH] CI: Disable MFI joystick for SDL on MacOS --- .../scripts/macos/build-dependencies.sh | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/macos/build-dependencies.sh b/.github/workflows/scripts/macos/build-dependencies.sh index c212ce68aa..6498bcbd39 100755 --- a/.github/workflows/scripts/macos/build-dependencies.sh +++ b/.github/workflows/scripts/macos/build-dependencies.sh @@ -48,9 +48,27 @@ shasum -a 256 --check SHASUMS echo "Installing SDL..." tar xf "$SDL.tar.gz" cd "$SDL" -./configure --prefix "$INSTALLDIR" --without-x -make "-j$NPROCS" -make install + +# MFI causes multiple joystick connection events, I'm guessing because both the HIDAPI and MFI interfaces +# race each other, and sometimes both end up getting through. So, just force MFI off. +patch -u CMakeLists.txt < + #import + int main() { return 0; }" HAVE_FRAMEWORK_COREHAPTICS) +- if(HAVE_FRAMEWORK_GAMECONTROLLER AND HAVE_FRAMEWORK_COREHAPTICS) ++ if(HAVE_FRAMEWORK_GAMECONTROLLER AND HAVE_FRAMEWORK_COREHAPTICS AND FALSE) + # Only enable MFI if we also have CoreHaptics to ensure rumble works + set(SDL_JOYSTICK_MFI 1) + set(SDL_FRAMEWORK_GAMECONTROLLER 1) + +EOF + +cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DSDL_X11=OFF +make -C build "-j$NPROCS" +make -C build install cd .. echo "Installing libpng..."