diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-03-17 17:25:52 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-03-17 17:25:52 +0100 |
commit | 7ae7b6ea1a20c8379ae072eea6bd1449788852a6 (patch) | |
tree | c50987c2af2a6323dec29c3d13ee7afffc8cb46a | |
parent | b062d7364cc9cae43cc25762517fb8fc3d1e97ba (diff) | |
download | qutebrowser-7ae7b6ea1a20c8379ae072eea6bd1449788852a6.tar.gz qutebrowser-7ae7b6ea1a20c8379ae072eea6bd1449788852a6.zip |
Fix version parsing with Flatpak
See https://github.com/flathub/org.qutebrowser.qutebrowser/issues/11
-rw-r--r-- | qutebrowser/misc/elf.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/qutebrowser/misc/elf.py b/qutebrowser/misc/elf.py index 1da4709af..4d44e56ac 100644 --- a/qutebrowser/misc/elf.py +++ b/qutebrowser/misc/elf.py @@ -69,7 +69,7 @@ from typing import IO, ClassVar, Dict, Optional, Tuple, cast from PyQt5.QtCore import QLibraryInfo -from qutebrowser.utils import log +from qutebrowser.utils import log, version class ParseError(Exception): @@ -310,7 +310,11 @@ def _parse_from_file(f: IO[bytes]) -> Versions: def parse_webenginecore() -> Optional[Versions]: """Parse the QtWebEngineCore library file.""" - library_path = pathlib.Path(QLibraryInfo.location(QLibraryInfo.LibrariesPath)) + if version.is_sandboxed(): + # Flatpak has Qt in /usr/lib/x86_64-linux-gnu, but QtWebEngine in /app/lib. + library_path = pathlib.Path("/app/lib") + else: + library_path = pathlib.Path(QLibraryInfo.location(QLibraryInfo.LibrariesPath)) # PyQt bundles those files with a .5 suffix lib_file = library_path / 'libQt5WebEngineCore.so.5' |