forked from cosarara/blue-spider
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·75 lines (65 loc) · 2.08 KB
/
setup.py
File metadata and controls
executable file
·75 lines (65 loc) · 2.08 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# To build just cython in place:
# python setup.py build_ext --inplace
import sys
import os
try:
if not "--freeze" in sys.argv: # hack!
fail()
sys.argv.remove("--freeze")
from cx_Freeze import setup, Extension, Executable
except:
print("Warning: cx_Freeze not found. Using distutils")
from distutils.core import setup, Extension
# lol hack
class Executable:
def __init__(self, a, base):
pass
try:
with os.popen("git describe --always | sed 's|-|.|g'") as psfile:
version = psfile.read().strip("\n")
except:
version = "git"
base = None
basecli = None
if sys.platform == "win32":
base = "Win32GUI"
data_files = [
'data/events/*',
'data/mov_perms/*',
'data/icon*',
'data/*.tbl',
]
data_files_cxfreeze = ['bluespider/data/', 'README.txt', 'imageformats']
build_exe_options = {"packages": ["pkg_resources"],
"include_files": data_files_cxfreeze,
"includes": "PyQt5.QtCore",
"icon": "utils/bluespider.ico"}
try:
from Cython.Build import cythonize
ext_modules = cythonize(os.path.join("bluespider", "fast.pyx"))
except ImportError:
print("Warning: Couldn't cythonize")
ext_modules = []
#cmapped = Extension('cmapped',
# sources = ['mapped.cpp'])
#ext_modules += [cmapped]
setup(name='BlueSpider',
version=version,
description="Blue Spider map editor for the GBA pokémon games",
author="Jaume (cosarara97) Delclòs",
author_email="cosarara97@gmail.com",
url="https://github.com/cosarara97/blue-spider",
packages=['bluespider'],
package_data={'bluespider': data_files},
py_modules = ['appdirs'],
scripts=['bluespider-qt', 'bluespider-cli'],
requires=['sip', 'PyQt5', 'PIL'],
options={"build_exe": build_exe_options},
executables=[
Executable("bluespider-qt", base=base),
Executable("bluespider-cli", base=basecli),
],
ext_modules=ext_modules
)