2019-12-16 16:52:59 -06:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import sys
|
2014-10-27 16:29:04 -06:00
|
|
|
import application
|
|
|
|
import platform
|
2019-12-16 16:52:59 -06:00
|
|
|
import os
|
2021-07-07 01:41:08 -05:00
|
|
|
from cx_Freeze import setup, Executable, winmsvcr
|
2016-05-07 17:08:40 -05:00
|
|
|
from requests import certs
|
2014-10-27 16:29:04 -06:00
|
|
|
|
|
|
|
def get_architecture_files():
|
2021-06-16 16:18:41 -05:00
|
|
|
if platform.architecture()[0][:2] == "32":
|
|
|
|
return ["../windows-dependencies/x86/oggenc2.exe", "../windows-dependencies/x86/bootstrap.exe", "../windows-dependencies/x86/libvlc.dll", "../windows-dependencies/x86/libvlccore.dll", "../windows-dependencies/x86/plugins", ["../windows-dependencies/dictionaries", "lib/enchant/data/mingw32/share/enchant/hunspell"], ["../windows-dependencies/x86/Microsoft.VC142.CRT", "."], ["../windows-dependencies/x86/Microsoft.VC142.MFC", "."]]
|
|
|
|
elif platform.architecture()[0][:2] == "64":
|
|
|
|
return ["../windows-dependencies/x64/oggenc2.exe", "../windows-dependencies/x64/bootstrap.exe", "../windows-dependencies/x64/libvlc.dll", "../windows-dependencies/x64/libvlccore.dll", "../windows-dependencies/x64/plugins", ["../windows-dependencies/dictionaries", "lib/enchant/data/mingw64/share/enchant/hunspell"], ["../windows-dependencies/x64/Microsoft.VC142.CRT", "."], ["../windows-dependencies/x64/Microsoft.VC142.MFC", "."]]
|
2014-10-27 16:29:04 -06:00
|
|
|
|
2019-12-16 16:52:59 -06:00
|
|
|
def find_sound_lib_datafiles():
|
2021-06-16 16:18:41 -05:00
|
|
|
import os
|
|
|
|
import platform
|
|
|
|
import sound_lib
|
|
|
|
path = os.path.join(sound_lib.__path__[0], 'lib')
|
|
|
|
if platform.architecture()[0] == '32bit' or platform.system() == 'Darwin':
|
|
|
|
arch = 'x86'
|
|
|
|
else:
|
|
|
|
arch = 'x64'
|
|
|
|
dest_dir = os.path.join('sound_lib', 'lib', arch)
|
|
|
|
source = os.path.join(path, arch)
|
|
|
|
return (source, dest_dir)
|
2019-12-16 16:52:59 -06:00
|
|
|
|
|
|
|
def find_accessible_output2_datafiles():
|
2021-06-16 16:18:41 -05:00
|
|
|
import os
|
|
|
|
import accessible_output2
|
|
|
|
path = os.path.join(accessible_output2.__path__[0], 'lib')
|
|
|
|
dest_dir = os.path.join('accessible_output2', 'lib')
|
|
|
|
return (path, dest_dir)
|
2019-12-16 16:52:59 -06:00
|
|
|
|
|
|
|
base = None
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
base = 'Win32GUI'
|
|
|
|
|
|
|
|
build_exe_options = dict(
|
2021-06-16 16:18:41 -05:00
|
|
|
build_exe="dist",
|
|
|
|
optimize=1,
|
|
|
|
includes=["enchant.tokenize.en"], # This is not handled automatically by cx_freeze.
|
2021-07-07 01:41:08 -05:00
|
|
|
include_msvcr=False,
|
2021-06-16 16:18:41 -05:00
|
|
|
replace_paths = [("*", "")],
|
|
|
|
include_files=["icon.ico", "conf.defaults", "app-configuration.defaults", "keymaps", "locales", "sounds", "documentation", ("keys/lib", "keys/lib"), find_sound_lib_datafiles(), find_accessible_output2_datafiles()]+get_architecture_files(),
|
|
|
|
packages=["wxUI"],
|
2021-10-29 10:58:30 -05:00
|
|
|
bin_path_excludes=["C:\\Program Files", "C:\Program Files (x86)"],
|
2021-06-16 16:18:41 -05:00
|
|
|
)
|
2019-12-16 16:52:59 -06:00
|
|
|
|
|
|
|
executables = [
|
2021-10-29 10:58:30 -05:00
|
|
|
Executable('main.py', base=base, target_name="twblue")
|
2019-12-16 16:52:59 -06:00
|
|
|
]
|
|
|
|
|
2021-07-07 01:41:08 -05:00
|
|
|
winmsvcr.FILES = ()
|
|
|
|
winmsvcr.FILES_TO_DUPLICATE = ()
|
2019-12-16 16:52:59 -06:00
|
|
|
setup(name=application.name,
|
|
|
|
version=application.version,
|
|
|
|
description=application.description,
|
|
|
|
options = {"build_exe": build_exe_options},
|
|
|
|
executables=executables
|
|
|
|
)
|