-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
61 lines (54 loc) · 1.62 KB
/
setup.py
File metadata and controls
61 lines (54 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import distutils
import sys
if '--from-cython' in sys.argv:
from Cython.Distutils import build_ext
sys.argv.remove('--from-cython')
module_source = 'rtmidi_python.pyx'
else:
from distutils.command.build_ext import build_ext
module_source = 'rtmidi_python.cpp'
extension_args = {}
if sys.platform.startswith('linux'):
extension_args = dict(
define_macros=[('__LINUX_ALSA__', None)],
libraries=['asound', 'pthread']
)
if sys.platform == 'darwin':
extension_args = dict(
define_macros=[('__MACOSX_CORE__', None)],
extra_compile_args=['-frtti'],
extra_link_args=[
'-framework', 'CoreMIDI',
'-framework', 'CoreAudio',
'-framework', 'CoreFoundation'
]
)
if sys.platform == 'win32':
extension_args = dict(
define_macros=[('__WINDOWS_MM__', None)],
libraries=['winmm']
)
rtmidi_module = distutils.extension.Extension(
'rtmidi_python',
[module_source, 'RtMidi/RtMidi.cpp'],
language='c++',
**extension_args
)
distutils.core.setup(
name='rtmidi-python',
version='0.2.2',
description='Python wrapper for RtMidi',
long_description=open('README.rst').read(),
author='Guido Lorenz',
author_email='code@superquadratic.net',
url='https://github.com/superquadratic/rtmidi-python',
cmdclass={'build_ext': build_ext},
ext_modules=[rtmidi_module],
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Cython',
'Topic :: Multimedia :: Sound/Audio :: MIDI',
'License :: OSI Approved :: MIT License'
]
)