3 import sys, os.path, glob
4 from setuptools import setup, Extension
5 from python.lib.moresetuptools import build_ext, CleanGenerated
6 # function to generate gen/*.{c,h}
7 from this_version import get_aubio_version, get_aubio_pyversion
9 __version__ = get_aubio_pyversion()
10 __aubio_version__ = get_aubio_version()
14 define_macros = [('AUBIO_VERSION', '%s' % __aubio_version__)]
17 include_dirs += [ 'python/ext' ]
20 include_dirs += [ numpy.get_include() ]
24 if sys.platform.startswith('darwin'):
25 extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox']
27 sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c')))
29 aubio_extension = Extension("aubio._aubio",
31 include_dirs = include_dirs,
32 library_dirs = library_dirs,
33 extra_link_args = extra_link_args,
34 define_macros = define_macros)
36 if os.path.isfile('src/aubio.h'):
37 if not os.path.isdir(os.path.join('build','src')):
39 #__version__ += 'a2' # python only version
42 'Development Status :: 4 - Beta',
43 'Environment :: Console',
44 'Intended Audience :: Science/Research',
45 'Topic :: Software Development :: Libraries',
46 'Topic :: Multimedia :: Sound/Audio :: Analysis',
47 'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
48 'Operating System :: POSIX',
49 'Operating System :: MacOS :: MacOS X',
50 'Operating System :: Microsoft :: Windows',
51 'Programming Language :: C',
52 'Programming Language :: Python',
53 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
56 distrib = setup(name='aubio',
57 version = __version__,
59 package_dir = {'aubio':'python/lib/aubio'},
60 ext_modules = [aubio_extension],
61 description = 'a collection of tools for music analysis',
62 long_description = 'a collection of tools for music analysis',
63 license = 'GNU/GPL version 3',
64 author = 'Paul Brossier',
65 author_email = 'piem@aubio.org',
66 maintainer = 'Paul Brossier',
67 maintainer_email = 'piem@aubio.org',
68 url = 'https://aubio.org/',
70 classifiers = classifiers,
71 install_requires = ['numpy'],
72 setup_requires = ['numpy'],
74 'clean': CleanGenerated,
75 'build_ext': build_ext,
79 'aubio = aubio.cmd:main',
80 'aubiocut = aubio.cut:main',
83 test_suite = 'nose2.collector.collector',