https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252371 CMake Error at CMakeLists.txt:397 (find_package): Could not find a configuration file for package "SDL2" that is compatible with requested version "2.0.16". The following configuration files were considered but not accepted: /usr/local/lib/cmake/SDL2/sdl2-config.cmake, version: 2.0.12 --- CMakeLists.txt.orig 2021-08-14 09:28:59 UTC +++ CMakeLists.txt @@ -398,7 +398,7 @@ if (ENABLE_SDL2) endif() if (NOT YUZU_USE_BUNDLED_SDL2 AND NOT YUZU_USE_EXTERNAL_SDL2) - find_package(SDL2 2.0.16 REQUIRED) + find_package(SDL2 2.0.12 REQUIRED) # Some installations don't set SDL2_LIBRARIES if("${SDL2_LIBRARIES}" STREQUAL "") --- src/input_common/drivers/sdl_driver.cpp.orig 2021-11-27 10:52:08 UTC +++ src/input_common/drivers/sdl_driver.cpp @@ -39,6 +39,7 @@ class SDLJoystick { (public) } void EnableMotion() { +#if SDL_VERSION_ATLEAST(2,0,14) if (sdl_controller) { SDL_GameController* controller = sdl_controller.get(); if (SDL_GameControllerHasSensor(controller, SDL_SENSOR_ACCEL) && !has_accel) { @@ -50,6 +51,7 @@ class SDLJoystick { (public) has_gyro = true; } } +#endif } bool HasGyro() const { @@ -60,6 +62,7 @@ class SDLJoystick { (public) return has_accel; } +#if SDL_VERSION_ATLEAST(2,0,14) bool UpdateMotion(SDL_ControllerSensorEvent event) { constexpr float gravity_constant = 9.80665f; std::lock_guard lock{mutex}; @@ -87,6 +90,7 @@ class SDLJoystick { (public) motion.delta_timestamp = time_difference * 1000; return true; } +#endif BasicMotion GetMotion() { return motion; @@ -362,6 +366,7 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Ev } break; } +#if SDL_VERSION_ATLEAST(2,0,14) case SDL_CONTROLLERSENSORUPDATE: { if (auto joystick = GetSDLJoystickBySDLID(event.csensor.which)) { if (joystick->UpdateMotion(event.csensor)) { @@ -371,6 +376,7 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Ev } break; } +#endif case SDL_JOYDEVICEREMOVED: LOG_DEBUG(Input, "Controller removed with Instance_ID {}", event.jdevice.which); CloseJoystick(SDL_JoystickFromInstanceID(event.jdevice.which)); @@ -392,7 +398,7 @@ SDLDriver::SDLDriver(const std::string& input_engine_) if (!Settings::values.enable_raw_input) { // Disable raw input. When enabled this setting causes SDL to die when a web applet opens - SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, "0"); + SDL_SetHint("SDL_JOYSTICK_RAWINPUT", "0"); } // Prevent SDL from adding undesired axis @@ -400,7 +406,7 @@ SDLDriver::SDLDriver(const std::string& input_engine_) // Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); - SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1"); + SDL_SetHint("SDL_JOYSTICK_HIDAPI_PS5_RUMBLE", "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); // Use hidapi driver for joycons. This will allow joycons to be detected as a GameController and @@ -670,6 +676,7 @@ ButtonBindings SDLDriver::GetNintendoButtonBinding( auto sl_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER; auto sr_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER; +#if SDL_VERSION_ATLEAST(2,0,14) if (joystick->IsJoyconLeft()) { sl_button = SDL_CONTROLLER_BUTTON_PADDLE2; sr_button = SDL_CONTROLLER_BUTTON_PADDLE4; @@ -678,6 +685,7 @@ ButtonBindings SDLDriver::GetNintendoButtonBinding( sl_button = SDL_CONTROLLER_BUTTON_PADDLE3; sr_button = SDL_CONTROLLER_BUTTON_PADDLE1; } +#endif return { std::pair{Settings::NativeButton::A, SDL_CONTROLLER_BUTTON_A},