-
Notifications
You must be signed in to change notification settings - Fork 15
/
make-win-devtest.py
executable file
·88 lines (73 loc) · 3.51 KB
/
make-win-devtest.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
#!/usr/bin/env python
import os, shutil
mainDir = os.getcwd()
packageDir = "/share/wc/dev";
if not os.path.exists(packageDir):
os.makedirs(packageDir)
# shutil.copytree() fails if destination dir exists
def copytree (src, dest):
if not os.path.exists(dest):
os.makedirs(dest)
for f in os.listdir(src):
s = os.path.join(src, f)
d = os.path.join(dest, f)
if os.path.isdir(s):
copytree(s, d)
else:
shutil.copy2(s, d)
packageFilesDir = "package-files"
files = os.listdir(packageFilesDir)
for f in files:
fpath = os.path.join(packageFilesDir, f)
print("copying package file: " + fpath)
if os.path.isdir(fpath):
#shutil.copytree(fpath, os.path.join(packageDir, f))
copytree(fpath, os.path.join(packageDir, f))
else:
shutil.copy2(fpath, packageDir)
baseFiles = ["COPYING.txt", "COPYING-backtrace.txt", "CREDITS-wolfcam.txt", "CREDITS-openarena.txt", "README-ioquake3.txt", "README-wolfcam.txt", "opengl2-readme.md", "version.txt", "unifont-LICENSE.txt", "voip-readme.txt"]
for f in baseFiles:
print("copying base file: " + f)
shutil.copy(f, packageDir)
# 64-bit
libDir = os.path.join("code", "libs", "win64")
buildDir = os.path.join("build", "release-mingw32-x86_64")
wolfcamDir = os.path.join(packageDir, "wolfcam-ql")
if os.path.exists(os.path.join(buildDir, "ioquake3.x86_64.exe")):
print("copying 64-bit Windows binaries...")
try:
shutil.copy2(os.path.join(libDir, "SDL264.dll"), packageDir)
shutil.copy2(os.path.join(libDir, "backtrace64.dll"), packageDir)
shutil.copy2(os.path.join(buildDir, "ioquake3.x86_64.exe"), packageDir)
shutil.move(os.path.join(packageDir, "ioquake3.x86_64.exe"), os.path.join(packageDir, "wolfcamql.exe"))
shutil.copy2(os.path.join(buildDir, "renderer_opengl1_x86_64.dll"), packageDir)
shutil.copy2(os.path.join(buildDir, "renderer_opengl2_x86_64.dll"), packageDir)
shutil.copy2(os.path.join(buildDir, "baseq3", "cgamex86_64.dll"), wolfcamDir)
shutil.copy2(os.path.join(buildDir, "baseq3", "qagamex86_64.dll"), wolfcamDir)
shutil.copy2(os.path.join(buildDir, "baseq3", "uix86_64.dll"), wolfcamDir)
except IOError as err:
print(err)
else:
print("skipping 64-bit Windows binaries")
# 32-bit
libDir = os.path.join("code", "libs", "win32")
buildDir = os.path.join("build", "release-mingw32-x86")
wolfcamDir = os.path.join(packageDir, "wolfcam-ql")
if os.path.exists(os.path.join(buildDir, "ioquake3.x86.exe")):
print("copying 32-bit Windows binaries...")
try:
shutil.copy2(os.path.join(libDir, "SDL2.dll"), packageDir)
shutil.copy2(os.path.join(libDir, "backtrace.dll"), packageDir)
shutil.copy2(os.path.join(buildDir, "ioquake3.x86.exe"), packageDir)
shutil.move(os.path.join(packageDir, "ioquake3.x86.exe"), os.path.join(packageDir, "wolfcamql32.exe"))
shutil.copy2(os.path.join(buildDir, "renderer_opengl1_x86.dll"), packageDir)
shutil.copy2(os.path.join(buildDir, "renderer_opengl2_x86.dll"), packageDir)
shutil.copy2(os.path.join(buildDir, "baseq3", "cgamex86.dll"), wolfcamDir)
shutil.copy2(os.path.join(buildDir, "baseq3", "qagamex86.dll"), wolfcamDir)
shutil.copy2(os.path.join(buildDir, "baseq3", "uix86.dll"), wolfcamDir)
except IOError as err:
print(err)
else:
print("skipping 32-bit Windows binaries")
print("copying misc files...")
shutil.copy2(os.path.join("ui", "wcmenudef.h"), os.path.join(packageDir, "wolfcam-ql", "ui"))