2018-12-16 23:25:44 -06:00
|
|
|
# -*- coding: utf-8 -*-
|
2019-11-15 17:46:36 -06:00
|
|
|
import sys
|
2016-02-21 08:17:12 -06:00
|
|
|
import application
|
|
|
|
import platform
|
2019-11-15 17:46:36 -06:00
|
|
|
import os
|
2020-07-10 00:04:23 -05:00
|
|
|
import languageHandler
|
2021-09-22 09:00:41 -05:00
|
|
|
from cx_Freeze import setup, Executable, winmsvcr
|
2020-02-28 15:41:14 -06:00
|
|
|
from babel.messages import frontend as babel
|
2016-02-21 08:17:12 -06:00
|
|
|
|
2020-07-10 00:04:23 -05:00
|
|
|
languageHandler.setLanguage("en")
|
|
|
|
|
2019-11-19 17:32:37 -06:00
|
|
|
def find_sound_lib_datafiles():
|
2021-09-22 09:17:12 -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-11-19 17:32:37 -06:00
|
|
|
|
|
|
|
def find_accessible_output2_datafiles():
|
2021-09-22 09:17:12 -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-11-19 17:32:37 -06:00
|
|
|
|
2019-11-15 17:46:36 -06:00
|
|
|
base = None
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
base = 'Win32GUI'
|
2016-02-21 08:17:12 -06:00
|
|
|
|
2019-11-15 17:46:36 -06:00
|
|
|
build_exe_options = dict(
|
2021-09-22 09:17:12 -05:00
|
|
|
build_exe="dist",
|
|
|
|
optimize=1,
|
|
|
|
include_msvcr=True,
|
|
|
|
zip_include_packages=["accessible_output2", "sound_lib", "arrow"],
|
|
|
|
replace_paths = [("*", "")],
|
2021-11-14 11:32:42 -06:00
|
|
|
include_files=["session.defaults", "cacert.pem", "app-configuration.defaults", "locales", "sounds", "documentation", "../windows-dependencies/x86/oggenc2.exe", "../windows-dependencies/x86/bootstrap.exe", find_sound_lib_datafiles(), find_accessible_output2_datafiles(), ("../windows-dependencies/dictionaries", "lib/enchant/data/mingw32/share/enchant/hunspell")],
|
2021-09-22 09:17:12 -05:00
|
|
|
packages=["interactors", "presenters", "views", "wxUI"],
|
|
|
|
)
|
2016-02-21 08:17:12 -06:00
|
|
|
|
2019-11-15 17:46:36 -06:00
|
|
|
executables = [
|
2019-11-19 17:32:37 -06:00
|
|
|
Executable('main.py', base=base, targetName="socializer")
|
2019-11-15 17:46:36 -06:00
|
|
|
]
|
2016-02-21 08:17:12 -06:00
|
|
|
|
2021-09-22 09:00:41 -05:00
|
|
|
# Empty list of files to be copied, as this might cause conflicts with microsoft's redistributable packages we have already in the repo.
|
|
|
|
winmsvcr.FILES = ()
|
|
|
|
winmsvcr.FILES_TO_DUPLICATE = ()
|
|
|
|
|
2019-11-15 17:46:36 -06:00
|
|
|
setup(name='Socializer',
|
|
|
|
version=application.version,
|
|
|
|
description=application.description,
|
2020-02-28 15:41:14 -06:00
|
|
|
# Register babel commands in setup file.
|
|
|
|
cmdclass = {'compile_catalog': babel.compile_catalog,
|
|
|
|
'extract_messages': babel.extract_messages,
|
|
|
|
'init_catalog': babel.init_catalog,
|
|
|
|
'update_catalog': babel.update_catalog},
|
|
|
|
message_extractors = {"socializer": [('**.py', 'python', None)]},
|
2019-11-15 17:46:36 -06:00
|
|
|
options = {"build_exe": build_exe_options},
|
|
|
|
executables=executables
|
|
|
|
)
|