[9aa0af3] | 1 | #! /usr/bin/env python |
---|
[c71e405] | 2 | |
---|
[bc1ed63] | 3 | import sys |
---|
| 4 | import os.path |
---|
| 5 | import glob |
---|
[1167631] | 6 | from setuptools import setup, Extension |
---|
[2410f57a] | 7 | |
---|
| 8 | # add ./python/lib to current path |
---|
[bc1ed63] | 9 | sys.path.append(os.path.join('python', 'lib')) # noqa |
---|
[2410f57a] | 10 | from moresetuptools import build_ext, CleanGenerated |
---|
| 11 | |
---|
[1167631] | 12 | # function to generate gen/*.{c,h} |
---|
[b991cc1] | 13 | from this_version import get_aubio_version, get_aubio_pyversion |
---|
[012b324] | 14 | |
---|
[38f3d04] | 15 | __version__ = get_aubio_pyversion() |
---|
| 16 | __aubio_version__ = get_aubio_version() |
---|
[945e26d] | 17 | |
---|
[41399bd] | 18 | include_dirs = [] |
---|
| 19 | library_dirs = [] |
---|
[38f3d04] | 20 | define_macros = [('AUBIO_VERSION', '%s' % __aubio_version__)] |
---|
[4d3b573] | 21 | extra_link_args = [] |
---|
[012b324] | 22 | |
---|
[bc1ed63] | 23 | include_dirs += ['python/ext'] |
---|
[5f6324e] | 24 | try: |
---|
| 25 | import numpy |
---|
[bc1ed63] | 26 | include_dirs += [numpy.get_include()] |
---|
[5f6324e] | 27 | except ImportError: |
---|
| 28 | pass |
---|
[ad5203c] | 29 | |
---|
[4d3b573] | 30 | if sys.platform.startswith('darwin'): |
---|
[bc1ed63] | 31 | extra_link_args += ['-framework', 'CoreFoundation', |
---|
| 32 | '-framework', 'AudioToolbox'] |
---|
[4d3b573] | 33 | |
---|
[2e40231] | 34 | sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c'))) |
---|
[2675227] | 35 | |
---|
| 36 | aubio_extension = Extension("aubio._aubio", |
---|
| 37 | sources, |
---|
[4d3b573] | 38 | include_dirs = include_dirs, |
---|
| 39 | library_dirs = library_dirs, |
---|
| 40 | extra_link_args = extra_link_args, |
---|
[2675227] | 41 | define_macros = define_macros) |
---|
| 42 | |
---|
[bc1ed63] | 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')): |
---|
| 46 | # pass |
---|
| 47 | # #__version__ += 'a2' # python only version |
---|
[2675227] | 48 | |
---|
[945e26d] | 49 | classifiers = [ |
---|
[4d3b573] | 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', |
---|
[bc1ed63] | 61 | 'License :: OSI Approved :: ' |
---|
| 62 | 'GNU General Public License v3 or later (GPLv3+)', |
---|
[4d3b573] | 63 | ] |
---|
[012b324] | 64 | |
---|
[e6a07fe] | 65 | thisdir = os.path.abspath(os.path.dirname(__file__)) |
---|
| 66 | py_readme_file = os.path.join(thisdir, 'python', 'README.md') |
---|
| 67 | with open(py_readme_file, 'r') as fp: |
---|
| 68 | long_description = ''.join(fp.readlines()[3:]) |
---|
| 69 | |
---|
[945e26d] | 70 | distrib = setup(name='aubio', |
---|
[38f3d04] | 71 | version = __version__, |
---|
[4d3b573] | 72 | packages = ['aubio'], |
---|
[bc1ed63] | 73 | package_dir = {'aubio': 'python/lib/aubio'}, |
---|
[4d3b573] | 74 | ext_modules = [aubio_extension], |
---|
[dc1fbc6] | 75 | description = 'a collection of tools for music analysis', |
---|
[e6a07fe] | 76 | long_description = long_description, |
---|
[b1294cc] | 77 | long_description_content_type = 'text/markdown', |
---|
[4d3b573] | 78 | license = 'GNU/GPL version 3', |
---|
| 79 | author = 'Paul Brossier', |
---|
| 80 | author_email = 'piem@aubio.org', |
---|
| 81 | maintainer = 'Paul Brossier', |
---|
| 82 | maintainer_email = 'piem@aubio.org', |
---|
[0f425aa] | 83 | url = 'https://aubio.org/', |
---|
[4d3b573] | 84 | platforms = 'any', |
---|
| 85 | classifiers = classifiers, |
---|
[16f8dcc] | 86 | install_requires = ['numpy'], |
---|
[6264d30] | 87 | setup_requires = ['numpy'], |
---|
[a89ed31] | 88 | cmdclass = { |
---|
| 89 | 'clean': CleanGenerated, |
---|
[b1d37c0] | 90 | 'build_ext': build_ext, |
---|
[1167631] | 91 | }, |
---|
[8e2f36a] | 92 | entry_points = { |
---|
| 93 | 'console_scripts': [ |
---|
| 94 | 'aubio = aubio.cmd:main', |
---|
| 95 | 'aubiocut = aubio.cut:main', |
---|
| 96 | ], |
---|
| 97 | }, |
---|
[4d3b573] | 98 | ) |
---|