add PyInstaller script and hook (#166)
This commit is contained in:
5
Makefile
5
Makefile
@@ -23,11 +23,14 @@ release: man completion docs/supportedsites.rst
|
|||||||
test:
|
test:
|
||||||
scripts/run_tests.sh
|
scripts/run_tests.sh
|
||||||
|
|
||||||
|
executable:
|
||||||
|
scripts/pyinstaller.py
|
||||||
|
|
||||||
completion: gallery-dl.bash_completion
|
completion: gallery-dl.bash_completion
|
||||||
|
|
||||||
man: gallery-dl.1 gallery-dl.conf.5
|
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
|
docs/supportedsites.rst: gallery_dl/*/*.py scripts/supportedsites.py
|
||||||
$(PYTHON) scripts/supportedsites.py
|
$(PYTHON) scripts/supportedsites.py
|
||||||
|
|||||||
9
scripts/hook-gallery_dl.py
Normal file
9
scripts/hook-gallery_dl.py
Normal 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
18
scripts/pyinstaller.py
Executable 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"),
|
||||||
|
])
|
||||||
Reference in New Issue
Block a user