Skip to content

Commit

Permalink
Merge pull request #1062 from vasole/pyinstaller
Browse files Browse the repository at this point in the history
[Package] Recover Pyinstaller under windows
  • Loading branch information
vasole authored Feb 26, 2024
2 parents 15d548a + 49d2a93 commit 97df07e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions package/pyinstaller/pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,11 @@ def cleanup_cache(topdir):

def replace_module(name):
dest = os.path.join(DISTDIR, script_n[0])
if sys.platform.startswith("darwin") and PyInstaller.__version__ >= '6.0.0':
target = os.path.join(dest, "special_modules")
if PyInstaller.__version__ >= '6.0.0':
if sys.platform.startswith("darwin"):
target = os.path.join(dest, "special_modules")
else:
target = os.path.join(dest, "_internal")
if not os.path.exists(target):
os.mkdir(target)
target = os.path.join(target, os.path.basename(name))
Expand Down Expand Up @@ -433,8 +436,11 @@ for fname in script_n:

# patch silx
if SILX:
if sys.platform.startswith("darwin") and PyInstaller.__version__ >= '6.0.0':
fname_dir = os.path.join(DISTDIR, script_n[0], "special_modules", "silx", "gui","qt")
if PyInstaller.__version__ >= '6.0.0':
if sys.platform.startswith("darwin"):
fname_dir = os.path.join(DISTDIR, script_n[0], "special_modules", "silx", "gui","qt")
else:
fname_dir = os.path.join(DISTDIR, script_n[0], "_internal", "silx", "gui","qt")
else:
fname_dir = os.path.join(DISTDIR, script_n[0], "silx", "gui","qt")
for name in ["_qt.py", "__init__.py"]:
Expand Down Expand Up @@ -465,7 +471,10 @@ if SILX:
# patch OpenCL
if OPENCL:
# pyopencl __init__.py needs to be patched
exe_win_dir = os.path.join(DISTDIR, script_n[0])
if PyInstaller.__version__ >= '6.0.0':
exe_win_dir = os.path.join(DISTDIR, script_n[0], "_internal")
else:
exe_win_dir = os.path.join(DISTDIR, script_n[0])
initFile = os.path.join(exe_win_dir, "pyopencl", "__init__.py")
logger.info("###################################################################")
logger.info("Patching pyopencl file")
Expand Down

0 comments on commit 97df07e

Please sign in to comment.