Bug 252371 - devel/sdl20: update to 2.0.14 and refactoring options
Summary: devel/sdl20: update to 2.0.14 and refactoring options
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Marakasov
URL: https://discourse.libsdl.org/t/sdl-2-...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-03 07:03 UTC by VVD
Modified: 2021-01-07 13:33 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (amdmi3)


Attachments
update to 2.0.14, add EVDEV option (5.59 KB, patch)
2021-01-03 07:03 UTC, VVD
no flags Details | Diff
update to 2.0.14, refactoring of the options (11.35 KB, patch)
2021-01-03 16:03 UTC, VVD
no flags Details | Diff
update to 2.0.14 and refactoring of the options (13.15 KB, patch)
2021-01-03 18:09 UTC, VVD
vvd: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description VVD 2021-01-03 07:03:21 UTC
Created attachment 221227 [details]
update to 2.0.14, add EVDEV option

Tested on 12.2 amd64: build, install, check-plist.

https://www.libsdl.org/download-2.0.php
---------------------------------------------------------------------------
2.0.14:
---------------------------------------------------------------------------
General:
* Added support for PS5 DualSense and Xbox Series X controllers to the HIDAPI controller driver
* Added game controller button constants for paddles and new buttons
* Added game controller functions to get additional information:
	* SDL_GameControllerGetSerial()
	* SDL_GameControllerHasAxis()
	* SDL_GameControllerHasButton()
	* SDL_GameControllerGetNumTouchpads()
	* SDL_GameControllerGetNumTouchpadFingers()
	* SDL_GameControllerGetTouchpadFinger()
	* SDL_GameControllerHasSensor()
	* SDL_GameControllerSetSensorEnabled()
	* SDL_GameControllerIsSensorEnabled()
	* SDL_GameControllerGetSensorData()
	* SDL_GameControllerRumbleTriggers()
	* SDL_GameControllerHasLED()
	* SDL_GameControllerSetLED()
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_PS5 to control whether the HIDAPI driver for PS5 controllers should be used.
* Added joystick functions to get additional information:
	* SDL_JoystickGetSerial()
	* SDL_JoystickRumbleTriggers()
	* SDL_JoystickHasLED()
	* SDL_JoystickSetLED()
* Added an API to allow the application to create virtual joysticks:
	* SDL_JoystickAttachVirtual()
	* SDL_JoystickDetachVirtual()
	* SDL_JoystickIsVirtual()
	* SDL_JoystickSetVirtualAxis()
	* SDL_JoystickSetVirtualButton()
	* SDL_JoystickSetVirtualHat()
* Added SDL_LockSensors() and SDL_UnlockSensors() to guarantee exclusive access to the sensor list
* Added SDL_HAPTIC_STEERING_AXIS to play an effect on the steering wheel
* Added the hint SDL_HINT_MOUSE_RELATIVE_SCALING to control whether relative motion is scaled by the screen DPI or renderer logical size
* The default value for SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS is now false for better compatibility with modern window managers
* Added SDL_GetPreferredLocales() to get the application's current locale setting
* Added the hint SDL_HINT_PREFERRED_LOCALES to override your application's default locale setting
* Added SDL_OpenURL() to open a URL in the system's default browser
* Added SDL_HasSurfaceRLE() to tell whether a surface is currently using RLE encoding
* Added SDL_SIMDRealloc() to reallocate memory obtained from SDL_SIMDAlloc()
* Added SDL_GetErrorMsg() to get the last error in a thread-safe way
* Added SDL_crc32(), SDL_wcscasecmp(), SDL_wcsncasecmp(), SDL_trunc(), SDL_truncf()
* Added clearer names for RGB pixel formats, e.g. SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, etc.

Windows:
* Added the RAWINPUT controller driver to support more than 4 Xbox controllers simultaneously
* Added the hint SDL_HINT_JOYSTICK_RAWINPUT to control whether the RAWINPUT driver should be used
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT to control whether XInput and WGI should be used to for complete controller functionality with the RAWINPUT driver.

macOS:
* Added the SDL_WINDOW_METAL flag to specify that a window should be created with a Metal view
* Added SDL_Metal_GetLayer() to get the CAMetalLayer backing a Metal view
* Added SDL_Metal_GetDrawableSize() to get the size of a window's drawable, in pixels

Linux:
* Added the hint SDL_HINT_AUDIO_DEVICE_APP_NAME to specify the name that shows up in PulseAudio for your application
* Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_NAME to specify the name that shows up in PulseAudio associated with your audio stream
* Added the hint SDL_HINT_LINUX_JOYSTICK_DEADZONES to control whether HID defined dead zones should be respected on Linux
* Added the hint SDL_HINT_THREAD_PRIORITY_POLICY to specify the thread scheduler policy
* Added the hint SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL to allow time critical threads to use a realtime scheduling policy

Android:
* Added SDL_AndroidRequestPermission() to request a specific system permission
* Added the hint SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO to control whether audio will pause when the application goes intot he background

OS/2:
* Added support for OS/2, see docs/README-os2.md for details

Emscripten (running in a web browser):
* Added the hint SDL_HINT_EMSCRIPTEN_ASYNCIFY to control whether SDL should call emscripten_sleep internally
Comment 1 Alex S 2021-01-03 13:45:36 UTC
> EVDEV_CONFIGURE_ENABLE=		events

I don't think evdev has a direct relation to the SDL's events subsystem.
Comment 2 VVD 2021-01-03 14:41:50 UTC
(In reply to Alex S from comment #1)
I found in configure file this:
            freebsd)
                if test x$use_input_events = xyes; then
            
$as_echo "#define SDL_JOYSTICK_LINUX 1" >>confdefs.h
            
                    SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
                    SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
                    have_joystick=yes
                fi
            ;;
and this:
        # Set up files for evdev input
        if test x$use_input_events = xyes; then
            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev.c"
            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev_kbd.c"
            SOURCES="$SOURCES $srcdir/src/core/freebsd/SDL_evdev_kbd_freebsd.c"
        fi

But you are right - events is other feature.
I can't find how to avoid picking up evdev if devel/evdev-proto is installed.
Comment 3 VVD 2021-01-03 16:03:06 UTC
Created attachment 221245 [details]
update to 2.0.14, refactoring of the options

I did big refactoring of the options and didn't add EVDEV.
Comment 4 Alex S 2021-01-03 16:26:58 UTC
(In reply to VVD from comment #2)

> I can't find how to avoid picking up evdev if devel/evdev-proto is installed.

This is not configurable. It's generally in our best interest to fix possible evdev issues, rather than work around them, so I don't think it should configurable either.

My aim with making this an option in bug 249874 was giving users some way of avoiding the situation where a gamepad gets picked by both backends, which might be quite confusing (in case they produce different button mappings or whatever). It's not clear whether this will be a problem in practice. It's possible to implement this as a runtime switch if necessary. Or maybe we should eventually just disable the uhid backend, it going to be redundant once iichid is merged (https://reviews.freebsd.org/D27777).

I'd like to see the port's maintainer opinion on the matter.
Comment 5 VVD 2021-01-03 18:09:17 UTC
Created attachment 221249 [details]
update to 2.0.14 and refactoring of the options

More refactoring.

Check, please.
Comment 6 Greg V 2021-01-07 13:33:35 UTC
Works for me, evdev gamepad is picked up fine :) (Unlike some previous evdev patches)