-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·32 lines (27 loc) · 1.03 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
import os
import re
from distutils.core import setup, Extension
SDL_VERSION = '1.2.14'
def get_sources_from_dir(d):
return map(lambda x: os.path.join(d, x),
filter(lambda x: re.search(r'\.cc?$', x), os.listdir(d)))
extra_compile_args = ['-std=gnu99', '-I%s' % os.getcwd()]
extra_link_args = []
if os.path.exists('C:\\apps\\SDL-%s' % SDL_VERSION):
extra_compile_args.append('-IC:\\apps\\SDL-%s\\include' % SDL_VERSION)
extra_link_args.append('-LC:\\apps\\SDL-%s\\lib' % SDL_VERSION)
sdl_sources = get_sources_from_dir('sdl')
sdl_module = Extension('SDL',
sources = sdl_sources,
extra_compile_args = extra_compile_args,
extra_link_args = extra_link_args,
libraries = ['SDL'])
setup(name = 'pysdl2',
version = '0.4-next',
description = 'Python Bindings for SDL',
author = 'Josh Holtrop',
author_email = 'pysdl2@gmail.com',
ext_modules = [sdl_module],
long_description = 'Python Bindings for SDL',
license = 'LGPL v2.1')