Summary: | devel/sdl20: update to 2.0.18 and refactoring options | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Vladimir Druzenko <vvd> |
Component: | Individual Port(s) | Assignee: | Dmitry Marakasov <amdmi3> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | 2khramtsov, amdmi3, doctorwhoguy, fuz, jbeich, lwhsu, pi, sdalu, val, xxjack12xx |
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(amdmi3) antoine: exp-run+ |
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any | ||
URL: | https://discourse.libsdl.org/t/sdl-2-0-16-released/28470 | ||
Bug Depends on: | 253850, 260885 | ||
Bug Blocks: | 260749 | ||
Attachments: |
Description
Vladimir Druzenko
![]() ![]() > EVDEV_CONFIGURE_ENABLE= events
I don't think evdev has a direct relation to the SDL's events subsystem.
(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. 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.
(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. Created attachment 221249 [details]
update to 2.0.14 and refactoring of the options
More refactoring.
Check, please.
Works for me, evdev gamepad is picked up fine :) (Unlike some previous evdev patches) Maintainer timeout? maintainer timeout. This is in the works Please split into topic patches. At least separate options refactoring, new options (vulkan) and 2.0.14 update.
> VIDEO_KMSDRM_ENABLE= video-kmsdrm kmsdrm-shared
> VIDEO_OPENGL_ENABLE= video-opengl
These and some others do not seem to be correct.
Created attachment 221746 [details] update to 2.0.14 and refactoring of the options (v4) (In reply to Dmitry Marakasov from comment #10) > Please split into topic patches. At least separate options refactoring, new options (vulkan) and 2.0.14 update. It's a lot of manual work… We can discuss changes in the IRC #bsdports @ EFNet or #freebsd @ Freenode. > These and some others do not seem to be correct. Typo, then copy&paste his typo. Fixed. Created attachment 221747 [details]
update to 2.0.14 and refactoring of the options (v4)
(In reply to VVD from comment #11) > It's a lot of manual work… But it should be done. > We can discuss changes in the IRC #bsdports @ EFNet or #freebsd @ Freenode. I don't see any major problems, it should just not be committed as a single blob. I've had a WIP patch with a similar options refactoring, as least it should be compared to yours to make sure nothing's missing from the final variant. *** Bug 218289 has been marked as a duplicate of this bug. *** Created attachment 221841 [details]
Enable embedded gamecontrollerdb.txt for evdev
GameController API maps various joysticks onto standard gamepad layout, avoiding having to rebind buttons in each game. With evdev-based joystick support FreeBSD can re-use Linux mappings, so users no longer need to define SDL_GAMECONTROLLERCONFIG via environ(7) for popular gamepads.
$ pkg install controllermap
$ testgamecontroller
INFO: Supported mappings:
...
-INFO: Joystick 0: Mega World Thrustmaster dual analog 3.2 Gamepad (guid 030000004f04000015b3000001010000, VID 0x044f, PID 0xb315, player index = -1)
-INFO: There are 0 game controller(s) attached (1 joystick(s))
+INFO: PS3 Controller 0: Thrustmaster Dual Analog 3.2 (guid 030000004f04000015b3000001010000, VID 0x044f, PID 0xb315, player index = 0)
+INFO: There are 1 game controller(s) attached (1 joystick(s))
Submitter timeout; Currently testing dependent ports The patch is ready. I have no time to split it in two. I tested the refactoring patch plus the gamecontrollerdb.txt patch, and it compiled and installed successfully. I also had the HIDAPI option enabled, so once this is committed it can close bug 247863 also. (In reply to VVD from comment #17) What parts need to be split apart? Maybe I can do that work in my spare time. Splitting a patch should be within reach of my skill level. (In reply to VVD from comment #17) I had some time to take a look at splitting the patch. As it turns out, there's a utility already available in ports called splitpatch. There's no need for any manual work whatsoever. Just run "splitpatch sdl20_v4.diff" and it spits out 5 separate patch files ready to go. (In reply to Patrick McMunn from comment #20) There's no need to split it into parts for each file. It needs to be split into topic commits, one which does options refactoring and one with the update. These are indepenent changes and should not be mixed together. Created attachment 227097 [details]
update to 2.0.16 and refactoring of the options (v5)
Tested on 12.2 amd64: make check-plist/build/install/run.
---------------------------------------------------------------------------
2.0.16:
---------------------------------------------------------------------------
General:
* Added SDL_FlashWindow() to get a user's attention
* Added SDL_GetAudioDeviceSpec() to get the preferred audio format of a device
* Added SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window
* Added SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse
* Added SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces
* Added SDL_UpdateNVTexture() to update streaming NV12/21 textures
* Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller
* Added SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers
* Added support for the Amazon Luna game controller
* Added rumble support for the Google Stadia controller using the HIDAPI driver
* Added SDL_GameControllerType constants for the Amazon Luna and Google Stadia controllers
* Added analog rumble for Nintendo Switch Pro controllers using the HIDAPI driver
* Reduced CPU usage when using SDL_WaitEvent() and SDL_WaitEventTimeout()
Windows:
* Added SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages
* Added SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer
Linux:
* Greatly improved Wayland support
* Added support for audio output and capture using Pipewire
* Added the hint SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices
* Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels
Android:
* Added SDL_AndroidShowToast() to show a lightweight notification
iOS:
* Added support for mouse relative mode on iOS 14.1 and newer
* Added support for the Xbox Series X controller
tvOS:
* Added support for the Xbox Series X controller
Thanks for rebase/update. https://github.com/libsdl-org/sdl/commit/9e6fcbe72c35 added dependency on x11-toolkits/libdecor which may need to be tracked as part of VIDEO_WAYLAND or a separate option: $ pkg install libdecor $ make clean configure [...] checking for libdecor support... yes -- dynamic libdecor -> libdecor-0.so.0 [...] /bin/sh ./libtool --tag=CC --mode=compile cc ... -I/usr/local/include/libdecor-0 ... -c .../work/SDL2-2.0.16/src/video/wayland/SDL_waylanddyn.c -o build/SDL_waylanddyn.lo [...] $ strings $(make -V STAGEDIR)$(make -V PREFIX)/lib/libSDL*.so | fgrep decor-0 libdecor-0.so.0 Note, the dependency is build-only (can be enabled by default without burdening binary package users) unless --disable-libdecor-shared is passed to convert dlopen("libdecor-0.so.0") into -ldecor-0 (direct linkage, still dynamic). Created attachment 227643 [details] v5.1 Maybe switch VIDEO_OPENGL_USE= GL=gl to GL=opengl? With global X11=off, libGL does not exist due to X11-related symbols in libGL. New graphics/libglvnd provides libOpenGL without X11 symbols, and is opened by SDL when libGL is not available starting with https://github.com/libsdl-org/SDL/commit/5f7eb88ae + https://github.com/libsdl-org/SDL/commit/9996cecc72 graphics/libglvnd is not optional since https://cgit.freebsd.org/ports/commit/?id=5343f55d87 and related QA was added since https://cgit.freebsd.org/ports/commit/?id=b5a56c9450ee; libOpenGL is not optional, while libGL is. poudriere testport output using vanilla base and ports + v5.1: =>> Checking shared library dependencies 0x0000000000000001 NEEDED Shared library: [libc.so.7] 0x0000000000000001 NEEDED Shared library: [libm.so.5] 0x0000000000000001 NEEDED Shared library: [librt.so.1] 0x0000000000000001 NEEDED Shared library: [libthr.so.3] 0x0000000000000001 NEEDED Shared library: [libusbhid.so.4] v5 patch did not apply cleanly for me; v5.1 applies via "git am" and includes the switch to libOpenGL. Tested on libX11-less desktop via audio/fasttracker2. I'm getting tired of patching to support SDL2-2.0.12 in emulators/yuzu. Let's help devel/sdl20 maintainer by fixing consumers. After exp-run restore Assignee back to amdmi3@ per comment 21. I haven't reviewed the patch myself. attachment.cgi?id=227643:373: trailing whitespace. attachment.cgi?id=227643:381: trailing whitespace. error: patch failed: devel/sdl20/Makefile:1 error: devel/sdl20/Makefile: patch does not apply attachment.cgi?id=227643:381: new blank line at EOF. + error: patch failed: devel/sdl20/files/patch-src_cpuinfo_SDL__cpuinfo.c:1 error: devel/sdl20/files/patch-src_cpuinfo_SDL__cpuinfo.c: patch does not apply Created attachment 228136 [details] v5.2 Fix merge conflict after ports ece0c9bb0. Exp-run looks fine Would be cool to get this in before 2021Q4 is branched off. If not, will this change be MFH'ed? Created attachment 229869 [details]
update to 2.0.18 and refactoring of the options (v6)
Updated to 2.0.18, added options VIDEO_OPENGLES1 and PIPEWARE, removed DLOPEN.
* In the patch a backslash '\' is missing in OPTIONS_DEFINE after the VIDEO_WAYLAND * when building I have the following warning from stage-qa: ====> Running Q/A tests (stage-qa) Error: /usr/local/lib/libSDL2-2.0.so.0.18.0 is linked to /usr/local/lib/libinotify.so.0 from devel/libinotify but it is not declared as a dependency Warning: you need LIB_DEPENDS+=libinotify.so:devel/libinotify Otherwise, the patch fix my problem with the gamepad not being detected. Thanks! Created attachment 230314 [details]
update to 2.0.18 and refactoring of the options (v7)
Fixed \ issue.
When using my poudriere build (on another computer), I've got the following error: ld: error: undefined symbol: IsJoystickJSNode >>> referenced by SDL_sysjoystick.c >>> build/.libs/SDL_sysjoystick.o:(joystick_udev_callback) ld: error: undefined symbol: IsJoystickDeviceNode >>> referenced by SDL_sysjoystick.c >>> build/.libs/SDL_sysjoystick.o:(filter_entries) cc: error: linker command failed with exit code 1 (use -v to see invocation) gmake[1]: *** [Makefile:158: build/libSDL2.la] Error 1 gmake[1]: Leaving directory '/wrkdirs/usr/ports/devel/sdl20/work/SDL2-2.0.18' *** Error code 1 Selected options: ALSA=off: Audio output via the ALSA audio architecture ASM=on: Use optimized assembly code HIDAPI=on: Use HIDAPI for low level joystick drivers JACK=off: Audio output via the JackD sound server NAS=off: Audio output via the Network Audio System OSS=on: Audio output via the Open Sound System PIPEWARE=off: Audio output via the Pipewire sound server PTHREADS=on: Use POSIX threads for multi-threading PULSEAUDIO=off: Audio output via the PulseAudio sound server SAMPLERATE=on: Audio rate conversion via libsamplerate SDL_ATOMIC=on: Enable the SDL Atomic subsystem SDL_AUDIO=on: Enable the SDL Audio subsystem SDL_CPUINFO=on: Enable the SDL CPUinfo subsystem SDL_EVENTS=on: Enable the SDL Events subsystem SDL_FILE=on: Enable the SDL File subsystem SDL_HAPTIC=on: Enable the SDL Haptic subsystem SDL_JOYSTICK=on: Enable the SDL Joystick subsystem SDL_LOADSO=on: Enable the SDL Loadso subsystem SDL_POWER=on: Enable the SDL Power subsystem SDL_RENDER=on: Enable the SDL Render subsystem SDL_THREADS=on: Enable the SDL Threads subsystem SDL_TIMERS=on: Enable the SDL Timers subsystem SDL_VIDEO=on: Enable the SDL Video subsystem SNDIO=on: Sndio audio support UDEV=on: Use udev for input device detection VIDEO_KMSDRM=on: KMSDRM display support VIDEO_OPENGL=on: OpenGL rendering support VIDEO_OPENGLES1=on: OpenGL ES 1.x rendering support VIDEO_OPENGLES2=on: OpenGL ES 2.x rendering support VIDEO_VULKAN=on: Vulkan rendering support VIDEO_WAYLAND=on: Wayland display support VIDEO_X11=on: X11 display support Poudriere error is due to the missing (previously identified in stage-qa): LIB_DEPENDS+=libinotify.so:devel/libinotify But I don't know if it need to be added whatever option is selected or if it is only specific to some options (SDL_JOYSTICK, ...) Created attachment 230432 [details] update to 2.0.18 and refactoring of the options (v8) Fixed: ld: error: undefined symbol: IsJoystickJSNode >>> referenced by SDL_sysjoystick.c >>> build/.libs/SDL_sysjoystick.o:(joystick_udev_callback) ld: error: undefined symbol: IsJoystickDeviceNode >>> referenced by SDL_sysjoystick.c >>> build/.libs/SDL_sysjoystick.o:(filter_entries) libinotify for SDL_JOYSTICK only - tested. Sorry everybody for the wait. The patch looks good, I'm currently waiting for the poudriere run for all consumers and will definitely commit it this year. Some more testing is required for different options combinations, but I'm not going to postpone the update any longer and will do the thorough testing afterwards. I also plan to trim useless options which do not affect the dependency list. VVD, thanks for the patch, Stéphane thanks for testing! For the time being, no runtime problems with a lot of games on my desktop, neither after only updating sdl2, nor after rebuilding consumers as well. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9cb3316ecd2076e9267cac1b7f28eb99f4c0c2be commit 9cb3316ecd2076e9267cac1b7f28eb99f4c0c2be Author: Dmitry Marakasov <amdmi3@FreeBSD.org> AuthorDate: 2021-12-27 15:18:53 +0000 Commit: Dmitry Marakasov <amdmi3@FreeBSD.org> CommitDate: 2021-12-29 16:55:37 +0000 devel/sdl20: update to 2.0.18 PR: 252371 Submitted by: vvd@unislabs.com devel/sdl20/Makefile | 237 +++++++-------------- devel/sdl20/distinfo | 6 +- .../sdl20/files/patch-include_SDL__endian.h (gone) | 11 - devel/sdl20/files/patch-noegl | 14 +- .../files/patch-src_cpuinfo_SDL__cpuinfo.c (gone) | 33 --- devel/sdl20/files/patch-wayland (gone) | 70 ------ devel/sdl20/pkg-plist | 5 +- 7 files changed, 93 insertions(+), 283 deletions(-) +OPTIONS_DEFINE= ALSA ASM HIDAPI JACK NAS OSS PIPEWARE PTHREADS \ Looks like PIPEWARE should be PIPEWIRE? (In reply to Jack from comment #39) Yes. :-o Correct name of software is "pipewire", so option must have name PIPEWIRE. Who can commit Makefile with: s/PIPEWARE/PIPEWIRE/g ? |