source: python/setup.py @ e84f7b9

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

python/setup.py: add command 'generate' with option '--enable-double'

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