Source

pysdl-cffi / sdl / builder.py

Diff from to

File sdl/builder.py

 from autobind import AutoBind
 
 THISDIR = os.path.dirname(__file__)
-        
+CDEF_PATH = os.path.abspath(os.path.join(THISDIR, '..', 'sdl_defs'))
+BIN_PATH = os.path.abspath(os.path.join(THISDIR, '..', 'sdl-bin'))
+INCLUDE_PATH = os.path.abspath(os.path.join(BIN_PATH, 'include'))
+LIB_PATH = os.path.abspath(os.path.join(BIN_PATH, 'lib'))
+LIBS = [
+    'SDL2',
+]
+STATIC_LIBS = [os.path.join(LIB_PATH, 'lib' + lib + '.a') for lib in LIBS]
+VERIFY_OPTIONS = dict(
+    #extra_link_args = STATIC_LIBS,
+    extra_link_args = [
+        '-fPIC',
+    ] + STATIC_LIBS,
+    library_dirs = [
+        LIB_PATH
+    ],
+    include_dirs = [
+        INCLUDE_PATH,
+    ],
+    extra_compile_args = [
+        #'-Wfatal-errors',
+    ],
+    tmpdir = os.path.abspath(os.path.join(THISDIR, '..', '__pycache__'))
+)
+
 autobind = AutoBind(options=dict(
-    CDEF_PATH = os.path.join(THISDIR, '..', 'sdl_defs'),
+    CDEF_PATH = CDEF_PATH,
     CDEF_FILES = [ 
          'SDL_stdinc.h',
          'SDL_blendmode.h',
     #    'SDL_version.h',
         'SDL.h'
     ],
-    DEFINES_BLACKLIST = [],
+    DEFINES_BLACKLIST = [
+        'SDL_BlitScaled',
+        'SDL_BlitSurface',
+    ],
     DEFINES = [],
     PRIVATE_SYMBOLS = [
         'SDL_GetError',
         'SDL_GetCurrentDisplayMode',
         'SDL_GetDisplayMode',
         'SDL_GetDesktopDisplayMode',
+        'SDL_GL_GetAttribute',
     ],
     AUTOCHECK_BLACKLIST = [
         'SDL_GetError',
         ('DECLSPEC', ''),
         ('SDLCALL', ''),
     ],
-    LIBNAME = 'SDL2',
-    VERIFY_SOURCE = "#include <SDL2/SDL.h>\n",
+    VERIFY_SOURCE = '#include "SDL2/SDL.h"\n',
+    VERIFY_OPTIONS = VERIFY_OPTIONS,
     AUTOMANGLE = False,
     PYPREDEFS = os.path.join(THISDIR, '..', 'predefs', 'sdl.pypredef'),
     OUTMODULE = os.path.join(THISDIR, '_sdl.py'),