File: setup.py

package info (click to toggle)
rtaudio 5.2.0~ds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,088 kB
  • sloc: cpp: 10,887; python: 118; makefile: 92; sh: 88
file content (56 lines) | stat: -rw-r--r-- 1,558 bytes parent folder | download | duplicates (2)
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
#!/bin/env python

import os
from distutils.core import setup, Extension

if hasattr(os, 'uname'):
    OSNAME = os.uname()[0]
else:
    OSNAME = 'Windows'


define_macros = []
libraries = []
extra_link_args = []
extra_compile_args = ['-I../../../']
sources = ['rtaudiomodule.cpp', '../../../RtAudio.cpp']


if OSNAME == 'Linux':
    define_macros=[("__LINUX_ALSA__", ''),
                   ('__LINUX_JACK__', '')]
    libraries = ['asound', 'jack', 'pthread']

elif OSNAME == 'Darwin':
    define_macros = [('__MACOSX_CORE__', '')]
    libraries = ['pthread', 'stdc++']
    extra_link_args = ['-framework', 'CoreAudio']

elif OSNAME == 'Windows':
    define_macros = [('__WINDOWS_DS__', None),
                     ('__WINDOWS_ASIO__', None),
		     ('__LITTLE_ENDIAN__',None),
		     ('WIN32',None)]
    libraries = ['winmm', 'dsound', 'Advapi32','Ole32','User32']
    sources += ['../../../include/asio.cpp',
                '../../../include/asiodrivers.cpp',
                '../../../include/asiolist.cpp',
                '../../../include/iasiothiscallresolver.cpp']
    extra_compile_args.append('-I../../../include/')
    extra_compile_args.append('-EHsc')


audio = Extension('rtaudio',
                 sources=sources,
                 libraries=libraries,
                 define_macros=define_macros,
		 extra_compile_args = extra_compile_args,
                 extra_link_args = extra_link_args,
                 )


setup(name = 'rtaudio',
      version = '0.1',
      description = 'Python RtAudio interface',
      ext_modules = [audio])