Skip to content

Commit

Permalink
added windows/linux build support
Browse files Browse the repository at this point in the history
  • Loading branch information
playduck committed Mar 15, 2020
1 parent bbc3dd9 commit 6d537ec
Showing 1 changed file with 30 additions and 37 deletions.
67 changes: 30 additions & 37 deletions CSViewer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sys
import importlib

# add qtmodern qss files
package_imports = [['qtmodern', ['resources/frameless.qss', 'resources/style.qss']]]
package_imports = [["qtmodern", ["resources/frameless.qss", "resources/style.qss"]]]
added_file = []
for package, files in package_imports:
proot = Path(importlib.import_module(package).__file__).parent
Expand All @@ -27,62 +27,55 @@ for icon_file in icon_files:
assets
)])

print(added_file)

block_cipher = None

print(os.path.abspath(os.path.join(assets, "icon-512.icns")))


a = Analysis(['CSViewer.py'],
pathex=['/Users/robin/PycharmProjects/CSViewer'],
binaries=[],
datas=added_file,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
a = Analysis(["CSViewer.py"],
pathex=["/Users/robin/PycharmProjects/CSViewer"],
binaries=[],
datas=added_file,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)

pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
cipher=block_cipher)

if sys.platform == "darwin":
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name="CSViewer",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True,
icon=os.path.abspath(os.path.join(assets, "icon-512.icns"))
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name="CSViewer",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False,
icon=os.path.abspath(os.path.join(assets, "icon-512.icns"))
)
else:
elif sys.platform == "win32" or sys.platform == "win64" or sys.platform == "linux":
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='CSViewer',
name="CSViewer",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True,
console=False,
icon=os.path.abspath(os.path.join(assets, "icon-512.ico"))
)
)

# Package the executable file into .app if on OS X
if sys.platform == "darwin":
app = BUNDLE(exe,
name="CSViewer.app",
Expand Down

0 comments on commit 6d537ec

Please sign in to comment.