import sys from distutils.core import setup from distutils.extension import Extension from Pyrex.Distutils import build_ext extra_args = {} if sys.platform == 'win32': extra_args['libraries'] = ['glew32', 'opengl32'] elif sys.platform == 'darwin': extra_args['extra_link_args'] = ['-framework', 'OpenGL'] extra_args['include_dirs'] = ['/usr/local/include',] else: extra_args['libraries'] = ['GLEW'] def GLEWExtension(name): path = 'src/%s.pyx' % '/'.join(name.split('.')) return Extension(name, [path,], **extra_args) moduleNames = ( 'glew', 'gl.threedfx', 'gl.apple', 'gl.arb', 'gl.ati', 'gl.atix', 'gl.ext', 'gl.gl', 'gl.hp', 'gl.ibm', 'gl.ingr', 'gl.intel', 'gl.ktx', 'gl.mesa', 'gl.nv', 'gl.oml', 'gl.pgi', 'gl.rend', 'gl.s3', 'gl.sgis', 'gl.sgix', 'gl.sgi', 'gl.sunx', 'gl.sun', 'gl.win' ) ext_modules = [ GLEWExtension(name) for name in moduleNames ] setup( name = "glewpy", version = '0.7.4', description = 'Python Wrapping of GLEW', author = 'Charles Moad', author_email = 'cmoad@indiana.edu', url = 'http://glewpy.sourceforge.net/', ext_package = 'glew', packages = ['glew', 'glew.gl', 'glew.glx', 'glew.wgl'], package_dir = {'glew': 'src'}, package_data = {'glew' : ['examples/mandelbrot.py', 'examples/mandelbrot.frag', 'examples/oneshot.py', 'examples/logo2.jpg']}, ext_modules = ext_modules, cmdclass = {'build_ext': build_ext} )