This repository was archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.py
More file actions
51 lines (42 loc) · 1.27 KB
/
build.py
File metadata and controls
51 lines (42 loc) · 1.27 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
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Copyright 2024 Guilherme M. Miranda <alchemist.software@proton.me>
import os
import platform
windows_cmd = 'pyinstaller src/master.py ' \
+ ' --log-level WARN' \
+ ' --onefile ' \
+ ' --add-data "src/vcdiff.zip;."' \
+ ' --icon masterpack.ico' \
+ ' --noupx'
linux_to_windows_cmd = 'wine' \
+ ' pyinstaller src/master.py' \
+ ' --log-level WARN' \
+ ' --onefile ' \
+ ' --add-data "src/vcdiff.zip;."' \
+ ' --icon masterpack.ico' \
+ ' --noupx'
linux_cmd = 'pyinstaller src/master.py' \
+ ' --log-level WARN' \
+ ' --onefile' \
+ ' --add-data=src/vcdiff.zip:.' \
+ ' --noupx'
def windows_build():
print('Building for Windows')
os.system(linux_to_windows_cmd)
print('Package built')
def linux_build():
print('Building for Windows...')
os.system(linux_to_windows_cmd)
print('Building for Linux...')
os.system(linux_cmd)
print('Packages built')
if platform.system() == '':
print('Could not assertain the operating system. Exiting safely')
exit(1)
elif platform.system() == 'Windows':
print('Host is Windows.')
windows_build()
elif platform.system() == 'Linux':
print('Host is Linux.')
linux_build()