Skip to content

Commit

Permalink
Releases: Update packaging script
Browse files Browse the repository at this point in the history
  • Loading branch information
BLKSerene committed Aug 7, 2023
1 parent d1a3303 commit b19e10d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
23 changes: 20 additions & 3 deletions utils/macos_pyinstaller_recompile_bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import requests

PYINSTALLER_VER = '5.9.0'
PYINSTALLER_VER = '5.13.0'

# Fetch codes
print(f'Downloading PyInstaller {PYINSTALLER_VER}... ', end = '')
Expand Down Expand Up @@ -51,18 +51,35 @@
# codesign does not work properly on OS X 10.11
with open('PyInstaller/building/utils.py', 'r+', encoding = 'utf_8') as f:
pyinstaller_building_utils = f.read()
pyinstaller_building_utils = pyinstaller_building_utils.replace('osxutils.sign_binary(cachedfile, codesign_identity, entitlements_file)', '# osxutils.sign_binary(cachedfile, codesign_identity, entitlements_file)')
pyinstaller_building_utils = pyinstaller_building_utils.replace(
'osxutils.sign_binary(cachedfile, codesign_identity, entitlements_file)',
'# osxutils.sign_binary(cachedfile, codesign_identity, entitlements_file)'
)

f.seek(0)
f.write(pyinstaller_building_utils)

with open('PyInstaller/building/api.py', 'r+', encoding = 'utf_8') as f:
pyinstaller_building_api = f.read()
pyinstaller_building_api = pyinstaller_building_api.replace('osxutils.remove_signature_from_binary(build_name)', '# osxutils.remove_signature_from_binary(build_name)')
pyinstaller_building_api = pyinstaller_building_api.replace(
'osxutils.remove_signature_from_binary(build_name)',
'# osxutils.remove_signature_from_binary(build_name)'
)

f.seek(0)
f.write(pyinstaller_building_api)

# Fix Underthesea
with open('PyInstaller/utils/osx.py', 'r+', encoding = 'utf_8') as f:
pyinstaller_utils_osx = f.read()
pyinstaller_utils_osx = pyinstaller_utils_osx.replace(
'p = subprocess.run(cmd_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)\n if p.returncode:',
'p = subprocess.run(cmd_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)\n if p.returncode and False:'
)

f.seek(0)
f.write(pyinstaller_utils_osx)

# Install recompiled version of PyInstaller
os.chdir('..')

Expand Down
5 changes: 4 additions & 1 deletion utils/wl_packaging.spec
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ hiddenimports = [
'uk_core_news_sm',

# SudachiPy
'sudachidict_core'
'sudachidict_core',

# Underthesea
'sklearn.pipeline'
]

# Exclusions
Expand Down

0 comments on commit b19e10d

Please sign in to comment.