-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·113 lines (87 loc) · 3.07 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup, Extension
from Cython.Distutils import build_ext
EXTENSIONS_INCLUDE_DIRS = ["gorilla-audio/include"]
if sys.platform in ('cygwin', 'win32'):
LIBRARIES = ['ole32', 'oleaut32']
if sys.platform == 'cygwin':
EXTENSIONS_EXTRA_OBJECTS = [
"gorilla-audio/bin/win32/Release/libgorilla.a",
]
else:
EXTENSIONS_EXTRA_OBJECTS = [
"gorilla-audio/bin/win32/Release/gorilla.lib",
]
elif sys.platform == 'darwin':
EXTENSIONS_EXTRA_OBJECTS = [
"gorilla-audio/bin/osx/Release/libgorilla.a",
"/System/Library/Frameworks/OpenAL.framework/OpenAL",
]
LIBRARIES = []
else: # linux
EXTENSIONS_EXTRA_OBJECTS = [
"gorilla-audio/bin/linux/Release/libgorilla.a"
]
LIBRARIES = []
def get_version(version_tuple):
if not isinstance(version_tuple[-1], int):
return '.'.join(map(str, version_tuple[:-1])) + version_tuple[-1]
return '.'.join(map(str, version_tuple))
try:
from pypandoc import convert
def read_md(f):
return convert(f, 'rst')
except ImportError:
convert = None
print(
"warning: pypandoc module not found, could not convert Markdown to RST"
)
def read_md(f):
return open(f, 'r').read() # noqa
init = os.path.join(os.path.dirname(__file__), 'pyrilla', '__init__.py')
version_line = list(filter(lambda l: l.startswith('VERSION'), open(init)))[0]
VERSION = get_version(eval(version_line.split('=')[-1]))
README = os.path.join(os.path.dirname(__file__), 'README.md')
setup(
name='pyrilla',
version=VERSION,
packages=['pyrilla'],
author='Michał Jaworski',
author_email='[email protected]',
description="Python binding to gorilla-audio library",
long_description=read_md(README),
url="https://github.com/swistakm/pyrilla",
cmdclass={'build_ext': build_ext},
ext_modules=[
Extension(
"pyrilla.core", ["extensions/core.pyx"],
include_dirs=EXTENSIONS_INCLUDE_DIRS,
extra_objects=EXTENSIONS_EXTRA_OBJECTS,
libraries=LIBRARIES,
),
],
setup_requires=['cython'],
include_package_data=True,
license='BSD',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Cython',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Topic :: Multimedia :: Sound/Audio',
'Topic :: Multimedia :: Sound/Audio :: Mixers',
'Topic :: Multimedia :: Sound/Audio :: Players',
'Topic :: Games/Entertainment',
],
)