Patches for Darwin

This commit is contained in:
PHO / phonohawk 2009-07-21 04:42:08 +00:00 committed by Thomas Klausner
parent 5b7fd86e7f
commit e065ac5188
5 changed files with 181 additions and 1 deletions

View file

@ -1,2 +1,6 @@
$NetBSD: distinfo,v 1.1.1.1 2009/07/21 01:57:43 phonohawk Exp $
$NetBSD: distinfo,v 1.2 2009/07/21 04:42:08 phonohawk Exp $
SHA1 (patch-aa) = 764bad4d793bcae7026cf116d72bb32be9bc0973
SHA1 (patch-ab) = edc8a147dd8be716756501d6988df69e15238378
SHA1 (patch-ac) = b4f49cb86bdc780bad51da87e69f9756fcc50dc7
SHA1 (patch-ad) = 6066dc18439031b2e61f755b4fb5cec31f8ec9e7

14
gnubg/patches/patch-aa Normal file
View file

@ -0,0 +1,14 @@
$NetBSD: patch-aa,v 1.1 2009/07/21 04:42:08 phonohawk Exp $
--- configure.in.orig 2009-06-22 12:40:20.000000000 +0900
+++ configure.in
@@ -47,9 +47,6 @@ case "$host" in
CFLAGS="$CFLAGS -mms-bitfields"
LDFLAGS="$LDFLAGS -lwinmm"
;;
- *-*-darwin*)
- LDFLAGS="$LDFLAGS -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework QuickTime `/opt/local/bin/pkg-config --libs glib-2.0`"
- ;;
esac
AC_MSG_RESULT([$host])

13
gnubg/patches/patch-ab Normal file
View file

@ -0,0 +1,13 @@
$NetBSD: patch-ab,v 1.1 2009/07/21 04:42:08 phonohawk Exp $
--- gnubg.c.orig 2009-06-30 19:30:39.000000000 +0900
+++ gnubg.c
@@ -630,8 +630,6 @@ char const *aszBuildInfo[] = {
#endif
#if defined(WIN32)
N_("Windows sound system supported."),
-#elif defined(__APPLE__)
- N_("Apple QuickTime sound system supported."),
#elif HAVE_CANBERRA
N_("libcanberra sound system supported."),
#endif

16
gnubg/patches/patch-ac Normal file
View file

@ -0,0 +1,16 @@
$NetBSD: patch-ac,v 1.1 2009/07/21 04:42:08 phonohawk Exp $
--- openurl.c.orig 2009-03-02 05:01:51.000000000 +0900
+++ openurl.c
@@ -43,11 +43,7 @@ extern const gchar * get_web_browser (vo
return web_browser;
if ((pch = g_getenv ("BROWSER")) == NULL)
{
-#ifdef __APPLE__
- pch = "open";
-#else
pch = "firefox";
-#endif
}
return pch;
}

133
gnubg/patches/patch-ad Normal file
View file

@ -0,0 +1,133 @@
$NetBSD: patch-ad,v 1.1 2009/07/21 04:42:08 phonohawk Exp $
--- sound.c.orig 2009-03-21 01:18:51.000000000 +0900
+++ sound.c
@@ -40,119 +40,6 @@
#include "windows.h"
#include <mmsystem.h>
-#elif defined(__APPLE__)
-#include <QuickTime/QuickTime.h>
-#include <pthread.h>
-#include "lib/list.h"
-
-static int fQTInitialised = FALSE;
-static int fQTPlaying = FALSE;
-listOLD movielist;
-static pthread_mutex_t mutexQTAccess;
-
-
-void * Thread_PlaySound_QuickTime (void *data)
-{
- int done = FALSE;
-
- fQTPlaying = TRUE;
-
- do {
- listOLD *pl;
-
- pthread_mutex_lock (&mutexQTAccess);
-
- /* give CPU time to QT to process all running movies */
- MoviesTask (NULL, 0);
-
- /* check if there are any running movie left */
- pl = &movielist;
- done = TRUE;
- do {
- listOLD *next = pl->plNext;
- if (pl->p != NULL) {
- Movie *movie = (Movie *) pl->p;
- if (IsMovieDone (*movie)) {
- DisposeMovie (*movie);
- free (movie);
- ListDelete (pl);
- }
- else
- done = FALSE;
- }
- pl = next;
- } while (pl != &movielist);
-
- pthread_mutex_unlock (&mutexQTAccess);
- } while (!done && fQTPlaying);
-
- fQTPlaying = FALSE;
-
- return NULL;
-}
-
-
-void PlaySound_QuickTime (const char *cSoundFilename)
-{
- int err;
- Str255 pSoundFilename; /* file pathname in Pascal-string format */
- FSSpec fsSoundFile; /* movie file location descriptor */
- short resRefNum; /* open movie file reference */
-
- if (!fQTInitialised) {
- pthread_mutex_init (&mutexQTAccess, NULL);
- ListCreate (&movielist);
- fQTInitialised = TRUE;
- }
-
- /* QuickTime is NOT reentrant in Mac OS (it is in MS Windows!) */
- pthread_mutex_lock (&mutexQTAccess);
-
- EnterMovies (); /* can be called multiple times */
-
- err = NativePathNameToFSSpec(cSoundFilename, &fsSoundFile, 0);
- if (err != 0) {
- fprintf (stderr, "PlaySound_QuickTime: error #%d, can't find %s.\n", err, cSoundFilename);
- }
- else {
- /* open movie (WAV or whatever) file */
- err = OpenMovieFile (&fsSoundFile, &resRefNum, fsRdPerm);
- if (err != 0) {
- fprintf (stderr, "PlaySound_QuickTime: error #%d opening %s.\n", err, cSoundFilename);
- }
- else {
- /* create movie from movie file */
- Movie *movie = (Movie *) malloc (sizeof (Movie));
- err = NewMovieFromFile (movie, resRefNum, NULL, NULL, 0, NULL);
- CloseMovieFile (resRefNum);
- if (err != 0) {
- fprintf (stderr, "PlaySound_QuickTime: error #%d reading %s.\n", err, cSoundFilename);
- }
- else {
- /* reset movie timebase */
- TimeRecord t = { 0 };
- t.base = GetMovieTimeBase (*movie);
- SetMovieTime (*movie, &t);
- /* add movie to list of running movies */
- ListInsert (&movielist, movie);
- /* run movie */
- StartMovie (*movie);
- }
- }
- }
-
- pthread_mutex_unlock (&mutexQTAccess);
-
- if (!fQTPlaying) {
- /* launch playing thread if necessary */
- int err;
- pthread_t qtthread;
- fQTPlaying = TRUE;
- err = pthread_create (&qtthread, 0L, Thread_PlaySound_QuickTime, NULL);
- if (err == 0) pthread_detach (qtthread);
- else fQTPlaying = FALSE;
- }
-}
#elif HAVE_CANBERRA
#include <canberra.h>
#include <canberra-gtk.h>
@@ -254,8 +141,6 @@ playSoundFile (char *file, /*lint -e{715
}
Sleep (1); /* Wait (1ms) for current sound to finish */
}
-#elif defined(__APPLE__)
- PlaySound_QuickTime (file);
#elif HAVE_CANBERRA
ca_context_play(ca_gtk_context_get(), 0, CA_PROP_MEDIA_FILENAME, file, NULL);
#endif