Skip to content

Instantly share code, notes, and snippets.

@lephuongbg
Last active May 20, 2021 00:43
Show Gist options
  • Save lephuongbg/b5f7f8d0a1be39ca973fe29ac325380e to your computer and use it in GitHub Desktop.
Save lephuongbg/b5f7f8d0a1be39ca973fe29ac325380e to your computer and use it in GitHub Desktop.
Pyinstaller hook example to bundle WebKitGTK with a pywebview application
# Read more about pyinstaller hooks here:
# https://pyinstaller.readthedocs.io/en/stable/hooks.html
from PyInstaller.utils.hooks import get_gi_typelibs
binaries = []
datas = []
hiddenimports = []
_binaries, _datas, _hiddenimports = get_gi_typelibs("WebKit2", "4.0")
binaries += _binaries
datas += _datas
hiddenimports += _hiddenimports
_binaries, _datas, _hiddenimports = get_gi_typelibs("Soup", "2.4")
binaries += _binaries
datas += _datas
hiddenimports += _hiddenimports
_binaries, _datas, _hiddenimports = get_gi_typelibs("JavaScriptCore", "4.0")
binaries += _binaries
datas += _datas
hiddenimports += _hiddenimports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment