setup.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #! /usr/bin/env python
  2. from distutils.core import setup
  3. from distutils.extension import Extension
  4. from subprocess import Popen, PIPE, CalledProcessError
  5. try:
  6. from Cython.Distutils import build_ext
  7. except ImportError:
  8. raise SystemExit("Requires Cython (http://cython.org/)")
  9. try:
  10. ode_cflags = Popen(
  11. ["pkg-config", "--cflags", "ode"],
  12. stdout=PIPE).stdout.read().decode('ascii').split()
  13. ode_libs = Popen(
  14. ["pkg-config", "--libs", "ode"],
  15. stdout=PIPE).stdout.read().decode('ascii').split()
  16. except (OSError, CalledProcessError):
  17. raise SystemExit("Failed to find ODE with 'pkg-config'. Please make sure "
  18. "that it is installed and available on your system path.")
  19. ode_ext = Extension("ode", ["ode.pyx"],
  20. extra_compile_args=ode_cflags,
  21. extra_link_args=ode_libs)
  22. if __name__ == "__main__":
  23. setup(
  24. name="Open Dynamics Engine",
  25. version="0.12",
  26. author="Gideon Klompje",
  27. # author_email="",
  28. # maintainer="",
  29. # maintainer_email="",
  30. url="http://www.ode.org",
  31. description="Bindings for the Open Dynamics Engine",
  32. long_description=(
  33. "A free, industrial quality library for simulating articulated "
  34. "rigid body dynamics - for example ground vehicles, legged "
  35. "creatures, and moving objects in VR environments. It's fast, "
  36. "flexible & robust. Built-in collision detection."),
  37. # download_url="https://opende.svn.sourceforge.net/svnroot/opende",
  38. # classifiers=[],
  39. # platforms=[],
  40. license="BSD License, GNU Lesser General Public License (LGPL)",
  41. cmdclass={"build_ext": build_ext},
  42. ext_modules=[ode_ext]
  43. )