diff --git a/packaging/linux.spec b/packaging/linux.spec index ab27315..770cd91 100644 --- a/packaging/linux.spec +++ b/packaging/linux.spec @@ -46,11 +46,25 @@ a = Analysis( hookspath=[], hooksconfig={}, runtime_hooks=[], - excludes=[], + excludes=[ + 'PIL._avif', + 'PIL._webp', + 'PIL._imagingtk', + ], noarchive=False, cipher=block_cipher, ) +_PIL_EXCLUDE_PYDS = { + '_avif', '_webp', '_imagingtk', + 'FpxImagePlugin', 'MicImagePlugin', +} +a.binaries = [ + (name, path, typ) + for name, path, typ in a.binaries + if not any(ex in name for ex in _PIL_EXCLUDE_PYDS) +] + icon_path = os.path.join(os.path.dirname(SPEC), os.pardir, 'icon.ico') if os.path.exists(icon_path): a.datas += [('icon.ico', icon_path, 'DATA')] diff --git a/packaging/macos.spec b/packaging/macos.spec index 5f38945..ab10d1c 100644 --- a/packaging/macos.spec +++ b/packaging/macos.spec @@ -25,11 +25,25 @@ a = Analysis( hookspath=[], hooksconfig={}, runtime_hooks=[], - excludes=[], + excludes=[ + 'PIL._avif', + 'PIL._webp', + 'PIL._imagingtk', + ], noarchive=False, cipher=block_cipher, ) +_PIL_EXCLUDE_PYDS = { + '_avif', '_webp', '_imagingtk', + 'FpxImagePlugin', 'MicImagePlugin', +} +a.binaries = [ + (name, path, typ) + for name, path, typ in a.binaries + if not any(ex in name for ex in _PIL_EXCLUDE_PYDS) +] + icon_path = os.path.join(os.path.dirname(SPEC), os.pardir, 'icon.icns') if not os.path.exists(icon_path): icon_path = None diff --git a/packaging/windows.spec b/packaging/windows.spec index ff4e1b9..2fcfa5f 100644 --- a/packaging/windows.spec +++ b/packaging/windows.spec @@ -26,13 +26,27 @@ a = Analysis( hookspath=[], hooksconfig={}, runtime_hooks=[], - excludes=[], + excludes=[ + 'PIL._avif', + 'PIL._webp', + 'PIL._imagingtk', + ], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False, ) +_PIL_EXCLUDE_PYDS = { + '_avif', '_webp', '_imagingtk', + 'FpxImagePlugin', 'MicImagePlugin', +} +a.binaries = [ + (name, path, typ) + for name, path, typ in a.binaries + if not any(ex in name for ex in _PIL_EXCLUDE_PYDS) +] + icon_path = os.path.join(os.path.dirname(SPEC), os.pardir, 'icon.ico') version_path = os.path.join(os.path.dirname(SPEC), 'version_info.txt') if os.path.exists(icon_path):