[c71e405] | 1 | #! /usr/bin/python |
---|
| 2 | |
---|
[0a6c211] | 3 | from distutils.core import setup, Extension |
---|
[4d3b573] | 4 | |
---|
[14fb15f] | 5 | import sys |
---|
[012b324] | 6 | import os.path |
---|
[4ebd189] | 7 | import numpy |
---|
[012b324] | 8 | |
---|
[945e26d] | 9 | # read from VERSION |
---|
[ad5203c] | 10 | for l in open('VERSION').readlines(): exec (l.strip()) |
---|
[945e26d] | 11 | __version__ = '.'.join \ |
---|
| 12 | ([str(x) for x in [AUBIO_MAJOR_VERSION, AUBIO_MINOR_VERSION, AUBIO_PATCH_VERSION]]) \ |
---|
| 13 | + AUBIO_VERSION_STATUS |
---|
| 14 | |
---|
[4d3b573] | 15 | |
---|
[41399bd] | 16 | include_dirs = [] |
---|
| 17 | library_dirs = [] |
---|
| 18 | define_macros = [] |
---|
[4d3b573] | 19 | extra_link_args = [] |
---|
[012b324] | 20 | |
---|
[41399bd] | 21 | include_dirs += ['ext'] |
---|
| 22 | include_dirs += [ numpy.get_include() ] |
---|
[ad5203c] | 23 | |
---|
[4d3b573] | 24 | if sys.platform.startswith('darwin'): |
---|
| 25 | extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox'] |
---|
| 26 | |
---|
[ad5203c] | 27 | output_path = 'gen' |
---|
[41399bd] | 28 | generated_object_files = [] |
---|
[ad5203c] | 29 | |
---|
| 30 | if not os.path.isdir(output_path): |
---|
[92c83ccc] | 31 | from lib.generator import generate_object_files |
---|
[ad5203c] | 32 | generated_object_files = generate_object_files(output_path) |
---|
[41399bd] | 33 | # define include dirs |
---|
[ad5203c] | 34 | else: |
---|
| 35 | import glob |
---|
| 36 | generated_object_files = glob.glob(os.path.join(output_path, '*.c')) |
---|
[41399bd] | 37 | include_dirs += [output_path] |
---|
| 38 | |
---|
| 39 | if os.path.isfile('../src/aubio.h'): |
---|
| 40 | define_macros += [('USE_LOCAL_AUBIO', 1)] |
---|
| 41 | include_dirs += ['../src'] # aubio.h |
---|
| 42 | include_dirs += ['../build/src'] # config.h |
---|
| 43 | library_dirs += ['../build/src'] |
---|
[ad5203c] | 44 | |
---|
[164980f] | 45 | aubio_extension = Extension("aubio._aubio", [ |
---|
[4d3b573] | 46 | "ext/aubiomodule.c", |
---|
| 47 | "ext/aubioproxy.c", |
---|
| 48 | "ext/ufuncs.c", |
---|
| 49 | "ext/py-cvec.c", |
---|
| 50 | # example without macro |
---|
| 51 | "ext/py-filter.c", |
---|
| 52 | # macroised |
---|
| 53 | "ext/py-filterbank.c", |
---|
| 54 | "ext/py-fft.c", |
---|
| 55 | "ext/py-phasevoc.c", |
---|
[d27634d] | 56 | "ext/py-source.c", |
---|
[f1100a4] | 57 | "ext/py-sink.c", |
---|
[4d3b573] | 58 | # generated files |
---|
| 59 | ] + generated_object_files, |
---|
| 60 | include_dirs = include_dirs, |
---|
| 61 | library_dirs = library_dirs, |
---|
| 62 | extra_link_args = extra_link_args, |
---|
| 63 | define_macros = define_macros, |
---|
| 64 | libraries=['aubio']) |
---|
[14fb15f] | 65 | |
---|
[945e26d] | 66 | classifiers = [ |
---|
[4d3b573] | 67 | 'Development Status :: 4 - Beta', |
---|
| 68 | 'Environment :: Console', |
---|
| 69 | 'Intended Audience :: Science/Research', |
---|
| 70 | 'Topic :: Software Development :: Libraries', |
---|
| 71 | 'Topic :: Multimedia :: Sound/Audio :: Analysis', |
---|
| 72 | 'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis', |
---|
| 73 | 'Operating System :: POSIX', |
---|
| 74 | 'Operating System :: MacOS :: MacOS X', |
---|
| 75 | 'Operating System :: Microsoft :: Windows', |
---|
| 76 | 'Programming Language :: C', |
---|
| 77 | 'Programming Language :: Python', |
---|
| 78 | 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', |
---|
| 79 | ] |
---|
[012b324] | 80 | |
---|
[945e26d] | 81 | distrib = setup(name='aubio', |
---|
[4d3b573] | 82 | version = __version__, |
---|
| 83 | packages = ['aubio'], |
---|
[9582713] | 84 | package_dir = {'aubio':'lib/aubio'}, |
---|
| 85 | scripts = ['scripts/aubiocut'], |
---|
[4d3b573] | 86 | ext_modules = [aubio_extension], |
---|
| 87 | description = 'interface to the aubio library', |
---|
| 88 | long_description = 'interface to the aubio library', |
---|
| 89 | license = 'GNU/GPL version 3', |
---|
| 90 | author = 'Paul Brossier', |
---|
| 91 | author_email = 'piem@aubio.org', |
---|
| 92 | maintainer = 'Paul Brossier', |
---|
| 93 | maintainer_email = 'piem@aubio.org', |
---|
| 94 | url = 'http://aubio.org/', |
---|
| 95 | platforms = 'any', |
---|
| 96 | classifiers = classifiers, |
---|
| 97 | ) |
---|