From bf200e934d9513d9005da6a1f9f7d588b71c1155 Mon Sep 17 00:00:00 2001
From: Oliver Bock <oliver.bock@aei.mpg.de>
Date: Fri, 17 Apr 2009 18:10:05 +0200
Subject: [PATCH] Added patch for SDL

* The BOINC v6 screensaver expects the graphics app to bear a specific window class name
* It exits if the graphics app can't be found by that name!
* Ergo: patch SDL's default class name to trick (satisfy) BOINC :-)
---
 build.sh                      |  4 ++++
 patches/SDL_sysevents.c.patch | 11 +++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 patches/SDL_sysevents.c.patch

diff --git a/build.sh b/build.sh
index 07948f8..d07740e 100755
--- a/build.sh
+++ b/build.sh
@@ -306,6 +306,10 @@ prepare_win32_environment()
 
 build_generic_win32()
 {
+	echo "Patching SDL..." | tee -a $LOGFILE
+	cd $ROOT/3rdparty/sdl/src/video/wincommon || failure
+	# patch: amend window class name (required by BOINC v6 screensaver!)
+	patch < $ROOT/patches/SDL_sysevents.c.patch >> $LOGFILE 2>&1 || failure
 	echo "Building SDL (this may take a while)..." | tee -a $LOGFILE
 	cd $ROOT/3rdparty/sdl || failure
 	chmod +x autogen.sh >> $LOGFILE 2>&1 || failure
diff --git a/patches/SDL_sysevents.c.patch b/patches/SDL_sysevents.c.patch
new file mode 100644
index 0000000..3840748
--- /dev/null
+++ b/patches/SDL_sysevents.c.patch
@@ -0,0 +1,11 @@
+--- SDL_sysevents.c	2009-04-17 17:18:07.000000000 +0200
++++ SDL_sysevents.c.new	2009-04-17 17:14:41.000000000 +0200
+@@ -799,7 +799,7 @@
+ #define CS_BYTEALIGNCLIENT	0
+ #endif
+ 	if ( ! name && ! SDL_Appname ) {
+-		name = "SDL_app";
++		name = "BOINC_app";
+ 		SDL_Appstyle = CS_BYTEALIGNCLIENT;
+ 		SDL_Instance = hInst ? hInst : SDL_GetModuleHandle();
+ 	}
-- 
GitLab