source: python/setup.py @ ad5203c

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since ad5203c was ad5203c, checked in by Paul Brossier <piem@piem.org>, 11 years ago

python/: improve build

  • Property mode set to 100755
File size: 2.8 KB
Line 
1#! /usr/bin/python
2
3from distutils.core import setup, Extension
4import sys
5import os.path
6import numpy
7
8# read from VERSION
9for l in open('VERSION').readlines(): exec (l.strip())
10__version__ = '.'.join \
11        ([str(x) for x in [AUBIO_MAJOR_VERSION, AUBIO_MINOR_VERSION, AUBIO_PATCH_VERSION]]) \
12        + AUBIO_VERSION_STATUS
13
14library_dirs = ['../build/src']
15include_dirs = ['../src'] # aubio.h
16include_dirs += ['../build/src'] # config.h
17include_dirs += ['ext']
18include_dirs += ['gen']
19#include_dirs += ['../build/src', '../src', '.' ]
20
21library_dirs = filter (lambda x: os.path.isdir(x), library_dirs)
22include_dirs = filter (lambda x: os.path.isdir(x), include_dirs)
23
24generated_object_files = []
25
26output_path = 'gen'
27
28if not os.path.isdir(output_path):
29    from generator import generate_object_files
30    generated_object_files = generate_object_files(output_path)
31else:
32    import glob
33    generated_object_files = glob.glob(os.path.join(output_path, '*.c'))
34
35aubio_extension = Extension("aubio._aubio", [
36            "ext/aubiomodule.c",
37            "ext/aubioproxy.c",
38            "ext/ufuncs.c",
39            "ext/py-cvec.c",
40            # example without macro
41            "ext/py-filter.c",
42            # macroised
43            "ext/py-filterbank.c",
44            "ext/py-fft.c",
45            "ext/py-phasevoc.c",
46            # generated files
47            ] + generated_object_files,
48        include_dirs = include_dirs + [ numpy.get_include() ],
49        library_dirs = library_dirs,
50        libraries=['aubio'])
51
52if sys.platform.startswith('darwin'):
53        aubio_extension.extra_link_args = ['-framework','CoreFoundation', '-framework','AudioToolbox']
54
55classifiers = [
56        'Development Status :: 4 - Beta',
57        'Environment :: Console',
58        'Intended Audience :: Science/Research',
59        'Topic :: Software Development :: Libraries',
60        'Topic :: Multimedia :: Sound/Audio :: Analysis',
61        'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
62        'Operating System :: POSIX',
63        'Operating System :: MacOS :: MacOS X',
64        'Operating System :: Microsoft :: Windows',
65        'Programming Language :: C',
66        'Programming Language :: Python',
67        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
68        ]
69
70distrib = setup(name='aubio',
71        version = __version__,
72        packages = ['aubio'],
73        ext_modules = [aubio_extension],
74        description = 'interface to the aubio library',
75        long_description = 'interface to the aubio library',
76        license = 'GNU/GPL version 3',
77        author = 'Paul Brossier',
78        author_email = 'piem@aubio.org',
79        maintainer = 'Paul Brossier',
80        maintainer_email = 'piem@aubio.org',
81        url = 'http://aubio.org/',
82        platforms = 'any',
83        classifiers = classifiers,
84        )
85
Note: See TracBrowser for help on using the repository browser.