forked from aitjcize/PyTox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
59 lines (54 loc) · 1.23 KB
/
setup.py
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
from distutils.core import setup, Extension
from subprocess import Popen, PIPE
def supports_av():
h = Popen("ld $LDFLAGS -ltoxav", shell=True, stderr=PIPE)
out, err = h.communicate()
return 'toxav' not in str(err)
sources = ["pytox/pytox.c", "pytox/core.c", "pytox/util.c"]
libraries = [
"opus",
"sodium",
"toxcore",
"toxcrypto",
"toxdht",
"toxdns",
"toxencryptsave",
"toxfriends",
"toxgroup",
"toxmessenger",
"toxnetcrypto",
"toxnetwork",
"vpx",
]
cflags = [
"-Wall",
"-Werror",
"-Wextra",
"-Wno-declaration-after-statement",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
"-fno-strict-aliasing",
]
if supports_av():
libraries.append("toxav")
sources.append("pytox/av.c")
cflags.append("-DENABLE_AV")
else:
print("Warning: AV support not found, disabled.")
setup(
name="PyTox",
version="0.0.23",
description='Python binding for Tox the skype replacement',
author='Wei-Ning Huang (AZ)',
author_email='[email protected]',
url='http://github.com/aitjcize/PyTox',
license='GPL',
ext_modules=[
Extension(
"pytox",
sources,
extra_compile_args=cflags,
libraries=libraries
)
]
)