11#!/usr/bin/env python
22# Python wrapper for the rpi_ws281x library.
33# Authors:
4- # Phil Howard (phil@pimoroni.com)
4+ # Phil Howard (phil@pimoroni.com)
55# Tony DiCola (tony@tonydicola.com)
66
77from setuptools import setup , find_packages , Extension
88from setuptools .command .build_py import build_py
9- import subprocess
109
1110class CustomInstallCommand (build_py ):
12- """Customized install to run library Makefile"""
1311 def run (self ):
1412 print ("Compiling ws281x library..." )
15- proc = subprocess .Popen (["make" ], stdout = subprocess .PIPE , stderr = subprocess .PIPE )
16- print (proc .stderr .read ())
1713 build_py .run (self )
1814
1915setup (name = 'rpi_ws281x' ,
@@ -26,8 +22,13 @@ def run(self):
2622 url = 'https://github.com/rpi-ws281x/rpi-ws281x-python/' ,
2723 cmdclass = {'build_py' :CustomInstallCommand },
2824 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