Wednesday, August 11, 2021

UPDATE: SDL 2.0.16

Here is an update to SDL 2.0.16.

More testing and feedback welcome.


---------------------------------------------------------------------------
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()

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


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/devel/sdl2/Makefile,v
retrieving revision 1.35
diff -u -p -u -p -r1.35 Makefile
--- Makefile 19 Jun 2021 20:37:52 -0000 1.35
+++ Makefile 11 Aug 2021 00:23:15 -0000
@@ -2,14 +2,13 @@

COMMENT= cross-platform multimedia library

-V= 2.0.14
+V= 2.0.16
DISTNAME= SDL2-${V}
PKGNAME= sdl2-${V}
-REVISION= 2
CATEGORIES= devel
MASTER_SITES= https://www.libsdl.org/release/

-SHARED_LIBS= SDL2 0.9 # 0.12
+SHARED_LIBS= SDL2 0.10 # 0.12

HOMEPAGE= https://www.libsdl.org/

Index: distinfo
===================================================================
RCS file: /home/cvs/ports/devel/sdl2/distinfo,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 distinfo
--- distinfo 6 Jan 2021 22:32:08 -0000 1.11
+++ distinfo 10 Aug 2021 23:37:07 -0000
@@ -1,2 +1,2 @@
-SHA256 (SDL2-2.0.14.tar.gz) = 2CFbVxpYG+EzLSEG+ANvywPRKnC64B4g9CSXbSdUMrw=
-SIZE (SDL2-2.0.14.tar.gz) = 6089974
+SHA256 (SDL2-2.0.16.tar.gz) = Zb6f9gBANLWyzpkntaTbGBSTDxacSy2uCh5GlwdfKHs=
+SIZE (SDL2-2.0.16.tar.gz) = 7227262
Index: patches/patch-Makefile_in
===================================================================
RCS file: /home/cvs/ports/devel/sdl2/patches/patch-Makefile_in,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 patch-Makefile_in
--- patches/patch-Makefile_in 6 Jan 2021 22:32:08 -0000 1.9
+++ patches/patch-Makefile_in 11 Aug 2021 00:18:47 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-Makefile_in,v 1.9 2021/0
Index: Makefile.in
--- Makefile.in.orig
+++ Makefile.in
-@@ -129,7 +129,7 @@ LT_AGE = @LT_AGE@
+@@ -132,7 +132,7 @@ LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
Index: patches/patch-sdl2-config_cmake_in
===================================================================
RCS file: /home/cvs/ports/devel/sdl2/patches/patch-sdl2-config_cmake_in,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-sdl2-config_cmake_in
--- patches/patch-sdl2-config_cmake_in 6 Jan 2021 22:32:08 -0000 1.2
+++ patches/patch-sdl2-config_cmake_in 11 Aug 2021 00:18:45 -0000
@@ -3,35 +3,76 @@ $OpenBSD: patch-sdl2-config_cmake_in,v 1
Index: sdl2-config.cmake.in
--- sdl2-config.cmake.in.orig
+++ sdl2-config.cmake.in
-@@ -9,31 +9,3 @@ set(SDL2_LIBDIR "@libdir@")
- set(SDL2_INCLUDE_DIRS "@includedir@/SDL2")
+@@ -10,72 +10,3 @@ set(SDL2_LIBDIR "${libdir}")
+ set(SDL2_INCLUDE_DIRS "${includedir}/SDL2")
set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@")
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
-
-if(NOT TARGET SDL2::SDL2)
+- # provide SDL2::SDL2, SDL2::SDL2main and SDL2::SDL2-static targets, like SDL2Config.cmake does, for compatibility
+-
- # Remove -lSDL2 as that is handled by CMake, note the space at the end so it does not replace e.g. -lSDL2main
- # This may require "libdir" beeing set (from above)
- string(REPLACE "-lSDL2 " "" SDL2_EXTRA_LINK_FLAGS "@SDL_RLD_FLAGS@ @SDL_LIBS@ ")
+- # also get rid of -lSDL2main, if you want to link against that use both SDL2::SDL2main and SDL2::SDL2 (in that order)
+- # (SDL2Config.cmake has the same behavior)
+- string(REPLACE "-lSDL2main" "" SDL2_EXTRA_LINK_FLAGS ${SDL2_EXTRA_LINK_FLAGS})
- string(STRIP "${SDL2_EXTRA_LINK_FLAGS}" SDL2_EXTRA_LINK_FLAGS)
- string(REPLACE "-lSDL2 " "" SDL2_EXTRA_LINK_FLAGS_STATIC "@SDL_STATIC_LIBS@ ")
- string(STRIP "${SDL2_EXTRA_LINK_FLAGS_STATIC}" SDL2_EXTRA_LINK_FLAGS_STATIC)
-
+-if(WIN32 AND NOT MSVC)
+- # MINGW needs very special handling, because the link order must be exactly -lmingw32 -lSDL2main -lSDL2
+- # for it to work at all (and -mwindows somewhere); a normal SHARED IMPORTED or STATIC IMPORTED library always puts itself first
+- # so handle this like a header-only lib and put everything in INTERFACE_LINK_LIBRARIES
+-
+- add_library(SDL2::SDL2 INTERFACE IMPORTED)
+- set_target_properties(SDL2::SDL2 PROPERTIES
+- INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
+- INTERFACE_LINK_LIBRARIES "-L${SDL2_LIBDIR} -lSDL2")
+-
+- add_library(SDL2::SDL2main INTERFACE IMPORTED)
+- set_target_properties(SDL2::SDL2main PROPERTIES
+- INTERFACE_LINK_LIBRARIES "-L${SDL2_LIBDIR} -lmingw32 -lSDL2main -mwindows")
+-
+-else() # (not WIN32) or MSVC
+-
- add_library(SDL2::SDL2 SHARED IMPORTED)
- set_target_properties(SDL2::SDL2 PROPERTIES
-- INTERFACE_INCLUDE_DIRECTORIES "@includedir@/SDL2"
+- INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
- IMPORTED_LINK_INTERFACE_LANGUAGES "C"
-- IMPORTED_LOCATION "@libdir@/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}"
-- INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS}")
+- IMPORTED_LOCATION "${SDL2_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}")
+-
+- if(MSVC)
+- # This file is generated when building SDL2 with autotools and MinGW, and MinGW/dlltool
+- # isn't able to generate .lib files that are usable by recent MSVC versions
+- # (something about "module unsafe for SAFESEH"; SAFESEH is enabled by default in MSVC).
+- # The .lib file for SDL2.dll *could* be generated with `gendef SDL2.dll` and then
+- # `lib.exe /machine:x86 /def:SDL2.def /out:SDL2.lib` (or /machine:amd64)
+- # but that requires lib.exe from a Visual Studio installation - and that still doesn't
+- # give you a static SDL2main.lib with SAFESEH support that you'll need (unless you don't use SDL2main)
+- # Note that when building SDL2 with CMake and MSVC, the result works with both MinGW and MSVC.
+-
+- message(FATAL_ERROR, "This build of libSDL2 only supports MinGW, not MSVC (Visual C++), because it lacks .lib files!")
+- # MSVC needs SDL2.lib set as IMPORTED_IMPLIB to link against (comment out message() call above if you added SDL2.lib yourself)
+- set_target_properties(SDL2::SDL2 PROPERTIES IMPORTED_IMPLIB "${SDL2_LIBDIR}/SDL2.lib")
+- else()
+- # this mustn't be set for MSVC, so do it here in an extra call here
+- set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS}")
+- endif()
+-
+- add_library(SDL2::SDL2main STATIC IMPORTED)
+- set_target_properties(SDL2::SDL2main PROPERTIES
+- IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+- IMPORTED_LOCATION "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}")
+-
+-endif() # (not WIN32) or MSVC
-
- add_library(SDL2::SDL2-static STATIC IMPORTED)
- set_target_properties(SDL2::SDL2-static PROPERTIES
-- INTERFACE_INCLUDE_DIRECTORIES "@includedir@/SDL2"
+- INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
- IMPORTED_LINK_INTERFACE_LANGUAGES "C"
-- IMPORTED_LOCATION "@libdir@/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}"
+- IMPORTED_LOCATION "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}"
- INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS_STATIC}")
-
-- add_library(SDL2::SDL2main STATIC IMPORTED)
-- set_target_properties(SDL2::SDL2main PROPERTIES
-- IMPORTED_LINK_INTERFACE_LANGUAGES "C"
-- IMPORTED_LOCATION "@libdir@/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}")
--endif()
+-endif() # NOT TARGET SDL2::SDL2
Index: patches/patch-sdl2_pc_in
===================================================================
RCS file: /home/cvs/ports/devel/sdl2/patches/patch-sdl2_pc_in,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-sdl2_pc_in
--- patches/patch-sdl2_pc_in 6 Jan 2021 22:32:08 -0000 1.3
+++ patches/patch-sdl2_pc_in 11 Aug 2021 00:18:45 -0000
@@ -7,7 +7,7 @@ Index: sdl2.pc.in
Version: @SDL_VERSION@
Requires:
Conflicts:
--Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @PKG_CONFIG_LIBS_PRIV@ @SDL_STATIC_LIBS@
+-Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @PKGCONFIG_LIBS_PRIV@ @SDL_STATIC_LIBS@
-Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@
+Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @X_LIBS@
+Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@ @X_CFLAGS@
Index: patches/patch-src_SDL_c
===================================================================
RCS file: /home/cvs/ports/devel/sdl2/patches/patch-src_SDL_c,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 patch-src_SDL_c
--- patches/patch-src_SDL_c 6 Jan 2021 22:32:08 -0000 1.5
+++ patches/patch-src_SDL_c 11 Aug 2021 00:18:45 -0000
@@ -7,7 +7,7 @@ until OpenBSD support has been rolled ou
Index: src/SDL.c
--- src/SDL.c.orig
+++ src/SDL.c
-@@ -273,8 +273,6 @@ SDL_InitSubSystem(Uint32 flags)
+@@ -280,8 +280,6 @@ SDL_InitSubSystem(Uint32 flags)
}
}
SDL_PrivateSubsystemRefCountIncr(SDL_INIT_HAPTIC);
@@ -16,7 +16,7 @@ Index: src/SDL.c

No comments:

Post a Comment