Source

pysdl-cffi / utils / mksdl.py

Diff from to

File utils/mksdl.py

 bindir = os.path.abspath(os.path.join(basedir, 'sdl-bin'))
 targetdir = os.path.abspath(os.path.join(basedir, 'sdl-src'))
 
+PATCH_SDL_OSX_GL32 = os.path.join(THISDIR, 'sdl-osx-gl3.2.patch')
+
 def clone_repo():
     if not os.path.isdir(targetdir):
         cmd = 'hg clone -r {0} {1} {2}'.format(
         if os.system(cmd):
             print("failed :(")
             return
+    if sys.platform == 'darwin':
+        # try to apply patch
+        cmd = 'patch -d {} -p 1 -i {}'.format(targetdir, PATCH_SDL_OSX_GL32)
+        if os.system(cmd):
+            print("applying patch failed :(")
+            return
     return True
 
 def run_win32_build():