6 from setuptools import setup, Extension
8 # add ./python/lib to current path
9 sys.path.append(os.path.join('python', 'lib')) # noqa
10 from moresetuptools import build_ext, CleanGenerated
12 # function to generate gen/*.{c,h}
13 from this_version import get_aubio_version, get_aubio_pyversion
15 __version__ = get_aubio_pyversion()
16 __aubio_version__ = get_aubio_version()
20 define_macros = [('AUBIO_VERSION', '%s' % __aubio_version__)]
23 include_dirs += ['python/ext']
26 include_dirs += [numpy.get_include()]
30 if sys.platform.startswith('darwin'):
31 extra_link_args += ['-framework', 'CoreFoundation',
32 '-framework', 'AudioToolbox']
34 sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c')))
36 aubio_extension = Extension("aubio._aubio",
38 include_dirs = include_dirs,
39 library_dirs = library_dirs,
40 extra_link_args = extra_link_args,
41 define_macros = define_macros)
43 # TODO: find a way to track if package is built against libaubio
44 # if os.path.isfile('src/aubio.h'):
45 # if not os.path.isdir(os.path.join('build','src')):
47 # #__version__ += 'a2' # python only version
50 'Development Status :: 4 - Beta',
51 'Environment :: Console',
52 'Intended Audience :: Science/Research',
53 'Topic :: Software Development :: Libraries',
54 'Topic :: Multimedia :: Sound/Audio :: Analysis',
55 'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
56 'Operating System :: POSIX',
57 'Operating System :: MacOS :: MacOS X',
58 'Operating System :: Microsoft :: Windows',
59 'Programming Language :: C',
60 'Programming Language :: Python',
61 'License :: OSI Approved :: '
62 'GNU General Public License v3 or later (GPLv3+)',
65 distrib = setup(name='aubio',
66 version = __version__,
68 package_dir = {'aubio': 'python/lib/aubio'},
69 ext_modules = [aubio_extension],
70 description = 'a collection of tools for music analysis',
71 long_description = 'a collection of tools for music analysis',
72 license = 'GNU/GPL version 3',
73 author = 'Paul Brossier',
74 author_email = 'piem@aubio.org',
75 maintainer = 'Paul Brossier',
76 maintainer_email = 'piem@aubio.org',
77 url = 'https://aubio.org/',
79 classifiers = classifiers,
80 install_requires = ['numpy'],
81 setup_requires = ['numpy'],
83 'clean': CleanGenerated,
84 'build_ext': build_ext,
88 'aubio = aubio.cmd:main',
89 'aubiocut = aubio.cut:main',
92 test_suite = 'nose2.collector.collector',