3 import sys, os.path, glob
4 from setuptools import setup, Extension
5 from python.lib.moresetuptools import *
6 # function to generate gen/*.{c,h}
7 from python.lib.gen_external import generate_external, header, output_path
8 from Version import get_aubio_version, get_aubio_pyversion
10 __version__ = get_aubio_version()
11 __pip_version__ = get_aubio_pyversion()
15 define_macros = [('AUBIO_VERSION', '%s' % __version__)]
18 include_dirs += [ 'python/ext' ]
19 include_dirs += [ output_path ] # aubio-generated.h
22 include_dirs += [ numpy.get_include() ]
26 if sys.platform.startswith('darwin'):
27 extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox']
29 sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c')))
31 aubio_extension = Extension("aubio._aubio",
33 include_dirs = include_dirs,
34 library_dirs = library_dirs,
35 extra_link_args = extra_link_args,
36 define_macros = define_macros)
38 if os.path.isfile('src/aubio.h'):
39 if not os.path.isdir(os.path.join('build','src')):
41 #__version__ += 'a2' # python only version
44 'Development Status :: 4 - Beta',
45 'Environment :: Console',
46 'Intended Audience :: Science/Research',
47 'Topic :: Software Development :: Libraries',
48 'Topic :: Multimedia :: Sound/Audio :: Analysis',
49 'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
50 'Operating System :: POSIX',
51 'Operating System :: MacOS :: MacOS X',
52 'Operating System :: Microsoft :: Windows',
53 'Programming Language :: C',
54 'Programming Language :: Python',
55 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
58 distrib = setup(name='aubio',
59 version = __pip_version__,
61 package_dir = {'aubio':'python/lib/aubio'},
62 scripts = ['python/scripts/aubiocut'],
63 ext_modules = [aubio_extension],
64 description = 'a collection of tools for music analysis',
65 long_description = 'a collection of tools for music analysis',
66 license = 'GNU/GPL version 3',
67 author = 'Paul Brossier',
68 author_email = 'piem@aubio.org',
69 maintainer = 'Paul Brossier',
70 maintainer_email = 'piem@aubio.org',
71 url = 'https://aubio.org/',
73 classifiers = classifiers,
74 install_requires = ['numpy'],
75 setup_requires = ['numpy'],
77 'clean': CleanGenerated,
78 'build_ext': build_ext,
80 test_suite = 'nose2.collector.collector',