1
1
#!/usr/bin/env python
2
2
# Python wrapper for the rpi_ws281x library.
3
3
# Authors:
4
-
4
+
5
5
6
6
7
7
from setuptools import setup , find_packages , Extension
8
8
from setuptools .command .build_py import build_py
9
- import subprocess
10
9
11
10
class CustomInstallCommand (build_py ):
12
- """Customized install to run library Makefile"""
13
11
def run (self ):
14
12
print ("Compiling ws281x library..." )
15
- proc = subprocess .Popen (["make" ], stdout = subprocess .PIPE , stderr = subprocess .PIPE )
16
- print (proc .stderr .read ())
17
13
build_py .run (self )
18
14
19
15
setup (name = 'rpi_ws281x' ,
@@ -26,8 +22,13 @@ def run(self):
26
22
url = 'https://github.com/rpi-ws281x/rpi-ws281x-python/' ,
27
23
cmdclass = {'build_py' :CustomInstallCommand },
28
24
packages = ['rpi_ws281x' ],
29
- ext_modules = [Extension ('_rpi_ws281x' ,
30
- sources = ['rpi_ws281x_wrap.c' ],
31
- include_dirs = ['lib/' ],
32
- library_dirs = ['lib-built/' ],
33
- libraries = ['ws2811' ])])
25
+ ext_modules = [Extension ('_rpi_ws281x' ,
26
+ include_dirs = ['.' ],
27
+ sources = ['rpi_ws281x_wrap.c' ,
28
+ 'lib/dma.c' ,
29
+ 'lib/mailbox.c' ,
30
+ 'lib/main.c' ,
31
+ 'lib/pcm.c' ,
32
+ 'lib/pwm.c' ,
33
+ 'lib/rpihw.c' ,
34
+ 'lib/ws2811.c' ])])
0 commit comments