[Packaging] Fix pyinstaller to find installed deluge package data

Instead of relying on the source code paths use the pip installed Deluge
package data.
This commit is contained in:
Calum Lind 2022-02-08 19:39:25 +00:00
parent d4f8775f44
commit d559f67ab9
No known key found for this signature in database
GPG Key ID: 90597A687B836BA3
1 changed files with 7 additions and 4 deletions

View File

@ -2,7 +2,7 @@
import os
import sys
import deluge.common
from PyInstaller.utils.hooks import collect_all, collect_submodules, copy_metadata
from PyInstaller.utils.hooks import collect_data_files, collect_submodules, copy_metadata
datas = []
binaries = []
@ -100,8 +100,11 @@ for module in stdlib:
hiddenimports += collect_submodules('twisted', filter=lambda name: 'test' not in name)
datas += copy_metadata('twisted', recursive=True)
# Copy UI/Plugin files to where pyinstaller expects
datas += [('../../deluge/ui', 'deluge/ui'), ('../../deluge/plugins', 'deluge/plugins')]
# Copy UI/Plugin and translation files to where pyinstaller expects
package_data = collect_data_files('deluge')
datas += package_data
icon = [src for src, dest in package_data if src.endswith('deluge.ico')][0]
# List of executables to produce
executables = {
@ -185,7 +188,7 @@ for e, d in executables.items():
bootloader_ignore_signals=False,
strip=False,
upx=True,
icon='../../deluge/ui/data/pixmaps/deluge.ico',
icon=icon,
console=d['console'],
disable_windowed_traceback=False,
target_arch=None,