From d559f67ab976d869cf5a77122fc695f4619ea283 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Tue, 8 Feb 2022 19:39:25 +0000 Subject: [PATCH] [Packaging] Fix pyinstaller to find installed deluge package data Instead of relying on the source code paths use the pip installed Deluge package data. --- packaging/win/delugewin.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packaging/win/delugewin.spec b/packaging/win/delugewin.spec index 360198ea0..ece6db9fe 100644 --- a/packaging/win/delugewin.spec +++ b/packaging/win/delugewin.spec @@ -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,