Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
79 lines (68 loc) · 2.3 KB
/
Copy pathsetup.py
File metadata and controls
79 lines (68 loc) · 2.3 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# http://peak.telecommunity.com/DevCenter/setuptools#using-setuptools-without-bundling-it
import ez_setup
ez_setup.use_setuptools()
import sys, os, os.path
from setuptools import setup, find_packages, Extension
__author__ = 'Flier Lu'
is_debug = True
is_win = os.name == 'nt' and sys.platform == 'win32'
VPX_HOME = os.environ.get('VPX_HOME', None)
if VPX_HOME:
vpx_inc_path = os.path.join(VPX_HOME, 'include')
vpx_lib_path = os.path.join(VPX_HOME, 'lib', 'Win32') if is_win else ''
else:
vpx_inc_path = vpx_lib_path = None
if is_win:
vpx_lib = 'vpxmt'
elif is_debug:
vpx_lib = 'vpx_g'
else:
vpx_lib = 'vpx'
if is_win:
macros = ['WIN32', '_WINDOWS']
if is_debug:
macros += ['_DEBUG']
ccflags = ['/Od', '/Oy-', '/ZI']
ldflags = ['/DEBUG']
else:
macros += ['NDEBUG']
ccflags = ['/O2', '/Zi']
ldflags = ['/DEBUG']
else:
if is_debug:
ccflags = ['-g', '-O0', '-fPIC']
else:
ccflags = []
ldflags = []
vpx = Extension(name = '_vpx',
sources = ['vpx.i'],
include_dirs = [vpx_inc_path] if vpx_inc_path else [],
library_dirs = [vpx_lib_path] if vpx_lib_path else [],
libraries = [vpx_lib] if vpx_lib else [],
extra_compile_args = ccflags,
extra_link_args = ldflags,
language = 'c++')
setup(name = 'pyvpx',
version = '0.4',
description = 'Python Binding of WebM VP8 Codec',
long_description = open('README').read(),
author = __author__,
author_email = 'flier.lu@gmail.com',
url = 'https://github.com/flier/pyvpx',
download_url = 'https://github.com/flier/pyvpx/downloads',
packages = find_packages(),
ext_modules = [vpx],
py_modules = ['pyvpx', 'vpx', 'ez_setup'],
test_suite = "tests",
license = 'BSD',
keywords = 'VPX video codec encoder decoder',
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: C',
'Programming Language :: Python',
'Topic :: Multimedia :: Video',
'Topic :: Software Development :: Libraries :: Python Modules',
],)