-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
executable file
·90 lines (78 loc) · 2.94 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import distutils.sysconfig
import inspect
import os
# from distutils.core import Extension
from setuptools import Extension, setup
ZX_MAJOR_VERSION = 0
ZX_MINOR_VERSION = 7
ZX_PATCH_VERSION = 0
here = os.path.abspath(os.path.dirname(inspect.getsource(lambda: 0)))
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
# Work around the problem with the warning about '-Wstrict-prototypes'.
# https://bugs.python.org/issue1222585
config_vars = distutils.sysconfig.get_config_vars()
opt_to_remove = '-Wstrict-prototypes'
for var in ['OPT']:
if var in config_vars:
opts = config_vars[var].split()
if opt_to_remove in opts:
opts.remove(opt_to_remove)
config_vars[var] = ' '.join(opts)
zx_emulatorbase_module = Extension(
name='zx._emulatorbase',
define_macros=[('ZX_MAJOR_VERSION', '%d' % ZX_MAJOR_VERSION),
('ZX_MINOR_VERSION', '%d' % ZX_MINOR_VERSION),
('ZX_PATCH_VERSION', '%d' % ZX_PATCH_VERSION)],
extra_compile_args=['-std=c++11', '-Wall', '-fno-exceptions', '-fno-rtti',
'-O3',
'-UNDEBUG', # TODO
],
sources=['zx/_emulatorbase.cpp'],
language='c++')
# TODO: Update the URL once we have a published documentation.
# TODO: Do we have a name for the emulator?
setup(name='zx',
version='%d.%d.%d' % (ZX_MAJOR_VERSION, ZX_MINOR_VERSION,
ZX_PATCH_VERSION),
description='ZX Spectrum Emulator for Researchers and Developers',
long_description=long_description,
long_description_content_type='text/markdown',
author='Ivan Kosarev',
author_email='[email protected]',
url='https://github.com/kosarev/zx/',
ext_modules=[zx_emulatorbase_module],
packages=['zx'],
install_requires=[
'pycairo',
'pygobject',
],
package_data={'zx': ['roms/*']},
entry_points={
'console_scripts': [
'zx = zx:main',
],
},
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: X11 Applications :: GTK',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: C++',
# TODO: Are we going to support Python 2?
# TODO: Specific versions?
'Programming Language :: Python :: 3',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Games/Entertainment',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Emulators',
],
license='MIT',
# TODO: Respect other parameters.
)