-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
34 lines (28 loc) · 953 Bytes
/
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
33
#!/usr/bin/env python
"""
setup.py file for LWES binding
"""
from distutils.core import setup, Extension
import commands
def pkgconfig(*packages, **kw):
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split():
if flag_map.has_key(token[:2]):
kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
else:
kw.setdefault('extra_link_args', []).append(token)
for k, v in kw.iteritems():
kw[k] = list(set(v))
return kw
lwes_module = Extension('_lwes',
sources=['lwes_wrap.c'],
**pkgconfig('lwes-0')
)
setup (name='lwes',
version = '0.0.1',
author = "Michael P. Lum",
description = """Python bindings for the Light Weight Event System""",
url='http://www.lwes.org',
ext_modules = [lwes_module],
py_modules = ["lwes"],
)