Attempt to use Nuitka to generate Socializer

This commit is contained in:
Manuel Cortez 2021-12-14 15:27:02 -06:00
parent b46634997e
commit b5ef428f5e
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
6 changed files with 32 additions and 7 deletions

View File

@ -103,12 +103,13 @@ pages:
# Write version info useful for updates.
- '&$env:PYTHON3_32 write_version_data.py'
# build it all.
- '&$env:PYTHON3_32 setup.py build'
- '&$env:PYTHON3_32 -m nuitka --mingw64 --standalone --enable-plugin=anti-bloat --noinclude-pytest-mode=nofollow --noinclude-setuptools-mode=nofollow --nofollow-import-to=numpy --nofollow-import-to=babel --nofollow-import-to=cx_freeze --nofollow-import-to=pil --include-package-data=enchant --include-data-file=../windows-dependencies/x86/oggenc2.exe=oggenc2.exe --include-data-file=../windows-dependencies/x86/bootstrap.exe=bootstrap.exe --include-data-file=app-configuration.defaults=app-configuration.defaults --include-data-dir=locales=locales --include-data-dir=documentation=documentation --include-data-dir=sounds=sounds --include-data-file=session.defaults=session.defaults --windows-disable-console --windows-file-description="Accessible VK Client for Windows" --windows-product-version=2021.12.14.0 --windows-file-version=2021.12.14.0 --windows-product-name="Socializer" --windows-company-name="MCV Software" --python-flag=no_site --assume-yes-for-downloads --remove-output "socializer.py"'
- '&$env:PYTHON3_32 ..\scripts\copy_missing_files.py'
# Once built, make the installer.
- '&$env:NSIS installer.nsi'
- cd ..
- mkdir artifacts
- move src\socializer* artifacts\
- cd scripts
# Zips the folder in order to create the portable socializer version.
- '&$env:PYTHON3_32 prepare_zipversion.py'

View File

@ -14,7 +14,7 @@ googletrans
mutagen
mock
babel
cx_freeze
nuitka
pyenchant
git+https://github.com/accessibleapps/libloader
git+https://github.com/accessibleapps/platform_utils

View File

@ -0,0 +1,26 @@
#! /usr/bin/env python# -*- coding: iso-8859-1 -*-
import shutil
import os
import accessible_output2
import sound_lib
import enchant
dist_folder = "socializer.dist"
accessible_output2_files = accessible_output2.find_datafiles()
final_folder = os.path.join(dist_folder, accessible_output2_files[0][0])
module_dir = os.path.dirname(accessible_output2_files[0][1][0])
shutil.copytree(module_dir, final_folder)
soundlib_files = sound_lib.find_datafiles()
final_folder = os.path.join(dist_folder, soundlib_files[0][0])
os.makedirs(final_folder, exist_ok=True)
for file in soundlib_files[0][1]:
shutil.copy(file, final_folder)
enchant_path = os.path.dirname(enchant.__file__)
final_folder = os.path.join(dist_folder, "enchant")
if os.path.exists(final_folder):
os.remove(final_folder)
os.makedirs(final_folder, exist_ok=True)
shutil.copytree(os.path.join(enchant_path, "data"), os.path.join(final_folder, "data"))

View File

@ -6,7 +6,7 @@ import sys
def create_archive():
os.chdir("..\\src")
print("Creating zip archive...")
folder = "dist"
folder = "socializer.dist"
shutil.make_archive("socializer", "zip", folder)
# if os.path.exists("dist"):
# shutil.rmtree("dist")

View File

@ -37,7 +37,7 @@ var StartMenuFolder
Section
SetShellVarContext All
SetOutPath "$INSTDIR"
File /r dist\*
File /r socializer.dist\*
CreateShortCut "$DESKTOP\socializer.lnk" "$INSTDIR\socializer.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"

View File

@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
import logger
import sys
import fixes
import traceback
#if hasattr(sys, "frozen"):
fixes.setup()
import platform
import languageHandler
import widgetUtils