Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ separator = { macos = ':', ubuntu = ':', windows = ';' }
dir_suffix = { macos = '.app', ubuntu = '', windows = '' }
content_suffix = { macos = 'Contents/MacOS/', ubuntu = '', windows = '' }
libs = { macos = 'libsDarwin', ubuntu = 'libsLinux', windows = 'libsWin32' }
missing_calculator_libs = { macos = [], ubuntu = [], windows = ['GSASII.libs', 'CFML.libs'] }
missing_pyside2_files = { macos = ['libshiboken2.abi3.*.dylib'], ubuntu = [], windows = ['shiboken2.abi3.dll', 'MSVCP140.dll'] }
missing_pyside2_plugins = { macos = [], ubuntu = ['Qt/plugins/xcbglintegrations'], windows = [] } # EGL and GLX plugins
missing_other_libraries = {macos = [], ubuntu = [], windows = ['libs/libiomp5md.dll', 'libs/opengl32.dll'] }
Expand Down
20 changes: 20 additions & 0 deletions tools/Scripts/FreezeApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import os, sys
import glob
import site
import PySide2, shiboken2
import cryspy, GSASII
import easyCore, easyDiffractionLib, easyApp
Expand Down Expand Up @@ -43,6 +44,8 @@ def addedData():
for extra_file in extras:
data.append({'from': extra_file, 'to': '.'})

data = data + copyCalculators()

formatted = []
for element in data:
formatted.append(f'--add-data={element["from"]}{separator}{element["to"]}')
Expand All @@ -56,6 +59,23 @@ def appIcon():
icon_path = os.path.abspath(icon_path)
return f'--icon={icon_path}'

def copyCalculators():
missing_calculator_libs = CONFIG['ci']['pyinstaller']['missing_calculator_libs'][CONFIG.os]
data = []
try:
message = 'Copy calculator libraries'
# use the last element, since on certain conda installations we get more than one entry
site_packages_path = site.getsitepackages()[-1]
for lib_name in missing_calculator_libs:
lib_path = os.path.join(site_packages_path, lib_name)
data.append({'from': lib_path, 'to': lib_name})
except Exception as exception:
Functions.printFailMessage(message, exception)
sys.exit(1)

Functions.printSuccessMessage(message)
return data

def copyMissingLibs():
missing_files = CONFIG['ci']['pyinstaller']['missing_pyside2_files'][CONFIG.os]
if len(missing_files) == 0:
Expand Down