Add workaround for buggy Python 3.4 headers.
[calfbox.git] / setup.py
blobacb106a7a67836a98cdf56d20e87251e9fd09797
1 #!/usr/bin/env python3
3 from distutils.core import setup, Extension
4 import glob
5 import os
7 packages = ['glib-2.0', 'jack', 'fluidsynth', 'libusb-1.0', 'smf', 'sndfile']
9 eargs = os.popen("pkg-config --cflags %s" % (" ".join(packages)), "r").read().split()
10 eargs.append("-std=c99")
11 # Workaround for Python3.4 headers
12 eargs.append("-Wno-error=declaration-after-statement")
14 libs = os.popen("pkg-config --libs %s" % (" ".join(packages)), "r").read().split()
15 libs.append("-luuid")
17 csources = [
18 "app.c",
19 "auxbus.c",
20 "blob.c",
21 "chorus.c",
22 "cmd.c",
23 "compressor.c",
24 "config-api.c",
25 "delay.c",
26 "distortion.c",
27 "dom.c",
28 "eq.c",
29 "engine.c",
30 "errors.c",
31 "fbr.c",
32 "fifo.c",
33 "fluid.c",
34 "fuzz.c",
35 "fxchain.c",
36 "gate.c",
37 "hwcfg.c",
38 "instr.c",
39 "io.c",
40 "jackinput.c",
41 "jackio.c",
42 "layer.c",
43 "master.c",
44 "meter.c",
45 "midi.c",
46 "mididest.c",
47 "module.c",
48 "pattern.c",
49 "pattern-maker.c",
50 "phaser.c",
51 "prefetch_pipe.c",
52 "recsrc.c",
53 "reverb.c",
54 "rt.c",
55 "sampler.c",
56 "sampler_channel.c",
57 "sampler_gen.c",
58 "sampler_layer.c",
59 "sampler_prg.c",
60 "sampler_voice.c",
61 "scene.c",
62 "scripting.c",
63 "seq.c",
64 "seq-adhoc.c",
65 "sfzloader.c",
66 "sfzparser.c",
67 "song.c",
68 "streamplay.c",
69 "streamrec.c",
70 "tarfile.c",
71 "tonectl.c",
72 "tonewheel.c",
73 "track.c",
74 "usbaudio.c",
75 "usbio.c",
76 "usbmidi.c",
77 "usbprobe.c",
78 "wavebank.c"
81 if '#define USE_SSE 1' in open('config.h').read():
82 eargs.append('-msse')
83 eargs.append('-ffast-math')
85 setup(name="CalfBox",
86 version="0.04", description="Assorted music-related code",
87 author="Krzysztof Foltman", author_email="wdev@foltman.com",
88 url="http://repo.or.cz/w/calfbox.git",
89 packages=["calfbox"],
90 package_dir={'calfbox':'py'},
91 ext_modules=[
92 Extension('_cbox', csources,
93 extra_compile_args = eargs,
94 include_dirs=['.'],
95 extra_link_args=libs,
96 define_macros=[("_GNU_SOURCE","1"),("_POSIX_C_SOURCE", "199309L"),("USE_PYTHON","1"),("CALFBOX_AS_MODULE", "1")],
97 undef_macros=['NDEBUG'],
98 depends = ['setup.py']