1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371 | diff -Nru libsdl2-2.0.2+dfsg1/debian/changelog libsdl2-2.0.2+dfsg1/debian/changelog
--- libsdl2-2.0.2+dfsg1/debian/changelog 2014-11-27 17:53:32.000000000 +0000
+++ libsdl2-2.0.2+dfsg1/debian/changelog 2015-01-30 08:29:43.000000000 +0000
@@ -1,3 +1,23 @@
+libsdl2 (2.0.2+dfsg1-6ubuntu2) vivid; urgency=medium
+
+ * Rebuild against libmirclient.so.8. (Closes: #1402753)
+ * New fixes included:
+ - symbol fixes
+ - software renderering fixes
+ - touch events now supported
+ - set_type changed to set_state
+
+ -- Brandon Schaefer <brandon.schaefer@canonical.com> Mon, 26 Jan 2015 14:45:28 -0800
+
+libsdl2 (2.0.2+dfsg1-6ubuntu1) vivid; urgency=low
+
+ * Merge from Debian unstable. Remaining changes:
+ - debian/control, debian/rules,
+ debian/patches/mir_forward_declaration_syswm.diff:
+ + Enable Mir video support.
+
+ -- Artur Rona <ari-tczew@ubuntu.com> Tue, 06 Jan 2015 23:39:58 +0100
+
libsdl2 (2.0.2+dfsg1-6) unstable; urgency=medium
* rules: disable activec for ppc64el build (Closes: #770670)
@@ -21,6 +41,20 @@
-- Felix Geyer <fgeyer@debian.org> Mon, 16 Jun 2014 21:02:07 +0200
+libsdl2 (2.0.2+dfsg1-3ubuntu2) utopic; urgency=medium
+
+ * New patch: mir_forward_declaration_syswm.diff
+ - Forward declare structs so you don't need mir headers
+ (LP: #1306629)
+
+ -- Brandon Schaefer <brandon.schaefer@canonical.com> Thu, 01 May 2014 13:03:23 -0400
+
+libsdl2 (2.0.2+dfsg1-3ubuntu1) trusty; urgency=medium
+
+ * Enable Mir video support (LP: #1295389).
+
+ -- Brandon Schaefer <brandon.schaefer@canonical.com> Thu, 10 Apr 2014 01:15:21 +0100
+
libsdl2 (2.0.2+dfsg1-3) unstable; urgency=medium
* Actually change Build-Depends libegl1-mesa-dev to be conditionally
diff -Nru libsdl2-2.0.2+dfsg1/debian/control libsdl2-2.0.2+dfsg1/debian/control
--- libsdl2-2.0.2+dfsg1/debian/control 2014-11-27 17:53:32.000000000 +0000
+++ libsdl2-2.0.2+dfsg1/debian/control 2014-11-27 21:41:19.000000000 +0000
@@ -1,7 +1,8 @@
Source: libsdl2
Priority: optional
Section: libs
-Maintainer: Debian SDL packages maintainers <pkg-sdl-maintainers@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian SDL packages maintainers <pkg-sdl-maintainers@lists.alioth.debian.org>
Uploaders: Barry deFreese <bdefreese@debian.org>,
Sam Hocevar <sho@debian.org>,
Manuel A. Fernandez Montecelo <mafm@debian.org>,
@@ -15,6 +16,7 @@
libgl1-mesa-dev,
libgles2-mesa-dev [!hurd-any],
libglu1-mesa-dev,
+ libmirclient-dev [i386 amd64 armhf],
libpulse-dev,
libudev-dev [linux-any],
libusb2-dev [kfreebsd-any],
@@ -61,6 +63,7 @@
libgl1-mesa-dev,
libgles2-mesa-dev [!hurd-any],
libglu1-mesa-dev,
+ libmirclient-dev [i386 amd64 armhf],
libpulse-dev,
libudev-dev [linux-any],
libusb2-dev [kfreebsd-any],
diff -Nru libsdl2-2.0.2+dfsg1/debian/patches/mir_forward_declaration_syswm.diff libsdl2-2.0.2+dfsg1/debian/patches/mir_forward_declaration_syswm.diff
--- libsdl2-2.0.2+dfsg1/debian/patches/mir_forward_declaration_syswm.diff 1970-01-01 01:00:00.000000000 +0100
+++ libsdl2-2.0.2+dfsg1/debian/patches/mir_forward_declaration_syswm.diff 2014-05-07 15:31:08.000000000 +0100
@@ -0,0 +1,29 @@
+Description: Forward Declare MirConnection/MirSurface so we don't have to expose mir headers.
+Author: Brandon Schaefer <brandon.schaefer@canonical.com>
+Last-Update: 2014-4-17
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libsdl2/+bug/1306629
+
+--- a/include/SDL_syswm.h
++++ b/include/SDL_syswm.h
+@@ -93,11 +93,6 @@
+ #endif
+ #endif
+
+-#if defined(SDL_VIDEO_DRIVER_MIR)
+-#include <mir_toolkit/mir_client_library.h>
+-#endif
+-
+-
+ /**
+ * These are the various supported windowing subsystems
+ */
+@@ -213,8 +208,8 @@
+ #if defined(SDL_VIDEO_DRIVER_MIR)
+ struct
+ {
+- MirConnection *connection; /**< Mir display server connection */
+- MirSurface *surface; /**< Mir surface */
++ struct MirConnection *connection; /**< Mir display server connection */
++ struct MirSurface *surface; /**< Mir surface */
+ } mir;
+ #endif
diff -Nru libsdl2-2.0.2+dfsg1/debian/patches/mir_upstream_patch.diff libsdl2-2.0.2+dfsg1/debian/patches/mir_upstream_patch.diff
--- libsdl2-2.0.2+dfsg1/debian/patches/mir_upstream_patch.diff 1970-01-01 01:00:00.000000000 +0100
+++ libsdl2-2.0.2+dfsg1/debian/patches/mir_upstream_patch.diff 2015-01-30 08:29:30.000000000 +0000
@@ -0,0 +1,223 @@
+=== modified file 'src/video/mir/SDL_mirevents.c'
+--- a/src/video/mir/SDL_mirevents.c
++++ b/src/video/mir/SDL_mirevents.c
+@@ -117,21 +117,21 @@
+ }
+
+ static void
+-HandleTouchPress(int device_id, int source_id, SDL_bool down, float x, float y, float pressure)
++HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
+ {
+- SDL_SendTouch(device_id, source_id, down, x, y, pressure);
++ SDL_SendMouseMotion(sdl_window, 0, 0, x, y);
+ }
+
+ static void
+-HandleTouchMotion(int device_id, int source_id, float x, float y, float pressure)
++HandleTouchPress(int device_id, int source_id, SDL_bool down, float x, float y, float pressure)
+ {
+- SDL_SendTouchMotion(device_id, source_id, x, y, pressure);
++ SDL_SendTouch(device_id, source_id, down, x, y, pressure);
+ }
+
+ static void
+-HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
++HandleTouchMotion(int device_id, int source_id, float x, float y, float pressure)
+ {
+- SDL_SendMouseMotion(sdl_window, 0, 0, x, y);
++ SDL_SendTouchMotion(device_id, source_id, x, y, pressure);
+ }
+
+ static void
+@@ -205,13 +205,11 @@
+ case mir_motion_action_outside:
+ SDL_SetMouseFocus(NULL);
+ break;
+-#if 0 /* !!! FIXME: needs a newer set of dev headers than Ubuntu 13.10 is shipping atm. */
+ case mir_motion_action_scroll:
+ HandleMouseScroll(sdl_window,
+ motion.pointer_coordinates[cord_index].hscroll,
+ motion.pointer_coordinates[cord_index].vscroll);
+ break;
+-#endif
+ case mir_motion_action_cancel:
+ case mir_motion_action_hover_enter:
+ case mir_motion_action_hover_exit:
+@@ -226,16 +224,12 @@
+ {
+ int cord_index;
+ for (cord_index = 0; cord_index < motion.pointer_count; cord_index++) {
+-#if 0 /* !!! FIXME: needs a newer set of dev headers than Ubuntu 13.10 is shipping atm. */
+- if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_mouse) {
+- HandleMouseEvent(motion, cord_index, sdl_window);
+- }
+- else if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) {
++ if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) {
+ HandleTouchEvent(motion, cord_index, sdl_window);
+ }
+-#else
+- HandleMouseEvent(motion, cord_index, sdl_window);
+-#endif
++ else {
++ HandleMouseEvent(motion, cord_index, sdl_window);
++ }
+ }
+ }
+
+--- a/src/video/mir/SDL_mirframebuffer.c
++++ b/src/video/mir/SDL_mirframebuffer.c
+@@ -56,6 +56,8 @@
+ MIR_Window* mir_window;
+ MirSurfaceParameters surfaceparm;
+
++ mir_data->software = SDL_TRUE;
++
+ if (MIR_CreateWindow(_this, window) < 0)
+ return SDL_SetError("Failed to created a mir window.");
+
+@@ -91,11 +93,13 @@
+ MirGraphicsRegion region;
+ int i, j, x, y, w, h, start;
+ int bytes_per_pixel, bytes_per_row, s_stride, d_stride;
++ char* s_dest;
++ char* pixels;
+
+ MIR_mir_surface_get_graphics_region(mir_window->surface, ®ion);
+
+- char* s_dest = region.vaddr;
+- char* pixels = (char*)window->surface->pixels;
++ s_dest = region.vaddr;
++ pixels = (char*)window->surface->pixels;
+
+ s_stride = window->surface->pitch;
+ d_stride = region.stride;
+--- a/src/video/mir/SDL_mirsym.h
++++ b/src/video/mir/SDL_mirsym.h
+@@ -26,7 +26,7 @@
+ SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params))
+ SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
+ SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
+-SDL_MIR_SYM(int,mir_connection_is_valid,(MirConnection *connection))
++SDL_MIR_SYM(MirBool,mir_connection_is_valid,(MirConnection *connection))
+ SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
+ SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
+ SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration))
+@@ -34,10 +34,11 @@
+ SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface))
+ SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region))
+ SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters))
+-SDL_MIR_SYM(int,mir_surface_is_valid,(MirSurface *surface))
++SDL_MIR_SYM(MirBool,mir_surface_is_valid,(MirSurface *surface))
+ SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface))
+ SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler))
+ SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type))
++SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_state,(MirSurface *surface, MirSurfaceState state))
+ SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface))
+
+ SDL_MIR_MODULE(XKBCOMMON)
+--- a/src/video/mir/SDL_mirvideo.c
++++ b/src/video/mir/SDL_mirvideo.c
+@@ -82,7 +82,6 @@
+ /* !!! FIXME: try to make a MirConnection here. */
+ available = 1;
+ SDL_MIR_UnloadSymbols();
+-
+ }
+
+ return available;
+@@ -274,6 +273,7 @@
+ MIR_Data* mir_data = _this->driverdata;
+
+ mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
++ mir_data->software = SDL_FALSE;
+
+ if (!MIR_mir_connection_is_valid(mir_data->connection))
+ return SDL_SetError("Failed to connect to the Mir Server");
+--- a/src/video/mir/SDL_mirvideo.h
++++ b/src/video/mir/SDL_mirvideo.h
+@@ -32,6 +32,8 @@
+ typedef struct
+ {
+ MirConnection* connection;
++ SDL_bool software;
++
+ } MIR_Data;
+
+ #endif /* _SDL_mirvideo_h_ */
+--- a/src/video/mir/SDL_mirwindow.c
++++ b/src/video/mir/SDL_mirwindow.c
+@@ -84,7 +84,8 @@
+ .width = window->w,
+ .height = window->h,
+ .pixel_format = mir_pixel_format_invalid,
+- .buffer_usage = mir_buffer_usage_hardware
++ .buffer_usage = mir_buffer_usage_hardware,
++ .output_id = mir_display_output_id_invalid
+ };
+
+ MirEventDelegate delegate = {
+@@ -99,6 +100,9 @@
+ mir_data = _this->driverdata;
+ window->driverdata = mir_window;
+
++ if (mir_data->software)
++ surfaceparm.buffer_usage = mir_buffer_usage_software;
++
+ if (window->x == SDL_WINDOWPOS_UNDEFINED)
+ window->x = 0;
+
+@@ -145,14 +149,13 @@
+ MIR_Data* mir_data = _this->driverdata;
+ MIR_Window* mir_window = window->driverdata;
+
+- window->driverdata = NULL;
+-
+ if (mir_data) {
+ SDL_EGL_DestroySurface(_this, mir_window->egl_surface);
+ MIR_mir_surface_release_sync(mir_window->surface);
+
+ SDL_free(mir_window);
+ }
++ window->driverdata = NULL;
+ }
+
+ SDL_bool
+@@ -183,9 +186,9 @@
+ return;
+
+ if (fullscreen) {
+- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_fullscreen);
++ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_fullscreen);
+ } else {
+- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_restored);
++ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored);
+ }
+ }
+
+@@ -197,7 +200,7 @@
+ if (IsSurfaceValid(mir_window) < 0)
+ return;
+
+- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_maximized);
++ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_maximized);
+ }
+
+ void
+@@ -208,7 +211,7 @@
+ if (IsSurfaceValid(mir_window) < 0)
+ return;
+
+- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_minimized);
++ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_minimized);
+ }
+
+ void
+@@ -219,7 +222,7 @@
+ if (IsSurfaceValid(mir_window) < 0)
+ return;
+
+- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_restored);
++ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored);
+ }
+
+ #endif /* SDL_VIDEO_DRIVER_MIR */
diff -Nru libsdl2-2.0.2+dfsg1/debian/patches/series libsdl2-2.0.2+dfsg1/debian/patches/series
--- libsdl2-2.0.2+dfsg1/debian/patches/series 2014-11-27 17:53:32.000000000 +0000
+++ libsdl2-2.0.2+dfsg1/debian/patches/series 2015-01-30 08:29:30.000000000 +0000
@@ -1,3 +1,5 @@
use-default-screen
SDL2_dont_propagate_lpthread.diff
fix_joystick_misc_axes.diff
+mir_forward_declaration_syswm.diff
+mir_upstream_patch.diff
diff -Nru libsdl2-2.0.2+dfsg1/debian/rules libsdl2-2.0.2+dfsg1/debian/rules
--- libsdl2-2.0.2+dfsg1/debian/rules 2014-11-27 17:53:32.000000000 +0000
+++ libsdl2-2.0.2+dfsg1/debian/rules 2014-11-27 21:41:19.000000000 +0000
@@ -2,8 +2,10 @@
SHLIBVER = 2.0.0
-DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+MIR_SUPPORTED_ARCH := i386 amd64 armhf
confflags = --disable-rpath --enable-sdl-dlopen --disable-loadso \
--disable-nas --disable-esd --disable-arts \
@@ -33,6 +35,9 @@
confflags += --disable--video-opengles
endif
+ifneq (,$(filter $(MIR_SUPPORTED_ARCH),$(DEB_HOST_ARCH)))
+ confflags += --enable-video-mir --enable-mir-shared
+endif
%:
dh $@ --with autoreconf --parallel
|