forked from erlerobot/pypruss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·40 lines (33 loc) · 1.36 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
33
34
35
36
37
38
39
#!/usr/bin/env python
# PyPRUSS setup script
# Note that there is a hack here for removing the default sysroot directive
# that is standard for python installers.
print "Installing PyPRUSS"
try:
from distutils.core import setup, Extension
from distutils import sysconfig
import re
print "Removing --sysroot directive from Link command"
vars = sysconfig.get_config_vars()
vars['LDSHARED'] = re.sub("--sysroot=.* ", " ", vars['LDSHARED'])
print "Running setup"
setup(name='PyPRUSS',
version='0.1',
description='A Python binding for prussdrv - for controlling the PRUs on BeagleBone',
author='Elias Bakken',
author_email='[email protected]',
license='BSD',
url='http://hipstercirtuits.com',
ext_modules=[Extension('pypruss',
['pypruss/pypruss.c', 'pypruss/prussdrv.c'],
include_dirs=['pypruss/include',
'/usr/include/python2.7',
'/usr/include'],
define_macros=[('__DEBUG', None)],
libraries=['pthread'],
extra_link_args=["-shared"]
)],
)
print "Finished installing, Great!"
except Exception, e:
print "Install failed with exception:\n%s" % e