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:37:09 +0100 |
commit | aa1801ecae2ce1d9d811bd33fd46359fc4d0c0e4 (patch) | |
tree | 8cd8f9bc27e8018e6c55eda16b07278bd64b5467 | |
parent | c82e2bbe0b4563b453980171388a863488c55506 (diff) | |
download | qutebrowser-aa1801ecae2ce1d9d811bd33fd46359fc4d0c0e4.tar.gz qutebrowser-aa1801ecae2ce1d9d811bd33fd46359fc4d0c0e4.zip |
Fix version parsing with Flatpak
See https://github.com/flathub/org.qutebrowser.qutebrowser/issues/11
(cherry picked from commit 7ae7b6ea1a20c8379ae072eea6bd1449788852a6)
-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' |