summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2022-02-08 19:39:25 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2022-02-09 19:53:17 +0000
commitd559f67ab976d869cf5a77122fc695f4619ea283 (patch)
treef1a0b04f8d7a4d83726445178ca79cfc88fdf5c8
parentd4f8775f442f782b04b08f515026d64811eb185a (diff)
downloaddeluge-d559f67ab976d869cf5a77122fc695f4619ea283.tar.gz
deluge-d559f67ab976d869cf5a77122fc695f4619ea283.tar.bz2
deluge-d559f67ab976d869cf5a77122fc695f4619ea283.zip
[Packaging] Fix pyinstaller to find installed deluge package data
Instead of relying on the source code paths use the pip installed Deluge package data.
-rw-r--r--packaging/win/delugewin.spec11
1 files 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,