You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
961 B

  1. #!/usr/bin/env python
  2. from distutils.command.build import build
  3. from distutils.core import setup
  4. import os
  5. import sys
  6. def libname(ver):
  7. vars = dict(
  8. name='libdecaf',
  9. ver=ver,
  10. )
  11. if sys.platform == 'darwin':
  12. return '%(name)s.%(ver)d.dylib' % vars
  13. return '%(name)s.so.%(ver)d' % vars
  14. class my_build(build):
  15. def run(self):
  16. build.run(self)
  17. if not self.dry_run:
  18. os.spawnlp(os.P_WAIT, 'sh', 'sh', '-c',
  19. 'cd .. && mkdir build && cd build && cmake .. && make')
  20. self.copy_file(os.path.join('..', 'build', 'src', libname(0)),
  21. os.path.join(self.build_lib, 'edgold', 'libdecaf.so'))
  22. cmdclass = {}
  23. cmdclass['build'] = my_build
  24. setup(name='edgold',
  25. version='1.0',
  26. description='The Ed ECC Goldilocks Python wrapper',
  27. author='John-Mark Gurney',
  28. author_email='jmg@funkthat.com',
  29. #url='',
  30. cmdclass=cmdclass,
  31. packages=['edgold', ],
  32. )