[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
commit d559f67ab9
No known key found for this signature in database
GPG key ID: 90597A687B836BA3

View file

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