-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
86 lines (68 loc) · 2.46 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
from setuptools import setup
from distutils.command.build import build as BuildCommand
# Available at setup time due to pyproject.toml
from pybind11.setup_helpers import Pybind11Extension, build_ext
from pybind11 import get_cmake_dir
import pathlib
import shutil
import os.path
import sys
__version__ = "0.1.0"
is_64bits = sys.maxsize > 2**32
spout_lib_base_dir = "vendor/SpoutGL/Binaries"
spout_lib_dir = os.path.join(
spout_lib_base_dir, "x64" if is_64bits else "Win32")
ext_modules = [
Pybind11Extension("SpoutGL._spoutgl",
# Note:
# Sort input source files if you glob sources to ensure bit-for-bit
# reproducible builds (https://github.com/pybind/python_example/pull/53)
["src/PySpoutGL.cpp"],
# Pass in the version to the compiled code
define_macros=[('VERSION_INFO', __version__)],
cxx_std=17,
include_dirs=['vendor/SpoutGL'],
libraries=['spout'],
library_dirs=[spout_lib_dir],
# Generate VS pdb symbols for debugging
# extra_link_args=["/DEBUG:FULL"]
),
]
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
class CopyDllsAndBuildCommand(BuildCommand):
"""Copies arch-specific DLLs to the SpoutGL package directory"""
def run(self):
shutil.copyfile(os.path.join(spout_lib_dir, "Spout.dll"),
"src/SpoutGL/Spout.dll")
super().run()
setup(
name="SpoutGL",
version=__version__,
author="Jason Lai",
license="BSD-3-Clause",
url="https://github.com/jlai/Python-SpoutGL",
description="Wrapper around Spout frame streaming library for Windows",
long_description=README,
long_description_content_type="text/markdown",
classifiers=[
"Development Status :: 3 - Alpha",
"Operating System :: Microsoft :: Windows",
"License :: OSI Approved :: BSD License",
"Topic :: Multimedia :: Graphics :: Capture",
"Topic :: Multimedia :: Graphics :: Viewers"
],
ext_modules=ext_modules,
extras_require={"test": []},
cmdclass={
"build": CopyDllsAndBuildCommand
},
zip_safe=False,
python_requires=">3.7",
packages=["SpoutGL"],
package_dir={"": "src"},
package_data={
"": ["*.dll"]
},
include_package_data=True
)