update to SDL2 2.0.9, add patch to fix D-pad for Xbox360/XInput controllers, update PLIST as spotted by bentley@, ok bentley@
This commit is contained in:
parent
2f0b3b3f69
commit
0a5f68d27c
@ -1,17 +1,16 @@
|
||||
# $OpenBSD: Makefile,v 1.23 2018/10/29 05:39:49 thfr Exp $
|
||||
# $OpenBSD: Makefile,v 1.24 2019/01/03 17:55:08 thfr Exp $
|
||||
|
||||
COMMENT= cross-platform multimedia library
|
||||
BROKEN-hppa= src/atomic/SDL_spinlock.c:101:2: error: \
|
||||
#error Please implement for your platform.
|
||||
|
||||
V= 2.0.8
|
||||
V= 2.0.9
|
||||
DISTNAME= SDL2-${V}
|
||||
PKGNAME= sdl2-${V}
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= https://www.libsdl.org/release/
|
||||
REVISION= 1
|
||||
|
||||
SHARED_LIBS= SDL2 0.5 # 0.8
|
||||
SHARED_LIBS= SDL2 0.6 # 0.9
|
||||
|
||||
HOMEPAGE= https://www.libsdl.org/
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (SDL2-2.0.8.tar.gz) = 7cd8VzCGYdV26EM0TYY44CWngYv/c/j7+rCcPF/Qkuw=
|
||||
SIZE (SDL2-2.0.8.tar.gz) = 4909017
|
||||
SHA256 (SDL2-2.0.9.tar.gz) = JVGG3GduzQwdvxDsiizF1oabUHnYo4GUwq7N/1SzJLE=
|
||||
SIZE (SDL2-2.0.9.tar.gz) = 5246942
|
||||
|
@ -1,9 +1,9 @@
|
||||
$OpenBSD: patch-Makefile_in,v 1.5 2018/03/11 22:40:20 sthen Exp $
|
||||
$OpenBSD: patch-Makefile_in,v 1.6 2019/01/03 17:55:08 thfr Exp $
|
||||
|
||||
Index: Makefile.in
|
||||
--- Makefile.in.orig
|
||||
+++ Makefile.in
|
||||
@@ -122,7 +122,7 @@ LT_AGE = @LT_AGE@
|
||||
@@ -123,7 +123,7 @@ LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_RELEASE = @LT_RELEASE@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
|
@ -1,4 +1,4 @@
|
||||
$OpenBSD: patch-src_SDL_c,v 1.1 2018/01/07 22:56:46 awolk Exp $
|
||||
$OpenBSD: patch-src_SDL_c,v 1.2 2019/01/03 17:55:08 thfr Exp $
|
||||
|
||||
disable breaking if no haptic feedback support which disallows gamecontroller API
|
||||
pretend to be Linux in SDL_GetPlatform to allow compatibility with FNA games
|
||||
@ -7,7 +7,7 @@ until OpenBSD support has been rolled out (estimated end of 2018)
|
||||
Index: src/SDL.c
|
||||
--- src/SDL.c.orig
|
||||
+++ src/SDL.c
|
||||
@@ -227,8 +227,6 @@ SDL_InitSubSystem(Uint32 flags)
|
||||
@@ -228,8 +228,6 @@ SDL_InitSubSystem(Uint32 flags)
|
||||
}
|
||||
}
|
||||
SDL_PrivateSubsystemRefCountIncr(SDL_INIT_HAPTIC);
|
||||
@ -16,7 +16,7 @@ Index: src/SDL.c
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -425,7 +423,7 @@ SDL_GetPlatform()
|
||||
@@ -449,7 +447,7 @@ SDL_GetPlatform()
|
||||
#elif __NETBSD__
|
||||
return "NetBSD";
|
||||
#elif __OPENBSD__
|
||||
|
@ -1,4 +1,4 @@
|
||||
$OpenBSD: patch-src_joystick_SDL_gamecontroller_c,v 1.2 2018/03/11 22:40:20 sthen Exp $
|
||||
$OpenBSD: patch-src_joystick_SDL_gamecontroller_c,v 1.3 2019/01/03 17:55:08 thfr Exp $
|
||||
|
||||
enable GameController API the Linux fallback way (by posing as Xbox360
|
||||
controller)
|
||||
@ -9,10 +9,10 @@ map to SDL_GAMECONTROLLERCONFIG envvar if available
|
||||
Index: src/joystick/SDL_gamecontroller.c
|
||||
--- src/joystick/SDL_gamecontroller.c.orig
|
||||
+++ src/joystick/SDL_gamecontroller.c
|
||||
@@ -884,15 +884,21 @@ static ControllerMapping_t *SDL_PrivateGetControllerMa
|
||||
#else
|
||||
(void) s_pEmscriptenMapping; /* pacify ARMCC */
|
||||
#endif
|
||||
@@ -1008,17 +1008,23 @@ static ControllerMapping_t *SDL_PrivateGetControllerMa
|
||||
ControllerMapping_t *mapping;
|
||||
|
||||
mapping = SDL_PrivateGetControllerMappingForGUID(&guid, SDL_FALSE);
|
||||
-#ifdef __LINUX__
|
||||
+#if defined(__LINUX__) || defined(__OpenBSD__)
|
||||
if (!mapping && name) {
|
||||
@ -33,5 +33,8 @@ Index: src/joystick/SDL_gamecontroller.c
|
||||
+ }
|
||||
+ //}
|
||||
}
|
||||
#endif /* __LINUX__ */
|
||||
-#endif /* __LINUX__ */
|
||||
+#endif /* __LINUX__ || __OpenBSD__ */
|
||||
|
||||
if (!mapping && name) {
|
||||
if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box") || SDL_strstr(name, "XBOX")) {
|
||||
|
109
devel/sdl2/patches/patch-src_joystick_bsd_SDL_sysjoystick_c
Normal file
109
devel/sdl2/patches/patch-src_joystick_bsd_SDL_sysjoystick_c
Normal file
@ -0,0 +1,109 @@
|
||||
$OpenBSD: patch-src_joystick_bsd_SDL_sysjoystick_c,v 1.1 2019/01/03 17:55:08 thfr Exp $
|
||||
|
||||
detect D-Pad as hat and turn D-pad input into equivalent hat position
|
||||
This improves compatibility with Xbox 360 controller and XInput devices
|
||||
|
||||
Index: src/joystick/bsd/SDL_sysjoystick.c
|
||||
--- src/joystick/bsd/SDL_sysjoystick.c.orig
|
||||
+++ src/joystick/bsd/SDL_sysjoystick.c
|
||||
@@ -80,7 +80,50 @@
|
||||
#define MAX_JOY_JOYS 2
|
||||
#define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS)
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
|
||||
+#define HUG_DPAD_UP 0x90
|
||||
+#define HUG_DPAD_DOWN 0x91
|
||||
+#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
|
||||
{
|
||||
#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
|
||||
@@ -432,7 +475,11 @@ desc_failed:
|
||||
int joyaxe = usage_to_joyaxe(usage);
|
||||
if (joyaxe >= 0) {
|
||||
hw->axis_map[joyaxe] = 1;
|
||||
- } else if (usage == HUG_HAT_SWITCH) {
|
||||
+ } else if (usage == HUG_HAT_SWITCH
|
||||
+#ifdef __OpenBSD__
|
||||
+ || usage == HUG_DPAD_UP
|
||||
+#endif
|
||||
+ ) {
|
||||
joy->nhats++;
|
||||
}
|
||||
break;
|
||||
@@ -485,6 +532,9 @@ BSD_JoystickUpdate(SDL_Joystick * joy)
|
||||
struct report *rep;
|
||||
int nbutton, naxe = -1;
|
||||
Sint32 v;
|
||||
+#ifdef __OpenBSD__
|
||||
+ Sint32 dpad[4] = {0, 0, 0, 0};
|
||||
+#endif
|
||||
|
||||
#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__)
|
||||
struct joystick gameport;
|
||||
@@ -570,6 +620,16 @@ BSD_JoystickUpdate(SDL_Joystick * joy)
|
||||
hatval_to_sdl(v) -
|
||||
hitem.logical_minimum);
|
||||
}
|
||||
+#ifdef __OpenBSD__
|
||||
+ else if (usage == HUG_DPAD_UP)
|
||||
+ dpad[0] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
+ else if (usage == HUG_DPAD_DOWN)
|
||||
+ dpad[1] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
+ else if (usage == HUG_DPAD_RIGHT)
|
||||
+ dpad[2] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
+ else if (usage == HUG_DPAD_LEFT)
|
||||
+ dpad[3] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
case HUP_BUTTON:
|
||||
@@ -585,6 +645,9 @@ BSD_JoystickUpdate(SDL_Joystick * joy)
|
||||
break;
|
||||
}
|
||||
}
|
||||
+#ifdef __OpenBSD__
|
||||
+ SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
|
||||
+#endif
|
||||
hid_end_parse(hdata);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
$OpenBSD: patch-src_video_x11_SDL_x11keyboard_c,v 1.2 2018/10/30 07:03:30 kirby Exp $
|
||||
|
||||
fix incorrect function signature that breaks macppc platform (likely any big
|
||||
endian platform): "stack overflow in function X11_InitKeyboard"
|
||||
upstream changeset http://hg.libsdl.org/SDL/rev/9dd351b26dcb
|
||||
|
||||
Index: src/video/x11/SDL_x11keyboard.c
|
||||
--- src/video/x11/SDL_x11keyboard.c.orig
|
||||
+++ src/video/x11/SDL_x11keyboard.c
|
||||
@@ -266,7 +266,7 @@ X11_InitKeyboard(_THIS)
|
||||
int best_distance;
|
||||
int best_index;
|
||||
int distance;
|
||||
- BOOL xkb_repeat = 0;
|
||||
+ Bool xkb_repeat = 0;
|
||||
|
||||
X11_XAutoRepeatOn(data->display);
|
||||
|
@ -1,18 +0,0 @@
|
||||
$OpenBSD: patch-src_video_x11_SDL_x11sym_h,v 1.2 2018/10/30 07:03:30 kirby Exp $
|
||||
|
||||
fix incorrect function signature that breaks macppc platform (likely any big
|
||||
endian platform)
|
||||
upstream changeset http://hg.libsdl.org/SDL/rev/9dd351b26dcb
|
||||
|
||||
Index: src/video/x11/SDL_x11sym.h
|
||||
--- src/video/x11/SDL_x11sym.h.orig
|
||||
+++ src/video/x11/SDL_x11sym.h
|
||||
@@ -180,7 +180,7 @@ SDL_X11_SYM(Status,XkbGetUpdatedMap,(Display* a,unsign
|
||||
SDL_X11_SYM(XkbDescPtr,XkbGetMap,(Display* a,unsigned int b,unsigned int c),(a,b,c),return)
|
||||
SDL_X11_SYM(void,XkbFreeClientMap,(XkbDescPtr a,unsigned int b, Bool c),(a,b,c),)
|
||||
SDL_X11_SYM(void,XkbFreeKeyboard,(XkbDescPtr a,unsigned int b, Bool c),(a,b,c),)
|
||||
-SDL_X11_SYM(BOOL,XkbSetDetectableAutoRepeat,(Display* a, BOOL b, BOOL* c),(a,b,c),return)
|
||||
+SDL_X11_SYM(Bool,XkbSetDetectableAutoRepeat,(Display* a, Bool b, Bool* c),(a,b,c),return)
|
||||
#endif
|
||||
|
||||
#if NeedWidePrototypes
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.6 2018/09/04 12:46:11 espie Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.7 2019/01/03 17:55:08 thfr Exp $
|
||||
bin/sdl2-config
|
||||
include/SDL2/
|
||||
include/SDL2/SDL.h
|
||||
@ -46,6 +46,7 @@ include/SDL2/SDL_render.h
|
||||
include/SDL2/SDL_revision.h
|
||||
include/SDL2/SDL_rwops.h
|
||||
include/SDL2/SDL_scancode.h
|
||||
include/SDL2/SDL_sensor.h
|
||||
include/SDL2/SDL_shape.h
|
||||
include/SDL2/SDL_stdinc.h
|
||||
include/SDL2/SDL_surface.h
|
||||
|
Loading…
Reference in New Issue
Block a user