Ravenports generated: 22 Sep 2024 04:10
[ravenports.git] / bucket_13 / sdl1
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               sdl1
4 VERSION=                1.2.15
5 REVISION=               2
6 KEYWORDS=               devel
7 VARIANTS=               std
8 SDESC[std]=             Cross-platform multimedia development API
9 HOMEPAGE=               http://www.libsdl.org/
10 CONTACT=                nobody
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            http://www.libsdl.org/release/
14                         SF/libsdl/SDL/1.2.15
15 DISTFILE[1]=            SDL-1.2.15.tar.gz:main
16 DF_INDEX=               1
17 SPKGS[std]=             set
18                         primary
19                         docs
20                         examples
21                         man
22                         dev
23
24 OPTIONS_AVAILABLE=      AALIB OSS SNDIO PULSEAUDIO OPENGL X11
25 OPTIONS_STANDARD=       AALIB OSS SNDIO PULSEAUDIO OPENGL X11
26 OPTGROUP_UNLIMITED=     AUDIO
27 OPTDESCR[AUDIO]=        Audio Support
28 OPTGROUP[AUDIO]=        AALIB OSS SNDIO PULSEAUDIO
29 OPT_ON[freebsd]=        OSS
30 OPT_ON[all]=            AALIB OPENGL X11
31 OPT_ON[dragonfly]=      OSS
32
33 BUILD_DEPENDS=          nasm:primary:std
34
35 USES=                   cpe gmake libtool pkgconfig iconv fbsd10fix
36
37 DISTNAME=               SDL-1.2.15
38
39 LICENSE=                LGPL21+:primary
40 LICENSE_TERMS=          primary:{{WRKDIR}}/TERMS
41 LICENSE_FILE=           LGPL21+:{{WRKSRC}}/COPYING
42 LICENSE_AWK=            TERMS:"SDL_config"
43 LICENSE_SOURCE=         TERMS:{{WRKSRC}}/src/SDL.c
44 LICENSE_SCHEME=         solo
45
46 CPE_PRODUCT=            simple_directmedia_layer
47 CPE_VENDOR=             libsdl
48 FPC_EQUIVALENT=         devel/sdl12
49
50 MUST_CONFIGURE=         gnu
51 CONFIGURE_ARGS=         --disable-alsa
52                         --disable-alsatest
53                         --disable-arts
54                         --disable-video-directfb
55                         --disable-video-ggi
56 CONFIGURE_ENV=          ac_cv_header_libusbhid_h=no
57
58 [OPENGL].BUILDRUN_DEPENDS_ON=           libglvnd:primary:std
59 [OPENGL].BUILD_DEPENDS_ON=              libglvnd:dev:std
60 [OPENGL].CONFIGURE_ENABLE_BOTH=         video-opengl
61
62 [SNDIO].BUILDRUN_DEPENDS_ON=            sndio:primary:std
63 [SNDIO].BUILD_DEPENDS_ON=               sndio:dev:std
64 [SNDIO].CONFIGURE_ENABLE_BOTH=          sndio
65
66 [AALIB].BUILDRUN_DEPENDS_ON=            aalib:primary:std
67 [AALIB].BUILD_DEPENDS_ON=               aalib:dev:std
68 [AALIB].CONFIGURE_ENABLE_BOTH=          video-aalib
69
70 [PULSEAUDIO].BROKEN_ON=                 not yet implemented
71
72 [OSS].CONFIGURE_ENABLE_BOTH=            oss
73
74 [X11].CONFIGURE_ENABLE_BOTH=            video-x11
75 [X11].XORG_COMPONENTS_ON=               x11
76                                         xrender
77                                         xrandr
78                                         xext
79
80 post-patch:
81         ${REINPLACE_CMD} -e '/EXTRA_LDFLAGS/s/-liconv/${ICONV_LIB}/' \
82                 ${WRKSRC}/configure
83
84 post-patch-SNDIO-ON:
85         @${MKDIR} ${WRKSRC}/src/audio/sndio
86         ${CP} ${FILESDIR}/SDL_sndioaudio.* ${WRKSRC}/src/audio/sndio
87
88 post-install:
89         @${MKDIR} ${STAGEDIR}${STD_DOCDIR} ${STAGEDIR}${STD_EXAMPLESDIR}
90 .for doc in BUGS CREDITS README README-SDL.txt WhatsNew docs.html
91         ${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${STD_DOCDIR}/
92 .endfor
93         (cd ${WRKSRC} && ${COPYTREE_SHARE} docs \
94                 ${STAGEDIR}${STD_DOCDIR}/ "! -regex .*/man3.*")
95 .for exam in test/*.c test/*.bmp test/*.dat test/*.xbm test/*.wav
96         ${INSTALL_DATA} ${WRKSRC}/${exam} ${STAGEDIR}${STD_EXAMPLESDIR}/
97 .endfor
98         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libSDL-1.2.so.0
99
100 [FILE:385:descriptions/desc.primary]
101 The SDL library (series 1) is designed to make it easy to write games that
102 run on UNIX, Win32 and BeOS using the various native high-performance media
103 interfaces, (for video, audio, etc) and presenting a single source-code
104 level API to your application.  This is a fairly low level API, but using
105 this, completely portable applications can be written with a great deal of
106 flexibility.
107
108
109 [FILE:96:distinfo]
110 d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00      3920622 SDL-1.2.15.tar.gz
111
112
113 [FILE:59:manifests/plist.primary]
114 bin/sdl-config
115 lib/
116  libSDL-1.2.so.0
117  libSDL-1.2.so.0.11.4
118
119
120 [FILE:3283:manifests/plist.man]
121 share/man/man3/
122  SDLKey.3
123  SDL_ActiveEvent.3
124  SDL_AddTimer.3
125  SDL_AudioCVT.3
126  SDL_AudioSpec.3
127  SDL_BlitSurface.3
128  SDL_BuildAudioCVT.3
129  SDL_CD.3
130  SDL_CDClose.3
131  SDL_CDEject.3
132  SDL_CDName.3
133  SDL_CDNumDrives.3
134  SDL_CDOpen.3
135  SDL_CDPause.3
136  SDL_CDPlay.3
137  SDL_CDPlayTracks.3
138  SDL_CDResume.3
139  SDL_CDStatus.3
140  SDL_CDStop.3
141  SDL_CDtrack.3
142  SDL_CloseAudio.3
143  SDL_Color.3
144  SDL_CondBroadcast.3
145  SDL_CondSignal.3
146  SDL_CondWait.3
147  SDL_CondWaitTimeout.3
148  SDL_ConvertAudio.3
149  SDL_ConvertSurface.3
150  SDL_CreateCond.3
151  SDL_CreateCursor.3
152  SDL_CreateMutex.3
153  SDL_CreateRGBSurface.3
154  SDL_CreateRGBSurfaceFrom.3
155  SDL_CreateSemaphore.3
156  SDL_CreateThread.3
157  SDL_CreateYUVOverlay.3
158  SDL_Delay.3
159  SDL_DestroyCond.3
160  SDL_DestroyMutex.3
161  SDL_DestroySemaphore.3
162  SDL_DisplayFormat.3
163  SDL_DisplayFormatAlpha.3
164  SDL_DisplayYUVOverlay.3
165  SDL_EnableKeyRepeat.3
166  SDL_EnableUNICODE.3
167  SDL_Event.3
168  SDL_EventState.3
169  SDL_ExposeEvent.3
170  SDL_FillRect.3
171  SDL_Flip.3
172  SDL_FreeCursor.3
173  SDL_FreeSurface.3
174  SDL_FreeWAV.3
175  SDL_FreeYUVOverlay.3
176  SDL_GL_GetAttribute.3
177  SDL_GL_GetProcAddress.3
178  SDL_GL_LoadLibrary.3
179  SDL_GL_SetAttribute.3
180  SDL_GL_SwapBuffers.3
181  SDL_GLattr.3
182  SDL_GetAppState.3
183  SDL_GetAudioStatus.3
184  SDL_GetClipRect.3
185  SDL_GetCursor.3
186  SDL_GetError.3
187  SDL_GetEventFilter.3
188  SDL_GetGamma.3
189  SDL_GetGammaRamp.3
190  SDL_GetKeyName.3
191  SDL_GetKeyState.3
192  SDL_GetModState.3
193  SDL_GetMouseState.3
194  SDL_GetRGB.3
195  SDL_GetRGBA.3
196  SDL_GetRelativeMouseState.3
197  SDL_GetThreadID.3
198  SDL_GetTicks.3
199  SDL_GetVideoInfo.3
200  SDL_GetVideoSurface.3
201  SDL_Init.3
202  SDL_InitSubSystem.3
203  SDL_JoyAxisEvent.3
204  SDL_JoyBallEvent.3
205  SDL_JoyButtonEvent.3
206  SDL_JoyHatEvent.3
207  SDL_JoystickClose.3
208  SDL_JoystickEventState.3
209  SDL_JoystickGetAxis.3
210  SDL_JoystickGetBall.3
211  SDL_JoystickGetButton.3
212  SDL_JoystickGetHat.3
213  SDL_JoystickIndex.3
214  SDL_JoystickName.3
215  SDL_JoystickNumAxes.3
216  SDL_JoystickNumBalls.3
217  SDL_JoystickNumButtons.3
218  SDL_JoystickNumHats.3
219  SDL_JoystickOpen.3
220  SDL_JoystickOpened.3
221  SDL_JoystickUpdate.3
222  SDL_KeyboardEvent.3
223  SDL_KillThread.3
224  SDL_ListModes.3
225  SDL_LoadBMP.3
226  SDL_LoadWAV.3
227  SDL_LockAudio.3
228  SDL_LockSurface.3
229  SDL_LockYUVOverlay.3
230  SDL_MapRGB.3
231  SDL_MapRGBA.3
232  SDL_MixAudio.3
233  SDL_MouseButtonEvent.3
234  SDL_MouseMotionEvent.3
235  SDL_NumJoysticks.3
236  SDL_OpenAudio.3
237  SDL_Overlay.3
238  SDL_Palette.3
239  SDL_PauseAudio.3
240  SDL_PeepEvents.3
241  SDL_PixelFormat.3
242  SDL_PollEvent.3
243  SDL_PumpEvents.3
244  SDL_PushEvent.3
245  SDL_Quit.3
246  SDL_QuitEvent.3
247  SDL_QuitSubSystem.3
248  SDL_RWFromFile.3
249  SDL_Rect.3
250  SDL_RemoveTimer.3
251  SDL_ResizeEvent.3
252  SDL_SaveBMP.3
253  SDL_SemPost.3
254  SDL_SemTryWait.3
255  SDL_SemValue.3
256  SDL_SemWait.3
257  SDL_SemWaitTimeout.3
258  SDL_SetAlpha.3
259  SDL_SetClipRect.3
260  SDL_SetColorKey.3
261  SDL_SetColors.3
262  SDL_SetCursor.3
263  SDL_SetEventFilter.3
264  SDL_SetGamma.3
265  SDL_SetGammaRamp.3
266  SDL_SetModState.3
267  SDL_SetPalette.3
268  SDL_SetTimer.3
269  SDL_SetVideoMode.3
270  SDL_ShowCursor.3
271  SDL_Surface.3
272  SDL_SysWMEvent.3
273  SDL_ThreadID.3
274  SDL_UnlockAudio.3
275  SDL_UnlockSurface.3
276  SDL_UnlockYUVOverlay.3
277  SDL_UpdateRect.3
278  SDL_UpdateRects.3
279  SDL_UserEvent.3
280  SDL_VideoDriverName.3
281  SDL_VideoInfo.3
282  SDL_VideoModeOK.3
283  SDL_WM_GetCaption.3
284  SDL_WM_GrabInput.3
285  SDL_WM_IconifyWindow.3
286  SDL_WM_SetCaption.3
287  SDL_WM_SetIcon.3
288  SDL_WM_ToggleFullScreen.3
289  SDL_WaitEvent.3
290  SDL_WaitThread.3
291  SDL_WarpMouse.3
292  SDL_WasInit.3
293  SDL_keysym.3
294  SDL_mutexP.3
295  SDL_mutexV.3
296
297
298 [FILE:531:manifests/plist.dev]
299 include/SDL/
300  SDL.h
301  SDL_active.h
302  SDL_audio.h
303  SDL_byteorder.h
304  SDL_cdrom.h
305  SDL_config.h
306  SDL_cpuinfo.h
307  SDL_endian.h
308  SDL_error.h
309  SDL_events.h
310  SDL_getenv.h
311  SDL_joystick.h
312  SDL_keyboard.h
313  SDL_keysym.h
314  SDL_loadso.h
315  SDL_main.h
316  SDL_mouse.h
317  SDL_mutex.h
318  SDL_name.h
319  SDL_opengl.h
320  SDL_platform.h
321  SDL_quit.h
322  SDL_rwops.h
323  SDL_stdinc.h
324  SDL_syswm.h
325  SDL_thread.h
326  SDL_timer.h
327  SDL_types.h
328  SDL_version.h
329  SDL_video.h
330  begin_code.h
331  close_code.h
332 lib/
333  libSDL.a
334  libSDL.so
335  libSDLmain.a
336 lib/pkgconfig/sdl.pc
337 share/aclocal/sdl.m4
338
339
340 [FILE:541:patches/patch-Makefile.in]
341 --- Makefile.in.orig    2012-01-19 06:30:05 UTC
342 +++ Makefile.in
343 @@ -49,7 +49,7 @@ LT_AGE      = @LT_AGE@
344  LT_CURRENT  = @LT_CURRENT@
345  LT_RELEASE  = @LT_RELEASE@
346  LT_REVISION = @LT_REVISION@
347 -LT_LDFLAGS  = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
348 +LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
349  
350  all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
351  
352
353
354 [FILE:4283:patches/patch-configure]
355 --- configure.orig      2012-01-19 06:30:12 UTC
356 +++ configure
357 @@ -2039,12 +2039,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
358  
359  ac_config_headers="$ac_config_headers include/SDL_config.h"
360  
361 -
362 -cat >>confdefs.h <<\_ACEOF
363 -#define _GNU_SOURCE 1
364 -_ACEOF
365 -
366 -
367  ac_aux_dir=
368  for ac_dir in $srcdir/build-scripts; do
369    if test -f "$ac_dir/install-sh"; then
370 @@ -4209,7 +4203,7 @@ darwin* | rhapsody*)
371    lt_cv_deplibs_check_method=pass_all
372    ;;
373  
374 -freebsd* | dragonfly*)
375 +freebsd* | dragonfly* | midnight*)
376    if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
377      case $host_cpu in
378      i*86 )
379 @@ -8411,7 +8405,7 @@ if test -z "$aix_libpath"; then aix_libp
380        ;;
381  
382      # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
383 -    freebsd* | dragonfly*)
384 +    freebsd* | dragonfly* | midnight*)
385        archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
386        hardcode_libdir_flag_spec='-R$libdir'
387        hardcode_direct=yes
388 @@ -9290,7 +9284,7 @@ freebsd1*)
389    dynamic_linker=no
390    ;;
391  
392 -freebsd* | dragonfly*)
393 +freebsd* | dragonfly* | midnight*)
394    # DragonFly does not have aout.  When/if they implement a new
395    # versioning mechanism, adjust this.
396    if test -x /usr/bin/objformat; then
397 @@ -13308,7 +13302,7 @@ if test -z "$aix_libpath"; then aix_libp
398          archive_cmds_need_lc_CXX=no
399          ;;
400  
401 -      freebsd* | dragonfly*)
402 +      freebsd* | dragonfly* | midnight*)
403          # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
404          # conventions
405          ld_shlibs_CXX=yes
406 @@ -14258,7 +14252,7 @@ echo $ECHO_N "checking for $compiler opt
407             ;;
408         esac
409         ;;
410 -      freebsd* | dragonfly*)
411 +      freebsd* | dragonfly* | midnight*)
412         # FreeBSD uses GNU C++
413         ;;
414        hpux9* | hpux10* | hpux11*)
415 @@ -15062,7 +15056,7 @@ freebsd1*)
416    dynamic_linker=no
417    ;;
418  
419 -freebsd* | dragonfly*)
420 +freebsd* | dragonfly* | midnight*)
421    # DragonFly does not have aout.  When/if they implement a new
422    # versioning mechanism, adjust this.
423    if test -x /usr/bin/objformat; then
424 @@ -15826,7 +15820,7 @@ case "$host" in
425          BASE_LDFLAGS="-mno-cygwin"
426          ;;
427      *)
428 -        BASE_CFLAGS="-D_GNU_SOURCE=1"
429 +        BASE_CFLAGS=""
430          BASE_LDFLAGS=""
431          ;;
432  esac
433 @@ -20999,6 +20993,16 @@ _ACEOF
434          fi
435      fi
436  }
437
438 +CheckSndio()
439 +{
440 +if test "x${enable_sndio}" = "xyes"; then :
441 +  SOURCES="$SOURCES $srcdir/src/audio/sndio/SDL_sndioaudio.c"
442 +  EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_AUDIO_DRIVER_SNDIO=1"
443 +  EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsndio"
444 +  have_audio=yes
445 +fi
446 +}
447  
448  CheckPulseAudio()
449  {
450 @@ -26934,7 +26938,7 @@ fi
451  # causes Carbon.p complaints?
452  #            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
453              ;;
454 -        *-*-freebsd*|*-*-dragonfly*)
455 +        *-*-freebsd*|*-*-dragonfly*|*-*-midnight*)
456              pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
457              pthread_lib="-pthread"
458              ;;
459 @@ -29518,7 +29522,7 @@ _ACEOF
460              have_timers=yes
461          fi
462          ;;
463 -    *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
464 +    *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*|*-*-midnight*)
465          case "$host" in
466              *-*-linux*)         ARCH=linux ;;
467              *-*-uclinux*)       ARCH=linux ;;
468 @@ -29529,6 +29533,7 @@ _ACEOF
469              *-*-bsdi*)          ARCH=bsdi ;;
470              *-*-freebsd*)       ARCH=freebsd ;;
471              *-*-dragonfly*)     ARCH=freebsd ;;
472 +            *-*-midnightbsd*)   ARCH=freebsd ;;
473              *-*-netbsd*)        ARCH=netbsd ;;
474              *-*-openbsd*)       ARCH=openbsd ;;
475              *-*-sysv5*)         ARCH=sysv5 ;;
476 @@ -29551,6 +29556,7 @@ _ACEOF
477          CheckALSA
478          CheckARTSC
479          CheckESD
480 +        CheckSndio
481          CheckPulseAudio
482          CheckNAS
483          CheckX11
484 @@ -29628,7 +29634,7 @@ _ACEOF
485                  SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
486                  have_cdrom=yes
487              ;;
488 -            *freebsd*)
489 +            *freebsd*|*midnight*)
490                  cat >>confdefs.h <<\_ACEOF
491  #define SDL_CDROM_FREEBSD 1
492  _ACEOF
493
494
495 [FILE:474:patches/patch-sdl-config.in]
496 #
497 # Temporary hack to provide iconv include directory is well
498 # (sdl explicitly includes iconv.h)
499 #
500 --- sdl-config.in.orig  2012-01-19 06:30:06 UTC
501 +++ sdl-config.in
502 @@ -42,7 +42,7 @@ while test $# -gt 0; do
503        echo @SDL_VERSION@
504        ;;
505      --cflags)
506 -      echo -I@includedir@/SDL @SDL_CFLAGS@
507 +      echo -I@includedir@/SDL -I@includedir@ @SDL_CFLAGS@
508        ;;
509  @ENABLE_SHARED_TRUE@    --libs)
510  @ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
511
512
513 [FILE:276:patches/patch-sdl.pc.in]
514 --- sdl.pc.in.orig      2012-01-19 06:30:06 UTC
515 +++ sdl.pc.in
516 @@ -12,4 +12,4 @@ Requires:
517  Conflicts:
518  Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
519  Libs.private: @SDL_STATIC_LIBS@
520 -Cflags: -I${includedir}/SDL @SDL_CFLAGS@
521 +Cflags: -I${includedir}/SDL -I${includedir} @SDL_CFLAGS@
522
523
524 [FILE:478:patches/patch-src_audio_SDL__audio.c]
525 $OpenBSD: patch-src_audio_SDL_audio_c,v 1.17 2012/03/02 09:10:38 dcoppa Exp $
526 --- src/audio/SDL_audio.c.orig  2012-01-19 06:30:06 UTC
527 +++ src/audio/SDL_audio.c
528 @@ -36,12 +36,16 @@
529  
530  /* Available audio drivers */
531  static AudioBootStrap *bootstrap[] = {
532 +
533  #if SDL_AUDIO_DRIVER_PULSE
534         &PULSE_bootstrap,
535  #endif
536  #if SDL_AUDIO_DRIVER_ALSA
537         &ALSA_bootstrap,
538  #endif
539 +#if SDL_AUDIO_DRIVER_SNDIO
540 +       &SNDIO_bootstrap,
541 +#endif
542  #if SDL_AUDIO_DRIVER_BSD
543         &BSD_AUDIO_bootstrap,
544  #endif
545
546
547 [FILE:449:patches/patch-src_audio_SDL__sysaudio.h]
548 $OpenBSD: patch-src_audio_SDL_sysaudio_h,v 1.6 2012/03/02 09:10:38 dcoppa Exp $
549 --- src/audio/SDL_sysaudio.h.orig       2012-01-19 06:30:06 UTC
550 +++ src/audio/SDL_sysaudio.h
551 @@ -105,6 +105,9 @@ typedef struct AudioBootStrap {
552  #if SDL_AUDIO_DRIVER_BSD
553  extern AudioBootStrap BSD_AUDIO_bootstrap;
554  #endif
555 +#if SDL_AUDIO_DRIVER_SNDIO
556 +extern AudioBootStrap SNDIO_bootstrap;
557 +#endif
558  #if SDL_AUDIO_DRIVER_PULSE
559  extern AudioBootStrap PULSE_bootstrap;
560  #endif
561
562
563 [FILE:469:patches/patch-src_cdrom_freebsd_SDL_syscdrom.c]
564 --- src/cdrom/freebsd/SDL_syscdrom.c.orig       2012-01-19 06:30:06 UTC
565 +++ src/cdrom/freebsd/SDL_syscdrom.c
566 @@ -188,7 +188,7 @@ int  SDL_SYS_CDInit(void)
567                         char *insert;
568                         exists = 1;
569                         for ( j=checklist[i][1]; exists; ++j ) {
570 -                               SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
571 +                               SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
572                                 insert = SDL_strchr(drive, '?');
573                                 if ( insert != NULL ) {
574                                         *insert = j;
575
576
577 [FILE:7860:patches/patch-src_joystick_bsd_SDL_sysjoystick.c]
578 --- src/joystick/bsd/SDL_sysjoystick.c.orig     2012-01-19 06:30:06 UTC
579 +++ src/joystick/bsd/SDL_sysjoystick.c
580 @@ -82,7 +82,9 @@
581  #define MAX_JOYS       (MAX_UHID_JOYS + MAX_JOY_JOYS)
582  
583  struct report {
584 -#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
585 +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
586 +       void *buf;                      /* Buffer */
587 +#elif defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
588         struct  usb_gen_descriptor *buf;        /* Buffer */
589  #else
590         struct  usb_ctl_report *buf;    /* Buffer */
591 @@ -148,8 +150,10 @@ static char *joydevnames[MAX_JOYS];
592  static int     report_alloc(struct report *, struct report_desc *, int);
593  static void    report_free(struct report *);
594  
595 -#if defined(USBHID_UCR_DATA) || defined(__FreeBSD_kernel__)
596 +#if defined(USBHID_UCR_DATA) || (defined(__FreeBSD_kernel__) && __FreeBSD_kernel_version <= 800063)
597  #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
598 +#elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000))
599 +#define REP_BUF_DATA(rep) ((rep)->buf)
600  #elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
601  #define REP_BUF_DATA(rep) ((rep)->buf->ugd_data)
602  #else
603 @@ -411,47 +415,47 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joy
604         struct joystick gameport;
605   
606         if (joy->hwdata->type == BSDJOY_JOY) {
607 -               if (read(joy->hwdata->fd, &gameport, sizeof gameport) != sizeof gameport)
608 -                       return;
609 -               if (abs(joy->hwdata->x - gameport.x) > 8) {
610 -                       joy->hwdata->x = gameport.x;
611 -                       if (joy->hwdata->x < joy->hwdata->xmin) {
612 -                               joy->hwdata->xmin = joy->hwdata->x;
613 -                       }
614 -                       if (joy->hwdata->x > joy->hwdata->xmax) {
615 -                               joy->hwdata->xmax = joy->hwdata->x;
616 -                       }
617 -                       if (joy->hwdata->xmin == joy->hwdata->xmax) {
618 -                               joy->hwdata->xmin--;
619 -                               joy->hwdata->xmax++;
620 -                       }
621 -                       v = (Sint32)joy->hwdata->x;
622 -                       v -= (joy->hwdata->xmax + joy->hwdata->xmin + 1)/2;
623 -                       v *= 32768/((joy->hwdata->xmax - joy->hwdata->xmin + 1)/2);
624 -                       SDL_PrivateJoystickAxis(joy, 0, v);
625 -               }
626 -               if (abs(joy->hwdata->y - gameport.y) > 8) {
627 -                       joy->hwdata->y = gameport.y;
628 -                       if (joy->hwdata->y < joy->hwdata->ymin) {
629 -                               joy->hwdata->ymin = joy->hwdata->y;
630 +               while (read(joy->hwdata->fd, &gameport, sizeof gameport) == sizeof gameport) {
631 +                       if (abs(joy->hwdata->x - gameport.x) > 8) {
632 +                               joy->hwdata->x = gameport.x;
633 +                               if (joy->hwdata->x < joy->hwdata->xmin) {
634 +                                       joy->hwdata->xmin = joy->hwdata->x;
635 +                               }
636 +                               if (joy->hwdata->x > joy->hwdata->xmax) {
637 +                                       joy->hwdata->xmax = joy->hwdata->x;
638 +                               }
639 +                               if (joy->hwdata->xmin == joy->hwdata->xmax) {
640 +                                       joy->hwdata->xmin--;
641 +                                       joy->hwdata->xmax++;
642 +                               }
643 +                               v = (Sint32)joy->hwdata->x;
644 +                               v -= (joy->hwdata->xmax + joy->hwdata->xmin + 1)/2;
645 +                               v *= 32768/((joy->hwdata->xmax - joy->hwdata->xmin + 1)/2);
646 +                               SDL_PrivateJoystickAxis(joy, 0, v);
647 +                       }
648 +                       if (abs(joy->hwdata->y - gameport.y) > 8) {
649 +                               joy->hwdata->y = gameport.y;
650 +                               if (joy->hwdata->y < joy->hwdata->ymin) {
651 +                                       joy->hwdata->ymin = joy->hwdata->y;
652 +                               }
653 +                               if (joy->hwdata->y > joy->hwdata->ymax) {
654 +                                       joy->hwdata->ymax = joy->hwdata->y;
655 +                               }
656 +                               if (joy->hwdata->ymin == joy->hwdata->ymax) {
657 +                                       joy->hwdata->ymin--;
658 +                                       joy->hwdata->ymax++;
659 +                               }
660 +                               v = (Sint32)joy->hwdata->y;
661 +                               v -= (joy->hwdata->ymax + joy->hwdata->ymin + 1)/2;
662 +                               v *= 32768/((joy->hwdata->ymax - joy->hwdata->ymin + 1)/2);
663 +                               SDL_PrivateJoystickAxis(joy, 1, v);
664                         }
665 -                       if (joy->hwdata->y > joy->hwdata->ymax) {
666 -                               joy->hwdata->ymax = joy->hwdata->y;
667 +                       if (gameport.b1 != joy->buttons[0]) {
668 +                               SDL_PrivateJoystickButton(joy, 0, gameport.b1);
669                         }
670 -                       if (joy->hwdata->ymin == joy->hwdata->ymax) {
671 -                               joy->hwdata->ymin--;
672 -                               joy->hwdata->ymax++;
673 +                       if (gameport.b2 != joy->buttons[1]) {
674 +                               SDL_PrivateJoystickButton(joy, 1, gameport.b2);
675                         }
676 -                       v = (Sint32)joy->hwdata->y;
677 -                       v -= (joy->hwdata->ymax + joy->hwdata->ymin + 1)/2;
678 -                       v *= 32768/((joy->hwdata->ymax - joy->hwdata->ymin + 1)/2);
679 -                       SDL_PrivateJoystickAxis(joy, 1, v);
680 -               }
681 -               if (gameport.b1 != joy->buttons[0]) {
682 -                       SDL_PrivateJoystickButton(joy, 0, gameport.b1);
683 -               }
684 -               if (gameport.b2 != joy->buttons[1]) {
685 -                       SDL_PrivateJoystickButton(joy, 1, gameport.b2);
686                 }
687                 return;
688         }
689 @@ -459,65 +463,61 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joy
690         
691         rep = &joy->hwdata->inreport;
692  
693 -       if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
694 -               return;
695 -       }
696 +       while (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) == rep->size) {
697  #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
698 -       hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
699 +               hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
700  #else
701 -       hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
702 +               hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
703  #endif
704 -       if (hdata == NULL) {
705 -               fprintf(stderr, "%s: Cannot start HID parser\n",
706 -                   joy->hwdata->path);
707 -               return;
708 -       }
709 +               if (hdata == NULL) {
710 +                       /*fprintf(stderr, "%s: Cannot start HID parser\n", joy->hwdata->path);*/
711 +                       continue;
712 +               }
713  
714 -       for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) {
715 -               switch (hitem.kind) {
716 -               case hid_input:
717 -                       switch (HID_PAGE(hitem.usage)) {
718 -                       case HUP_GENERIC_DESKTOP: {
719 -                           unsigned usage = HID_USAGE(hitem.usage);
720 -                           int joyaxe = usage_to_joyaxe(usage);
721 -                           if (joyaxe >= 0) {
722 -                               naxe = joy->hwdata->axis_map[joyaxe];
723 -                               /* scaleaxe */
724 -                               v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
725 -                                                        &hitem);
726 -                               v -= (hitem.logical_maximum + hitem.logical_minimum + 1)/2;
727 -                               v *= 32768/((hitem.logical_maximum - hitem.logical_minimum + 1)/2);
728 -                               if (v != joy->axes[naxe]) {
729 -                                   SDL_PrivateJoystickAxis(joy, naxe, v);
730 +               for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) {
731 +                       switch (hitem.kind) {
732 +                       case hid_input:
733 +                               switch (HID_PAGE(hitem.usage)) {
734 +                               case HUP_GENERIC_DESKTOP: {
735 +                                       unsigned usage = HID_USAGE(hitem.usage);
736 +                                       int joyaxe = usage_to_joyaxe(usage);
737 +                                       if (joyaxe >= 0) {
738 +                                       naxe = joy->hwdata->axis_map[joyaxe];
739 +                                       /* scaleaxe */
740 +                                       v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
741 +                                                                &hitem);
742 +                                       v -= (hitem.logical_maximum + hitem.logical_minimum + 1)/2;
743 +                                       v *= 32768/((hitem.logical_maximum - hitem.logical_minimum + 1)/2);
744 +                                       if (v != joy->axes[naxe]) {
745 +                                               SDL_PrivateJoystickAxis(joy, naxe, v);
746 +                                       }
747 +                                       } else if (usage == HUG_HAT_SWITCH) {
748 +                                       v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
749 +                                                                &hitem);
750 +                                       SDL_PrivateJoystickHat(joy, 0,
751 +                                               hatval_to_sdl(v)-hitem.logical_minimum);
752 +                                       }
753 +                                       break;
754                                 }
755 -                           } else if (usage == HUG_HAT_SWITCH) {
756 -                               v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
757 -                                                        &hitem);
758 -                               SDL_PrivateJoystickHat(joy, 0,
759 -                                       hatval_to_sdl(v)-hitem.logical_minimum);
760 -                           }
761 -                           break;
762 -                       }
763 -                       case HUP_BUTTON:
764 -                               v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
765 -                                   &hitem);
766 -                               if (joy->buttons[nbutton] != v) {
767 -                                       SDL_PrivateJoystickButton(joy,
768 -                                           nbutton, v);
769 +                               case HUP_BUTTON:
770 +                                       v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
771 +                                               &hitem);
772 +                                       if (joy->buttons[nbutton] != v) {
773 +                                               SDL_PrivateJoystickButton(joy,
774 +                                                       nbutton, v);
775 +                                       }
776 +                                       nbutton++;
777 +                                       break;
778 +                               default:
779 +                                       continue;
780                                 }
781 -                               nbutton++;
782                                 break;
783                         default:
784 -                               continue;
785 +                               break;
786                         }
787 -                       break;
788 -               default:
789 -                       break;
790                 }
791 +               hid_end_parse(hdata);
792         }
793 -       hid_end_parse(hdata);
794 -
795 -       return;
796  }
797  
798  /* Function to close a joystick after use */
799 @@ -582,8 +582,12 @@ report_alloc(struct report *r, struct re
800         r->size = len;
801  
802         if (r->size > 0) {
803 +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
804 +               r->buf = SDL_malloc(r->size);
805 +#else
806                 r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) +
807                     r->size);
808 +#endif
809                 if (r->buf == NULL) {
810                         SDL_OutOfMemory();
811                         return (-1);
812
813
814 [FILE:498:patches/patch-src_video_x11_SDL_x11sym.h]
815 --- src/video/x11/SDL_x11sym.h.orig     2012-01-19 06:30:06 UTC
816 +++ src/video/x11/SDL_x11sym.h
817 @@ -165,7 +165,7 @@ SDL_X11_SYM(Bool,XShmQueryExtension,(Dis
818   */
819  #ifdef LONG64
820  SDL_X11_MODULE(IO_32BIT)
821 -SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
822 +SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
823  SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
824  #endif
825  
826
827
828 [FILE:5310:files/SDL_sndioaudio.c]
829 /*
830  * Copyright (c) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
831  *
832  * Permission to use, copy, modify, and distribute this software for any
833  * purpose with or without fee is hereby granted, provided that the above
834  * copyright notice and this permission notice appear in all copies.
835  *
836  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
837  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
838  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
839  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
840  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
841  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
842  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
843  */
844
845 #include "SDL_config.h"
846
847 /* Allow access to a raw mixing buffer */
848
849 #ifdef HAVE_SIGNAL_H
850 #include <signal.h>
851 #endif
852 #include <unistd.h>
853
854 #include "SDL_timer.h"
855 #include "SDL_audio.h"
856 #include "../SDL_audiomem.h"
857 #include "../SDL_audio_c.h"
858 #include "../SDL_audiodev_c.h"
859 #include "SDL_sndioaudio.h"
860
861 /* The tag name used by sndio audio */
862 #define SNDIO_DRIVER_NAME         "sndio"
863
864 /* Audio driver functions */
865 static int SNDIO_OpenAudio(_THIS, SDL_AudioSpec *spec);
866 static void SNDIO_WaitAudio(_THIS);
867 static void SNDIO_PlayAudio(_THIS);
868 static Uint8 *SNDIO_GetAudioBuf(_THIS);
869 static void SNDIO_CloseAudio(_THIS);
870
871 /* Audio driver bootstrap functions */
872
873 static int Audio_Available(void)
874 {
875         struct sio_hdl *this_hdl;
876         int available = 0;
877
878         if ( (this_hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0)) != NULL ) {
879                 sio_close(this_hdl);
880                 available = 1;
881         }
882
883         return available;
884 }
885
886 static void Audio_DeleteDevice(SDL_AudioDevice *device)
887 {
888         SDL_free(device->hidden);
889         SDL_free(device);
890 }
891
892 static SDL_AudioDevice *Audio_CreateDevice(int devindex)
893 {
894         SDL_AudioDevice *this;
895
896         /* Initialize all variables that we clean on shutdown */
897         this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
898         if ( this ) {
899                 SDL_memset(this, 0, (sizeof *this));
900                 this->hidden = (struct SDL_PrivateAudioData *)
901                                 SDL_malloc((sizeof *this->hidden));
902         }
903         if ( (this == NULL) || (this->hidden == NULL) ) {
904                 SDL_OutOfMemory();
905                 if ( this ) {
906                         SDL_free(this);
907                 }
908                 return(0);
909         }
910         SDL_memset(this->hidden, 0, (sizeof *this->hidden));
911
912         /* Set the function pointers */
913         this->OpenAudio = SNDIO_OpenAudio;
914         this->WaitAudio = SNDIO_WaitAudio;
915         this->PlayAudio = SNDIO_PlayAudio;
916         this->GetAudioBuf = SNDIO_GetAudioBuf;
917         this->CloseAudio = SNDIO_CloseAudio;
918
919         this->free = Audio_DeleteDevice;
920
921         hdl = NULL;
922
923         return this;
924 }
925
926 AudioBootStrap SNDIO_bootstrap = {
927         SNDIO_DRIVER_NAME, "sndio",
928         Audio_Available, Audio_CreateDevice
929 };
930
931
932
933 /* This function waits until it is possible to write a full sound buffer */
934 static void SNDIO_WaitAudio(_THIS)
935 {
936         /* nothing, we're using the blocking api */
937 }
938
939 static void SNDIO_PlayAudio(_THIS)
940 {
941         int written;
942
943         /* Write the audio data */
944         written = sio_write(hdl, mixbuf, mixlen);
945         
946         /* If we couldn't write, assume fatal error for now */
947         if ( written == 0 ) {
948                 this->enabled = 0;
949         }
950 #ifdef DEBUG_AUDIO
951         fprintf(stderr, "Wrote %d bytes of audio data\n", written);
952 #endif
953 }
954
955 static Uint8 *SNDIO_GetAudioBuf(_THIS)
956 {
957         return(mixbuf);
958 }
959
960 static void SNDIO_CloseAudio(_THIS)
961 {
962         if ( mixbuf != NULL ) {
963                 SDL_FreeAudioMem(mixbuf);
964                 mixbuf = NULL;
965         }
966         if ( hdl != NULL ) {
967                 sio_close(hdl);
968                 hdl = NULL;
969         }
970 }
971
972 static int SNDIO_OpenAudio(_THIS, SDL_AudioSpec *spec)
973 {
974         struct sio_par par;
975
976         mixbuf = NULL;
977
978         if ((hdl = sio_open(NULL, SIO_PLAY, 0)) == NULL) {
979                 SDL_SetError("sio_open() failed");
980                 return(-1);
981         }
982
983         sio_initpar(&par);
984
985         switch (spec->format) {
986         case AUDIO_S16LSB:
987                 par.bits = 16;
988                 par.sig = 1;
989                 par.le = 1;
990                 break;
991         case AUDIO_S16MSB:
992                 par.bits = 16;
993                 par.sig = 1;
994                 par.le = 0;
995                 break;
996         case AUDIO_S8:
997                 par.bits = 8;
998                 par.sig = 1;
999                 break;
1000         case AUDIO_U16LSB:
1001                 par.bits = 16;
1002                 par.sig = 0;
1003                 par.le = 1;
1004                 break;
1005         case AUDIO_U16MSB:
1006                 par.bits = 16;
1007                 par.sig = 0;
1008                 par.le = 0;
1009                 break;
1010         case AUDIO_U8:
1011                 par.bits = 8;
1012                 par.sig = 0;
1013                 break;
1014         default:
1015                 SDL_SetError("SNDIO unknown format");
1016                 return(-1);
1017         }
1018
1019         par.rate = spec->freq;
1020         par.pchan = spec->channels;
1021         par.round = spec->samples;
1022         par.appbufsz = par.round * 2;
1023
1024         if (sio_setpar(hdl, &par) == 0) {
1025                 SDL_SetError("sio_setpar() failed");
1026                 return(-1);
1027         }
1028
1029         if (sio_getpar(hdl, &par) == 0) {
1030                 SDL_SetError("sio_getpar() failed");
1031                 return(-1);
1032         }
1033
1034         if (par.bits == 16) {
1035                 if (par.sig && par.le) {
1036                         spec->format = AUDIO_S16LSB;
1037                 } else if (par.sig && !par.le) {
1038                         spec->format = AUDIO_S16MSB;
1039                 } else if (!par.sig && par.le) {
1040                         spec->format = AUDIO_U16LSB;
1041                 } else 
1042                         spec->format = AUDIO_U16MSB;
1043         } else if (par.bits == 8) {
1044                 spec->format = par.sig ? AUDIO_S8 : AUDIO_U8;
1045         } else {
1046                 SDL_SetError("SNDIO couldn't configure a suitable format");
1047                 return(-1);
1048         }
1049
1050         spec->freq = par.rate;
1051         spec->channels = par.pchan;
1052         spec->samples = par.round;
1053
1054         SDL_CalculateAudioSpec(spec);
1055
1056         /* Allocate mixing buffer */
1057         mixlen = spec->size;
1058         mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
1059         if ( mixbuf == NULL ) {
1060                 return(-1);
1061         }
1062         SDL_memset(mixbuf, spec->silence, spec->size);
1063
1064         if ( sio_start(hdl) == 0 ) {
1065                 SDL_SetError("sio_start() failed");
1066                 return(-1);
1067         }
1068
1069         /* We're ready to rock and roll. :-) */
1070         return(0);
1071 }
1072
1073
1074 [FILE:1512:files/SDL_sndioaudio.h]
1075 /*
1076  * Copyright (c) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
1077  *
1078  * Permission to use, copy, modify, and distribute this software for any
1079  * purpose with or without fee is hereby granted, provided that the above
1080  * copyright notice and this permission notice appear in all copies.
1081  *
1082  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1083  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1084  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1085  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1086  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1087  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1088  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1089  */
1090
1091 #include "SDL_config.h"
1092
1093 #ifndef _SDL_sndioaudio_h
1094 #define _SDL_sndioaudio_h
1095
1096 #include <sndio.h>
1097
1098 #include "../SDL_sysaudio.h"
1099
1100 /* Hidden "this" pointer for the video functions */
1101 #define _THIS   SDL_AudioDevice *this
1102
1103 struct SDL_PrivateAudioData {
1104         /* The stream descriptor for the audio device */
1105         struct sio_hdl *hdl;
1106
1107         /* The parent process id, to detect when application quits */
1108         pid_t parent;
1109
1110         /* Raw mixing buffer */
1111         Uint8 *mixbuf;
1112         int    mixlen;
1113
1114 };
1115
1116 /* Old variable names */
1117 #define stream                  (this->hidden->stream)
1118 #define parent                  (this->hidden->parent)
1119 #define mixbuf                  (this->hidden->mixbuf)
1120 #define mixlen                  (this->hidden->mixlen)
1121 #define hdl                     (this->hidden->hdl)
1122
1123 #endif /* _SDL_sndioaudio_h */
1124
1125