comparison setup.py @ 555:98380e4a0ee5

Switch to libepoxy instead of libGLEW, which will help with OpenGL portability.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 19 Apr 2014 19:05:06 +0200
parents 8f51e34d911c
children 991c817d1e6b
comparison
equal deleted inserted replaced
554:653a9f087673 555:98380e4a0ee5
15 sys.exit(1) 15 sys.exit(1)
16 16
17 17
18 COMMAND = 'pkg-config' 18 COMMAND = 'pkg-config'
19 SDL_LIBRARIES = ['sdl2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf'] 19 SDL_LIBRARIES = ['sdl2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
20 GL_LIBRARIES = ['gl'] 20 GL_LIBRARIES = ['epoxy']
21 21
22 packages = [] 22 packages = []
23 extension_names = [] 23 extension_names = []
24 extensions = [] 24 extensions = []
25 25
43 default_libs = { 43 default_libs = {
44 'sdl2': '-lSDL2', 44 'sdl2': '-lSDL2',
45 'SDL2_image': '-lSDL2_image', 45 'SDL2_image': '-lSDL2_image',
46 'SDL2_mixer': '-lSDL2_mixer', 46 'SDL2_mixer': '-lSDL2_mixer',
47 'SDL2_ttf': '-lSDL2_ttf', 47 'SDL2_ttf': '-lSDL2_ttf',
48 'gl': '-lGL' 48 'epoxy': '-lepoxy'
49 } 49 }
50 50
51 51
52 # Check for gl.pc, and don’t compile the OpenGL backend if it isn’t present. 52 # Check for epoxy.pc, and don’t compile the OpenGL backend if it isn’t present.
53 try: 53 try:
54 check_output([COMMAND] + GL_LIBRARIES) 54 check_output([COMMAND] + GL_LIBRARIES)
55 except CalledProcessError: 55 except CalledProcessError:
56 use_opengl = False 56 use_opengl = False
57 except OSError: 57 except OSError:
118 118
119 # OS-specific setuptools options. 119 # OS-specific setuptools options.
120 try: 120 try:
121 from cx_Freeze import setup, Executable 121 from cx_Freeze import setup, Executable
122 except ImportError: 122 except ImportError:
123 is_windows = False
124 extra = {} 123 extra = {}
125 else: 124 else:
126 is_windows = True
127 nthreads = None # It seems Windows can’t compile in parallel. 125 nthreads = None # It seems Windows can’t compile in parallel.
128 base = 'Win32GUI' if sys.platform == 'win32' else None 126 base = 'Win32GUI' if sys.platform == 'win32' else None
129 extra = {'options': {'build_exe': {'includes': extension_names + ['glob', 'socket', 'select']}}, 127 extra = {'options': {'build_exe': {'includes': extension_names + ['glob', 'socket', 'select']}},
130 'executables': [Executable(script='scripts/pytouhou', base=base)]} 128 'executables': [Executable(script='scripts/pytouhou', base=base)]}
131 129
142 'infer_types.verbose': debug, 140 'infer_types.verbose': debug,
143 'profile': debug}, 141 'profile': debug},
144 compile_time_env={'MAX_TEXTURES': 128, 142 compile_time_env={'MAX_TEXTURES': 128,
145 'MAX_ELEMENTS': 640 * 4 * 3, 143 'MAX_ELEMENTS': 640 * 4 * 3,
146 'MAX_SOUNDS': 26, 144 'MAX_SOUNDS': 26,
147 'USE_OPENGL': use_opengl, 145 'USE_OPENGL': use_opengl}),
148 'USE_GLEW': is_windows}),
149 scripts=['scripts/pytouhou'] + (['scripts/anmviewer'] if anmviewer else []), 146 scripts=['scripts/pytouhou'] + (['scripts/anmviewer'] if anmviewer else []),
150 **extra) 147 **extra)