forked from moderngl/moderngl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
159 lines (137 loc) · 4.32 KB
/
Copy pathsetup.py
File metadata and controls
159 lines (137 loc) · 4.32 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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import glob
import platform
import sys
from setuptools import Extension, setup
target = platform.system().lower()
if target == 'linux':
from distutils import sysconfig
cvars = sysconfig.get_config_vars()
if 'OPT' in cvars:
sysconfig._config_vars['OPT'] = cvars['OPT'].replace('-Wstrict-prototypes', '')
if 'CFLAGS' in cvars:
sysconfig._config_vars['CFLAGS'] = cvars['CFLAGS'].replace('-Wstrict-prototypes', '')
install_requires = []
if sys.version_info < (3, 0):
raise Exception('Python 2 is not supported!')
if sys.version_info < (3, 5):
install_requires.append('typing')
libraries = {
'windows': ['gdi32', 'opengl32', 'user32'],
'linux': ['GL', 'dl', 'X11'],
'darwin': [],
}
extra_compile_args = {
'windows': [],
'linux': [],
'darwin': ['-Wno-deprecated-declarations'],
}
extra_linker_args = {
'windows': [],
'linux': [],
'darwin': ['-framework', 'OpenGL', '-Wno-deprecated'],
}
ModernGL = Extension(
name='ModernGL.mgl',
include_dirs=['src'],
define_macros=[
# ('MGL_DEBUG', None),
# ('MGL_VERBOSE', None),
],
libraries=libraries[target],
extra_compile_args=extra_compile_args[target],
extra_link_args=extra_linker_args[target],
sources=glob.glob('src/*.cpp'),
)
short_description = 'ModernGL: PyOpenGL alternative'
long_description = '''
`ModernGL on github <https://github.com/cprogrammer1994/ModernGL>`_
`Documentation <https://moderngl.readthedocs.io/>`_
`Examples <https://moderngl.github.io/Examples.html>`_
OpenGL is a great environment for developing portable, platform independent,
interactive 2D and 3D graphics applications. The API implementation in Python
is cumbersome, resulting in applications with high latency. To solve this
problem we have developed ModernGL, a wrapper over OpenGL that simplifies the
creation of simple graphics applications like scientific simulations, small
games or user interfaces. Usually, acquiring in-depth knowledge of OpenGL
requires a steep learning curve. In contrast, ModernGL is easy to learn and
use, moreover it is capable of rendering with the same performance and quality,
with less code written.
'''
keywords = [
'ModernGL',
'modern OpenGL',
'OpenGL',
'PyOpenGL',
'visualization',
'ray-tracing',
'compute shader',
'shader',
'documentation',
'graphics',
'GLSL',
'GPU',
'GPGPU',
'nvidia',
'amd',
'GL',
'GLU',
'GLEXT',
'WGL',
'WGLEXT',
'ARB',
'GLX',
'2D',
'3D',
'CAD',
'design',
'video',
]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: MacOS X',
'Environment :: Win32 (MS Windows)',
'Environment :: X11 Applications',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: OS Independent',
'Operating System :: Unix',
'Topic :: Artistic Software',
'Topic :: Desktop Environment',
'Topic :: Documentation :: Sphinx',
'Topic :: Games/Entertainment',
'Topic :: Multimedia',
'Topic :: Multimedia :: Graphics',
'Topic :: Multimedia :: Graphics :: 3D Modeling',
'Topic :: Multimedia :: Graphics :: 3D Rendering',
'Topic :: Multimedia :: Video :: Display',
'Topic :: Scientific/Engineering :: Visualization',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3 :: Only',
]
args = {
'name': 'ModernGL',
'version': '4.2.0',
'description': short_description,
'long_description': long_description.strip(),
'url': 'https://github.com/cprogrammer1994/ModernGL',
'download_url': 'https://github.com/cprogrammer1994/ModernGL/releases',
'author': 'Szabolcs Dombi',
'author_email': 'cprogrammer1994@gmail.com',
'license': 'MIT',
'classifiers': classifiers,
'keywords': keywords,
'packages': ['ModernGL', 'ModernGL.ext'],
'install_requires': install_requires,
'ext_modules': [ModernGL],
'platforms': ['any'],
}
if target == 'windows':
args['zip_safe'] = False
setup(**args)