SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
12
devel/sdl2/patches/patch-Makefile_in
Normal file
12
devel/sdl2/patches/patch-Makefile_in
Normal file
|
@ -0,0 +1,12 @@
|
|||
Index: Makefile.in
|
||||
--- Makefile.in.orig
|
||||
+++ Makefile.in
|
||||
@@ -137,7 +137,7 @@ LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_RELEASE = @LT_RELEASE@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
-LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
+LT_LDFLAGS = -no-undefined -rpath $(libdir) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
|
||||
all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
|
||||
|
12
devel/sdl2/patches/patch-sdl2-config_cmake_in
Normal file
12
devel/sdl2/patches/patch-sdl2-config_cmake_in
Normal file
|
@ -0,0 +1,12 @@
|
|||
Index: sdl2-config.cmake.in
|
||||
--- sdl2-config.cmake.in.orig
|
||||
+++ sdl2-config.cmake.in
|
||||
@@ -134,7 +134,7 @@ if(WIN32)
|
||||
unset(_sdl2_implib)
|
||||
unset(_sdl2_dll)
|
||||
else()
|
||||
- set(_sdl2_shared "${SDL2_LIBDIR}/libSDL2${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
+ set(_sdl2_shared "${SDL2_LIBDIR}/libSDL2${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBSDL2_VERSION}")
|
||||
if(EXISTS "${_sdl2_shared}")
|
||||
if(NOT TARGET SDL2::SDL2)
|
||||
add_library(SDL2::SDL2 SHARED IMPORTED)
|
16
devel/sdl2/patches/patch-sdl2-config_in
Normal file
16
devel/sdl2/patches/patch-sdl2-config_in
Normal file
|
@ -0,0 +1,16 @@
|
|||
Index: sdl2-config.in
|
||||
--- sdl2-config.in.orig
|
||||
+++ sdl2-config.in
|
||||
@@ -46,10 +46,10 @@ while test $# -gt 0; do
|
||||
echo @SDL_VERSION@
|
||||
;;
|
||||
--cflags)
|
||||
- echo -I@includedir@/SDL2 @SDL_CFLAGS@
|
||||
+ echo -I@includedir@ -I@includedir@/SDL2 @SDL_CFLAGS@ @X_CFLAGS@
|
||||
;;
|
||||
@ENABLE_SHARED_TRUE@ --libs)
|
||||
-@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
|
||||
+@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ @X_LIBS@
|
||||
@ENABLE_SHARED_TRUE@ ;;
|
||||
@ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs)
|
||||
@ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs)
|
11
devel/sdl2/patches/patch-sdl2_pc_in
Normal file
11
devel/sdl2/patches/patch-sdl2_pc_in
Normal file
|
@ -0,0 +1,11 @@
|
|||
Index: sdl2.pc.in
|
||||
--- sdl2.pc.in.orig
|
||||
+++ sdl2.pc.in
|
||||
@@ -10,5 +10,5 @@ Description: Simple DirectMedia Layer is a cross-platf
|
||||
Version: @SDL_VERSION@
|
||||
Requires.private: @PKGCONFIG_DEPENDS@
|
||||
Conflicts:
|
||||
-Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @PKGCONFIG_LIBS_PRIV@ @SDL_STATIC_LIBS@
|
||||
-Cflags: -I${includedir} -I${includedir}/SDL2 @SDL_CFLAGS@
|
||||
+Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @X_LIBS@
|
||||
+Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@ @X_CFLAGS@
|
16
devel/sdl2/patches/patch-src_SDL_c
Normal file
16
devel/sdl2/patches/patch-src_SDL_c
Normal file
|
@ -0,0 +1,16 @@
|
|||
- Allow custom SDL GetPlatform name with env var SDL_PLATFORM
|
||||
|
||||
Index: src/SDL.c
|
||||
--- src/SDL.c.orig
|
||||
+++ src/SDL.c
|
||||
@@ -544,6 +544,10 @@ int SDL_GetRevisionNumber(void)
|
||||
/* Get the name of the platform */
|
||||
const char *SDL_GetPlatform(void)
|
||||
{
|
||||
+ const char *platform;
|
||||
+ if (platform = SDL_getenv("SDL_PLATFORM")) {
|
||||
+ return platform;
|
||||
+ }
|
||||
#if __AIX__
|
||||
return "AIX";
|
||||
#elif __ANDROID__
|
108
devel/sdl2/patches/patch-src_joystick_bsd_SDL_bsdjoystick_c
Normal file
108
devel/sdl2/patches/patch-src_joystick_bsd_SDL_bsdjoystick_c
Normal file
|
@ -0,0 +1,108 @@
|
|||
restore Y/RY axis inversion for XInput controllers for now, pending
|
||||
a more permanent upstream solution to this
|
||||
https://github.com/libsdl-org/SDL/issues/7609#issuecomment-1522831640
|
||||
|
||||
backport D-pad calculation by bitwise operation
|
||||
https://github.com/libsdl-org/SDL/pull/7996
|
||||
|
||||
Index: src/joystick/bsd/SDL_bsdjoystick.c
|
||||
--- src/joystick/bsd/SDL_bsdjoystick.c.orig
|
||||
+++ src/joystick/bsd/SDL_bsdjoystick.c
|
||||
@@ -93,40 +93,11 @@
|
||||
#define HUG_DPAD_RIGHT 0x92
|
||||
#define HUG_DPAD_LEFT 0x93
|
||||
|
||||
-#define HAT_CENTERED 0x00
|
||||
#define HAT_UP 0x01
|
||||
#define HAT_RIGHT 0x02
|
||||
#define HAT_DOWN 0x04
|
||||
#define HAT_LEFT 0x08
|
||||
-#define HAT_RIGHTUP (HAT_RIGHT | HAT_UP)
|
||||
-#define HAT_RIGHTDOWN (HAT_RIGHT | HAT_DOWN)
|
||||
-#define HAT_LEFTUP (HAT_LEFT | HAT_UP)
|
||||
-#define HAT_LEFTDOWN (HAT_LEFT | HAT_DOWN)
|
||||
|
||||
-/* calculate the value from the state of the dpad */
|
||||
-int dpad_to_sdl(Sint32 *dpad)
|
||||
-{
|
||||
- if (dpad[2]) {
|
||||
- if (dpad[0])
|
||||
- return HAT_RIGHTUP;
|
||||
- else if (dpad[1])
|
||||
- return HAT_RIGHTDOWN;
|
||||
- else
|
||||
- return HAT_RIGHT;
|
||||
- } else if (dpad[3]) {
|
||||
- if (dpad[0])
|
||||
- return HAT_LEFTUP;
|
||||
- else if (dpad[1])
|
||||
- return HAT_LEFTDOWN;
|
||||
- else
|
||||
- return HAT_LEFT;
|
||||
- } else if (dpad[0]) {
|
||||
- return HAT_UP;
|
||||
- } else if (dpad[1]) {
|
||||
- return HAT_DOWN;
|
||||
- }
|
||||
- return HAT_CENTERED;
|
||||
-}
|
||||
#endif
|
||||
|
||||
struct report
|
||||
@@ -711,6 +682,18 @@ static void BSD_JoystickUpdate(SDL_Joystick *joy)
|
||||
/* scaleaxe */
|
||||
v = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * (v - hitem.logical_minimum)) / (hitem.logical_maximum - hitem.logical_minimum)) + SDL_JOYSTICK_AXIS_MIN;
|
||||
+#ifdef __OpenBSD__
|
||||
+ /* XInput controllermapping relies on inverted Y axes.
|
||||
+ * These devices have a 16bit signed space, as opposed
|
||||
+ * to older DInput devices (8bit unsigned), so
|
||||
+ * hitem.logical_maximum can be used to differentiate them.
|
||||
+ */
|
||||
+ if ((joyaxe == JOYAXE_Y || joyaxe == JOYAXE_RY)
|
||||
+ && hitem.logical_maximum > 255) {
|
||||
+ if (v != 0)
|
||||
+ v = ~v;
|
||||
+ }
|
||||
+#endif
|
||||
SDL_PrivateJoystickAxis(joy, naxe, v);
|
||||
} else if (usage == HUG_HAT_SWITCH) {
|
||||
v = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
@@ -719,19 +702,29 @@ static void BSD_JoystickUpdate(SDL_Joystick *joy)
|
||||
hitem.logical_minimum);
|
||||
}
|
||||
#ifdef __OpenBSD__
|
||||
- else if (usage == HUG_DPAD_UP) {
|
||||
+ /* here D-pad directions are reported like separate buttons.
|
||||
+ * calculate the SDL hat value from the 4 separate values.
|
||||
+ */
|
||||
+ switch (usage) {
|
||||
+ case HUG_DPAD_UP:
|
||||
dpad[0] = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
- SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
|
||||
- } else if (usage == HUG_DPAD_DOWN) {
|
||||
+ break;
|
||||
+ case HUG_DPAD_DOWN:
|
||||
dpad[1] = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
- SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
|
||||
- } else if (usage == HUG_DPAD_RIGHT) {
|
||||
+ break;
|
||||
+ case HUG_DPAD_RIGHT:
|
||||
dpad[2] = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
- SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
|
||||
- } else if (usage == HUG_DPAD_LEFT) {
|
||||
+ break;
|
||||
+ case HUG_DPAD_LEFT:
|
||||
dpad[3] = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
- SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
|
||||
+ break;
|
||||
+ //default:
|
||||
+ // no-op
|
||||
}
|
||||
+ SDL_PrivateJoystickHat(joy, 0, (dpad[0] * HAT_UP) |
|
||||
+ (dpad[1] * HAT_DOWN) |
|
||||
+ (dpad[2] * HAT_RIGHT) |
|
||||
+ (dpad[3] * HAT_LEFT) );
|
||||
#endif
|
||||
break;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue