Update of /cvsroot/fink/dists/10.4/unstable/main/finkinfo/games
In directory vz-cvs-3.sog:/tmp/cvs-serv15913

Modified Files:
        sdl.info sdl.patch 
Log Message:
New SDL revision, with fixes for clang building and more

Index: sdl.patch
===================================================================
RCS file: /cvsroot/fink/dists/10.4/unstable/main/finkinfo/games/sdl.patch,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- sdl.patch   1 Jun 2010 08:30:33 -0000       1.12
+++ sdl.patch   11 Jul 2011 17:32:03 -0000      1.13
@@ -1,18 +1,75 @@
-diff -ru SDL-1.2.14/sdl.m4 SDL-1.2.14-patched//sdl.m4
---- SDL-1.2.14/sdl.m4  2009-10-13 01:07:20.000000000 +0200
-+++ SDL-1.2.14-patched//sdl.m4 2010-05-10 23:58:38.000000000 +0200
-@@ -5,6 +5,8 @@
- # stolen from Manish Singh
- # Shamelessly stolen from Owen Taylor
+diff -ru SDL-1.2.14/build-scripts/fatbuild.sh 
SDL-1.2.14-patched/build-scripts/fatbuild.sh
+--- SDL-1.2.14/build-scripts/fatbuild.sh       2009-10-13 01:07:12.000000000 
+0200
++++ SDL-1.2.14-patched/build-scripts/fatbuild.sh       2011-07-11 
11:23:52.000000000 +0200
+@@ -70,6 +70,17 @@
+ CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
+ --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
  
-+# serial 1
++# They changed this to "darwin10" in Xcode 3.2 (Snow Leopard).
++GCCUSRPATH="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1"
++if [ ! -d "$GCCUSRPATH" ]; then
++    
GCCUSRPATH="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1"
++fi
 +
- dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
- dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
- dnl
-diff -ru SDL-1.2.14/src/cpuinfo/SDL_cpuinfo.c 
SDL-1.2.14-patched//src/cpuinfo/SDL_cpuinfo.c
++if [ ! -d "$GCCUSRPATH" ]; then
++    echo "Couldn't find any GCC usr path"
++    exit 1
++fi
++
+ # Intel compiler flags
+ CC_X86="gcc-4.0 -arch i386"
+ CXX_X86="g++-4.0 -arch i386"
+@@ -77,12 +88,12 @@
+ CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
+ -nostdinc \
+ -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
+--I$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \
++-I$GCCUSRPATH/include \
+ -isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"
+ 
+ # Intel linker flags
+ LFLAGS_X86="-Wl,-headerpad_max_install_names -arch i386 
-mmacosx-version-min=10.4 \
+--L$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1 \
++-L$GCCUSRPATH \
+ -Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"
+ 
+ #
+diff -ru SDL-1.2.14/build-scripts/makedep.sh 
SDL-1.2.14-patched/build-scripts/makedep.sh
+--- SDL-1.2.14/build-scripts/makedep.sh        2009-10-13 01:07:12.000000000 
+0200
++++ SDL-1.2.14-patched/build-scripts/makedep.sh        2011-07-11 
11:23:52.000000000 +0200
+@@ -69,7 +69,7 @@
+         ;;
+         asm) cat >>${output}.new <<__EOF__
+ 
+-      \$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) 
$src -o \$@
++      \$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) 
-I\$(srcdir)/src/hermes/ $src -o \$@
+ 
+ __EOF__
+         ;;
+diff -ru SDL-1.2.14/include/SDL_endian.h 
SDL-1.2.14-patched/include/SDL_endian.h
+--- SDL-1.2.14/include/SDL_endian.h    2009-10-13 01:07:19.000000000 +0200
++++ SDL-1.2.14-patched/include/SDL_endian.h    2011-07-11 11:23:52.000000000 
+0200
+@@ -94,7 +94,7 @@
+ }
+ #else
+ static __inline__ Uint16 SDL_Swap16(Uint16 x) {
+-      return((x<<8)|(x>>8));
++      return SDL_static_cast(Uint16, ((x<<8)|(x>>8)));
+ }
+ #endif
+ 
+@@ -129,7 +129,7 @@
+ }
+ #else
+ static __inline__ Uint32 SDL_Swap32(Uint32 x) {
+-      return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
++      return SDL_static_cast(Uint32, 
((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)));
+ }
+ #endif
+ 
+diff -ru SDL-1.2.14/src/cpuinfo/SDL_cpuinfo.c 
SDL-1.2.14-patched/src/cpuinfo/SDL_cpuinfo.c
 --- SDL-1.2.14/src/cpuinfo/SDL_cpuinfo.c       2009-10-13 01:07:14.000000000 
+0200
-+++ SDL-1.2.14-patched//src/cpuinfo/SDL_cpuinfo.c      2010-05-10 
23:58:34.000000000 +0200
++++ SDL-1.2.14-patched/src/cpuinfo/SDL_cpuinfo.c       2011-07-11 
11:23:52.000000000 +0200
 @@ -26,7 +26,7 @@
  #include "SDL.h"
  #include "SDL_cpuinfo.h"
@@ -199,9 +256,54 @@
        int selectors[2] = { CTL_HW, HW_VECTORUNIT }; 
        int hasVectorUnit = 0; 
        size_t length = sizeof(hasVectorUnit); 
-diff -ru SDL-1.2.14/src/joystick/SDL_joystick.c 
SDL-1.2.14-patched//src/joystick/SDL_joystick.c
+diff -ru SDL-1.2.14/src/events/SDL_quit.c 
SDL-1.2.14-patched/src/events/SDL_quit.c
+--- SDL-1.2.14/src/events/SDL_quit.c   2009-10-13 01:07:14.000000000 +0200
++++ SDL-1.2.14-patched/src/events/SDL_quit.c   2011-07-11 11:23:52.000000000 
+0200
+@@ -45,7 +45,19 @@
+ /* Public functions */
+ int SDL_QuitInit(void)
+ {
+-#ifdef HAVE_SIGNAL_H
++#ifdef HAVE_SIGACTION
++      struct sigaction action;
++      sigaction(SIGINT, NULL, &action);
++      if ( action.sa_handler == SIG_DFL && action.sa_sigaction == 
(void*)SIG_DFL ) {
++              action.sa_handler = SDL_HandleSIG;
++              sigaction(SIGINT, &action, NULL);
++      }
++      sigaction(SIGTERM, NULL, &action);
++      if ( action.sa_handler == SIG_DFL && action.sa_sigaction == 
(void*)SIG_DFL ) {
++              action.sa_handler = SDL_HandleSIG;
++              sigaction(SIGTERM, &action, NULL);
++      }
++#elif HAVE_SIGNAL_H
+       void (*ohandler)(int);
+ 
+       /* Both SIGINT and SIGTERM are translated into quit interrupts */
+@@ -62,7 +74,19 @@
+ }
+ void SDL_QuitQuit(void)
+ {
+-#ifdef HAVE_SIGNAL_H
++#ifdef HAVE_SIGACTION
++      struct sigaction action;
++      sigaction(SIGINT, NULL, &action);
++      if ( action.sa_handler == SDL_HandleSIG ) {
++              action.sa_handler = SIG_DFL;
++              sigaction(SIGINT, &action, NULL);
++      }
++      sigaction(SIGTERM, NULL, &action);
++      if ( action.sa_handler == SDL_HandleSIG ) {
++              action.sa_handler = SIG_DFL;
++              sigaction(SIGTERM, &action, NULL);
++      }
++#elif HAVE_SIGNAL_H
+       void (*ohandler)(int);
+ 
+       ohandler = signal(SIGINT, SIG_DFL);
+diff -ru SDL-1.2.14/src/joystick/SDL_joystick.c 
SDL-1.2.14-patched/src/joystick/SDL_joystick.c
 --- SDL-1.2.14/src/joystick/SDL_joystick.c     2009-10-13 01:07:13.000000000 
+0200
-+++ SDL-1.2.14-patched//src/joystick/SDL_joystick.c    2010-05-10 
23:58:32.000000000 +0200
++++ SDL-1.2.14-patched/src/joystick/SDL_joystick.c     2011-07-11 
11:23:52.000000000 +0200
 @@ -113,6 +113,7 @@
        /* Create and initialize the joystick */
        joystick = (SDL_Joystick *)SDL_malloc((sizeof *joystick));
@@ -210,9 +312,9 @@
                return(NULL);
        }
  
-diff -ru SDL-1.2.14/src/stdlib/SDL_iconv.c 
SDL-1.2.14-patched//src/stdlib/SDL_iconv.c
+diff -ru SDL-1.2.14/src/stdlib/SDL_iconv.c 
SDL-1.2.14-patched/src/stdlib/SDL_iconv.c
 --- SDL-1.2.14/src/stdlib/SDL_iconv.c  2009-10-13 01:07:13.000000000 +0200
-+++ SDL-1.2.14-patched//src/stdlib/SDL_iconv.c 2010-05-10 23:58:33.000000000 
+0200
++++ SDL-1.2.14-patched/src/stdlib/SDL_iconv.c  2011-07-11 11:23:52.000000000 
+0200
 @@ -383,7 +383,7 @@
                                                */
                                                ch = UNKNOWN_UNICODE;
@@ -222,9 +324,136 @@
                                                        overlong = SDL_TRUE;
                                                }
                                                ch = (Uint32)(p[0] & 0x1F);
-diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzGL.m 
SDL-1.2.14-patched//src/video/quartz/SDL_QuartzGL.m
+diff -ru SDL-1.2.14/src/thread/pthread/SDL_syssem.c 
SDL-1.2.14-patched/src/thread/pthread/SDL_syssem.c
+--- SDL-1.2.14/src/thread/pthread/SDL_syssem.c 2009-10-13 01:07:16.000000000 
+0200
++++ SDL-1.2.14-patched/src/thread/pthread/SDL_syssem.c 2011-07-11 
11:23:52.000000000 +0200
+@@ -97,6 +97,8 @@
+ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+ {
+       int retval;
++      struct timeval now;
++      struct timespec ts_timeout;
+ 
+       if ( ! sem ) {
+               SDL_SetError("Passed a NULL semaphore");
+@@ -111,16 +113,33 @@
+               return SDL_SemWait(sem);
+       }
+ 
+-      /* Ack!  We have to busy wait... */
+-      /* FIXME: Use sem_timedwait()? */
+-      timeout += SDL_GetTicks();
+-      do {
+-              retval = SDL_SemTryWait(sem);
+-              if ( retval == 0 ) {
+-                      break;
+-              }
+-              SDL_Delay(1);
+-      } while ( SDL_GetTicks() < timeout );
++      /* Setup the timeout. sem_timedwait doesn't wait for
++       * a lapse of time, but until we reach a certain time.
++       * This time is now plus the timeout.
++       */
++      gettimeofday(&now, NULL);
++
++      /* Add our timeout to current time */
++      now.tv_usec += (timeout % 1000) * 1000;
++      now.tv_sec += timeout / 1000;
++
++      /* Wrap the second if needed */
++      if ( now.tv_usec >= 1000000 ) {
++              now.tv_usec -= 1000000;
++              now.tv_sec ++;
++      }
++
++      /* Convert to timespec */
++      ts_timeout.tv_sec = now.tv_sec;
++      ts_timeout.tv_nsec = now.tv_usec * 1000;
++
++      /* Wait. */
++      do
++              retval = sem_timedwait(&sem->sem, &ts_timeout);
++      while (retval == -1 && errno == EINTR);
++
++      if (retval == -1)
++              SDL_SetError(strerror(errno));
+ 
+       return retval;
+ }
+diff -ru SDL-1.2.14/src/video/SDL_blit.c 
SDL-1.2.14-patched/src/video/SDL_blit.c
+--- SDL-1.2.14/src/video/SDL_blit.c    2009-10-13 01:07:15.000000000 +0200
++++ SDL-1.2.14-patched/src/video/SDL_blit.c    2011-07-11 11:23:52.000000000 
+0200
+@@ -214,7 +214,7 @@
+       dstskip = w+info->d_skip;
+       if ( dst < src ) {
+               while ( h-- ) {
+-                      SDL_memcpy(dst, src, w);
++                      SDL_memmove(dst, src, w);
+                       src += srcskip;
+                       dst += dstskip;
+               }
+diff -ru SDL-1.2.14/src/video/SDL_stretch.c 
SDL-1.2.14-patched/src/video/SDL_stretch.c
+--- SDL-1.2.14/src/video/SDL_stretch.c 2009-10-19 10:08:00.000000000 +0200
++++ SDL-1.2.14-patched/src/video/SDL_stretch.c 2011-07-11 11:23:52.000000000 
+0200
+@@ -78,7 +78,7 @@
+ 
+       int i;
+       int pos, inc;
+-      unsigned char *eip;
++      unsigned char *eip, *fence;
+       unsigned char load, store;
+ 
+       /* See if we need to regenerate the copy buffer */
+@@ -115,14 +115,21 @@
+       pos = 0x10000;
+       inc = (src_w << 16) / dst_w;
+       eip = copy_row;
+-      for ( i=0; i<dst_w; ++i ) {
++      fence = copy_row+sizeof(copy_row)-2;
++      for ( i=0; i<dst_w && eip < end; ++i ) {
+               while ( pos >= 0x10000L ) {
++                      if ( eip == fence ) {
++                              return -1;
++                      }
+                       if ( bpp == 2 ) {
+                               *eip++ = PREFIX16;
+                       }
+                       *eip++ = load;
+                       pos -= 0x10000L;
+               }
++              if ( eip == fence ) {
++                      return -1;
++              }
+               if ( bpp == 2 ) {
+                       *eip++ = PREFIX16;
+               }
+@@ -131,11 +138,6 @@
+       }
+       *eip++ = RETURN;
+ 
+-      /* Verify that we didn't overflow (too late!!!) */
+-      if ( eip > (copy_row+sizeof(copy_row)) ) {
+-              SDL_SetError("Copy buffer overflow");
+-              return(-1);
+-      }
+ #ifdef HAVE_MPROTECT
+       /* Make the code executable but not writeable */
+       if ( mprotect(copy_row, sizeof(copy_row), PROT_READ|PROT_EXEC) < 0 ) {
+diff -ru SDL-1.2.14/src/video/mmx.h SDL-1.2.14-patched/src/video/mmx.h
+--- SDL-1.2.14/src/video/mmx.h 2009-10-13 01:07:15.000000000 +0200
++++ SDL-1.2.14-patched/src/video/mmx.h 2011-07-11 11:23:52.000000000 +0200
+@@ -355,7 +355,7 @@
+ 
+ #define       mmx_r2m(op, reg, mem) \
+       __asm__ __volatile__ (#op " %%" #reg ", %0" \
+-                            : "=X" (mem) \
++                            : "=m" (mem) \
+                             : /* nothing */ )
+ 
+ #define       mmx_r2r(op, regs, regd) \
+diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzGL.m 
SDL-1.2.14-patched/src/video/quartz/SDL_QuartzGL.m
 --- SDL-1.2.14/src/video/quartz/SDL_QuartzGL.m 2009-10-13 01:07:14.000000000 
+0200
-+++ SDL-1.2.14-patched//src/video/quartz/SDL_QuartzGL.m        2010-05-10 
23:58:30.000000000 +0200
++++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzGL.m 2011-07-11 
11:23:52.000000000 +0200
 @@ -153,7 +153,7 @@
       * http://lists.apple.com/archives/mac-opengl/2006/Jan/msg00080.html )
       */
@@ -261,9 +490,9 @@
              [ gl_context getValues: &val forParameter: NSOpenGLCPSwapInterval 
];
              *value = val;
              return 0;
-diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzVideo.m 
SDL-1.2.14-patched//src/video/quartz/SDL_QuartzVideo.m
+diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzVideo.m 
SDL-1.2.14-patched/src/video/quartz/SDL_QuartzVideo.m
 --- SDL-1.2.14/src/video/quartz/SDL_QuartzVideo.m      2009-10-17 
09:45:42.000000000 +0200
-+++ SDL-1.2.14-patched//src/video/quartz/SDL_QuartzVideo.m     2010-05-10 
23:58:29.000000000 +0200
++++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzVideo.m      2011-07-11 
11:23:52.000000000 +0200
 @@ -24,7 +24,7 @@
  #include "SDL_QuartzVideo.h"
  #include "SDL_QuartzWindow.h"
@@ -282,9 +511,34 @@
      /* Fade to black to hide resolution-switching flicker (and garbage
         that is displayed by a destroyed OpenGL context, if applicable) */
      if ( CGAcquireDisplayFadeReservation (5, &fade_token) == kCGErrorSuccess 
) {
-diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzWM.m 
SDL-1.2.14-patched//src/video/quartz/SDL_QuartzWM.m
+@@ -1192,7 +1194,6 @@
+         CGContextDrawImage (cgc, rectangle, image);
+         CGImageRelease(image);
+         CGContextFlush (cgc);
+-        CGContextRelease (cgc);
+     }
+ }
+ 
+@@ -1247,6 +1248,16 @@
+ 
+ static int  QZ_LockHWSurface(_THIS, SDL_Surface *surface)
+ {
++    /*
++     * Always get latest bitmap address and rowbytes for the screen surface;
++     *  they can change dynamically (user has multiple monitors, etc).
++     */
++    if (surface == SDL_VideoSurface) {
++        surface->pixels = (void*) CGDisplayBaseAddress (kCGDirectMainDisplay);
++        surface->pitch  = CGDisplayBytesPerRow (kCGDirectMainDisplay);
++        return (surface->pixels != NULL);
++    }
++
+     return 1;
+ }
+ 
+diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzWM.m 
SDL-1.2.14-patched/src/video/quartz/SDL_QuartzWM.m
 --- SDL-1.2.14/src/video/quartz/SDL_QuartzWM.m 2009-10-13 01:07:14.000000000 
+0200
-+++ SDL-1.2.14-patched//src/video/quartz/SDL_QuartzWM.m        2010-05-10 
23:58:21.000000000 +0200
++++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzWM.m 2011-07-11 
11:23:52.000000000 +0200
 @@ -151,14 +151,16 @@
  /* Convert Cocoa screen coordinate to Cocoa window coordinate */
  void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p) {

Index: sdl.info
===================================================================
RCS file: /cvsroot/fink/dists/10.4/unstable/main/finkinfo/games/sdl.info,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- sdl.info    1 Jun 2010 08:30:33 -0000       1.25
+++ sdl.info    11 Jul 2011 17:32:03 -0000      1.26
@@ -16,7 +16,7 @@
 
 Package: sdl
 Version: 1.2.14
-Revision: 6
+Revision: 7
 BuildDependsOnly: True
 Depends: %N-shlibs (= %v-%r)
 BuildDepends: x11-dev, fink (>= 0.24.12), (%m = x86_64) gcc4.2
@@ -24,7 +24,7 @@
 Source: http://www.libsdl.org/release/SDL-%v.tar.gz
 Source-MD5: e52086d1b508fa0b76c52ee30b55bec4
 PatchFile: %n.patch
-PatchFile-MD5: 2e5394dc3b784e4c04e6b0126fe7cf71
+PatchFile-MD5: 8cb48834fc5be8ee008fb84d1a700e63
 ConfigureParams: --mandir=%p/share/man
 CompileScript: ./configure %c; DISTCC_HOSTS='' MAKEFLAGS='-j1' make
 InstallScript: make install DESTDIR=%d
@@ -39,11 +39,14 @@
   Added DISTCC_HOSTS='' MAKEFLAGS='-j1' to avoid the -fconstant-cfstrings 
warning
   when building with distcc (-- [email protected]).
 
-  Fix problem in SDL_cpuinfo.c by backporting fix from SDL SVN.
-  
-  Fix some warnings occuring on x86_64 in SDL_QuartzGL.m, from SDL SVN.
-  
-  Some more fixes from SDL SVN.
+  Backported several fixes from the SDL 1.2 Mercurial repository:
+  * Fix problems in SDL_cpuinfo.c
+  * Fix incompatibility with clang
+  * Fix some warnings occuring on x86_64 in Quartz video driver
+  * Fix double release of graphics context in Quartz video driver
+  * Fix issue with multi-screen setups resp. with hardware that can 
+    switch between multiple graphics chips (like recent MBP).
+  * Various other fixes and improvments
 <<
 DocFiles: BUGS COPYING CREDITS README README-SDL.txt README.MacOSX TODO
 Description: Cross-platform multimedia library


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Fink-commits mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to