1 | #! /usr/bin/env python |
---|
2 | |
---|
3 | import sys, os.path, glob |
---|
4 | from setuptools import setup, Extension |
---|
5 | |
---|
6 | # add ./python/lib to current path |
---|
7 | sys.path.append(os.path.join('python', 'lib')) |
---|
8 | from moresetuptools import build_ext, CleanGenerated |
---|
9 | |
---|
10 | # function to generate gen/*.{c,h} |
---|
11 | from this_version import get_aubio_version, get_aubio_pyversion |
---|
12 | |
---|
13 | __version__ = get_aubio_pyversion() |
---|
14 | __aubio_version__ = get_aubio_version() |
---|
15 | |
---|
16 | include_dirs = [] |
---|
17 | library_dirs = [] |
---|
18 | define_macros = [('AUBIO_VERSION', '%s' % __aubio_version__)] |
---|
19 | extra_link_args = [] |
---|
20 | |
---|
21 | include_dirs += [ 'python/ext' ] |
---|
22 | try: |
---|
23 | import numpy |
---|
24 | include_dirs += [ numpy.get_include() ] |
---|
25 | except ImportError: |
---|
26 | pass |
---|
27 | |
---|
28 | if sys.platform.startswith('darwin'): |
---|
29 | extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox'] |
---|
30 | |
---|
31 | sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c'))) |
---|
32 | |
---|
33 | aubio_extension = Extension("aubio._aubio", |
---|
34 | sources, |
---|
35 | include_dirs = include_dirs, |
---|
36 | library_dirs = library_dirs, |
---|
37 | extra_link_args = extra_link_args, |
---|
38 | define_macros = define_macros) |
---|
39 | |
---|
40 | if os.path.isfile('src/aubio.h'): |
---|
41 | if not os.path.isdir(os.path.join('build','src')): |
---|
42 | pass |
---|
43 | #__version__ += 'a2' # python only version |
---|
44 | |
---|
45 | classifiers = [ |
---|
46 | 'Development Status :: 4 - Beta', |
---|
47 | 'Environment :: Console', |
---|
48 | 'Intended Audience :: Science/Research', |
---|
49 | 'Topic :: Software Development :: Libraries', |
---|
50 | 'Topic :: Multimedia :: Sound/Audio :: Analysis', |
---|
51 | 'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis', |
---|
52 | 'Operating System :: POSIX', |
---|
53 | 'Operating System :: MacOS :: MacOS X', |
---|
54 | 'Operating System :: Microsoft :: Windows', |
---|
55 | 'Programming Language :: C', |
---|
56 | 'Programming Language :: Python', |
---|
57 | 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', |
---|
58 | ] |
---|
59 | |
---|
60 | distrib = setup(name='aubio', |
---|
61 | version = __version__, |
---|
62 | packages = ['aubio'], |
---|
63 | package_dir = {'aubio':'python/lib/aubio'}, |
---|
64 | ext_modules = [aubio_extension], |
---|
65 | description = 'a collection of tools for music analysis', |
---|
66 | long_description = 'a collection of tools for music analysis', |
---|
67 | license = 'GNU/GPL version 3', |
---|
68 | author = 'Paul Brossier', |
---|
69 | author_email = 'piem@aubio.org', |
---|
70 | maintainer = 'Paul Brossier', |
---|
71 | maintainer_email = 'piem@aubio.org', |
---|
72 | url = 'https://aubio.org/', |
---|
73 | platforms = 'any', |
---|
74 | classifiers = classifiers, |
---|
75 | install_requires = ['numpy'], |
---|
76 | setup_requires = ['numpy'], |
---|
77 | cmdclass = { |
---|
78 | 'clean': CleanGenerated, |
---|
79 | 'build_ext': build_ext, |
---|
80 | }, |
---|
81 | entry_points = { |
---|
82 | 'console_scripts': [ |
---|
83 | 'aubio = aubio.cmd:main', |
---|
84 | 'aubiocut = aubio.cut:main', |
---|
85 | ], |
---|
86 | }, |
---|
87 | test_suite = 'nose2.collector.collector', |
---|
88 | extras_require = { |
---|
89 | 'tests': ['numpy'], |
---|
90 | }, |
---|
91 | ) |
---|