On Tue, Apr 06, 2021 at 11:41:11AM +0100, Stuart Henderson wrote:
> On 2021/04/06 03:13, Anindya Mukherjee wrote:
> > On Tue, Apr 06, 2021 at 10:26:49AM +0100, Stuart Henderson wrote:
> > > Ohhhh I see what it's doing. Yeuch.
> > > 
> > > 'This is a "best effort" parser. If it errors out, we instead end up 
> > > relying
> > > on the PyQtWebEngine version, which is the next best thing.'
> > > 
> > > This suggests that the fallback is not working correctly. We aren't doing
> > > anything funny with the PyQtWebEngine version.
> > 
> > For some reason the fallback reports Chromium version as 87.x instead of
> > 83.x which we have. Debug output (just below the logo):
> > http://ix.io/2V9a
> > 
> > I haven't looked into this further to see exactly why PyQt reports the
> > wrong version. QtWebEngine is reported as 5.15.4 instead of 5.15.2.
> 
> Seems that it is picking up the version number of PyQtWebEngine, not 
> QtWebEngine.
> 
> If the QtWebEngine version number isn't available from PyQtWebEngine then
> I suppose it could look for the highest-numbered library version instead and
> use that for the ELF parser..not ideal but at least that should stay working
> when QtWebEngine is updated.
> 
This patch does the job of finding library with the highest version quite well.
I've tested with the plurality of some base library versions.

regards,
  Dimitri

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/qutebrowser/Makefile,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile
--- Makefile    2 Apr 2021 14:24:40 -0000       1.28
+++ Makefile    6 Apr 2021 13:54:37 -0000
@@ -4,6 +4,7 @@ COMMENT =               keyboard-focused browser with
 
 MODPY_EGG_VERSION =    2.1.1
 DISTNAME =             qutebrowser-${MODPY_EGG_VERSION}
+REVISION =             0
 
 HOMEPAGE =             https://www.qutebrowser.org/
 
Index: patches/patch-qutebrowser_misc_elf_py
===================================================================
RCS file: patches/patch-qutebrowser_misc_elf_py
diff -N patches/patch-qutebrowser_misc_elf_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-qutebrowser_misc_elf_py       6 Apr 2021 13:54:37 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+Fix QtWebEngine version detection on OpenBSD
+
+Index: qutebrowser/misc/elf.py
+--- qutebrowser/misc/elf.py.orig
++++ qutebrowser/misc/elf.py
+@@ -316,8 +316,8 @@ def parse_webenginecore() -> Optional[Versions]:
+     else:
+         library_path = 
pathlib.Path(QLibraryInfo.location(QLibraryInfo.LibrariesPath))
+ 
+-    # PyQt bundles those files with a .5 suffix
+-    lib_file = library_path / 'libQt5WebEngineCore.so.5'
++    library_name = 
sorted(list(pathlib.Path(library_path).glob('libQt5WebEngineCore.so*')))
++    lib_file = library_path / library_name[-1].as_posix()
+     if not lib_file.exists():
+         return None
+ 

Reply via email to