-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathsetup_exe.py
More file actions
executable file
·55 lines (44 loc) · 1.38 KB
/
setup_exe.py
File metadata and controls
executable file
·55 lines (44 loc) · 1.38 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
#!python3
import sys
sys.path.append ("src")
from cx_Freeze import setup, Executable
def CheckVersion ():
import subprocess
process = subprocess.Popen (["git", "describe", "--tags"],
universal_newlines=True, stdout=subprocess.PIPE)
outbuf, errbuf = process.communicate ()
if process.returncode != 0 or not outbuf:
return "unknown"
return outbuf.strip ()
versstring = CheckVersion ()
files_to_copy = [
("PyDoomResource.zip", "")
]
if sys.platform == "win32":
files_to_copy.append (("extern/SDL2-2.0.4/lib/x64/SDL2.dll", ""))
files_to_copy.append (("extern/glew-2.0.0/bin/Release/x64/glew32.dll", ""))
build_exe_options = dict (
excludes = ["bz2"],
include_files = files_to_copy,
constants = "GITVERSION={version}".format (version = repr (versstring))
)
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
target = "pydoom"
if sys.platform == "win32":
base = "Win32GUI"
target = "pydoom.exe"
exe = Executable (
"pydoom.py",
base = base,
targetName = target,
icon = "Logo.ico"
)
setup (
name = "PyDoom",
version = "0.1",
description = "A port of the game DOOM to the Python scripting language, aiming for maximum flexibility through modding.",
options = dict (build_exe = build_exe_options),
executables = [exe]
)