1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 12:12:34 +01:00

add PyInstaller script and hook (#166)

This commit is contained in:
Mike Fährmann 2019-04-16 18:23:46 +02:00
parent 96c7ccd380
commit 18345381f3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 31 additions and 1 deletions

View File

@ -23,11 +23,14 @@ release: man completion docs/supportedsites.rst
test:
scripts/run_tests.sh
executable:
scripts/pyinstaller.py
completion: gallery-dl.bash_completion
man: gallery-dl.1 gallery-dl.conf.5
.PHONY: all clean install release test completion man
.PHONY: all clean install release test executable completion man
docs/supportedsites.rst: gallery_dl/*/*.py scripts/supportedsites.py
$(PYTHON) scripts/supportedsites.py

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from gallery_dl import extractor, downloader, postprocessor
hiddenimports = [
package.__name__ + "." + module
for package in (extractor, downloader, postprocessor)
for module in package.modules
]

18
scripts/pyinstaller.py Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Build a standalone executable using PyInstaller"""
import PyInstaller.__main__
import util
PyInstaller.__main__.run([
"--onefile",
"--console",
"--name", "gallery-dl." + ("exe" if PyInstaller.is_win else "bin"),
"--additional-hooks-dir", util.path("scripts"),
"--distpath", util.path("dist"),
"--workpath", util.path("build"),
"--specpath", util.path("build"),
util.path("gallery_dl", "__main__.py"),
])