Bug 273252

Summary: www/qutebrowser: Update to 3.0.0 and ${FLAVOR}'ise use of WebEngine
Product: Ports & Packages Reporter: Alastair Hogge <agh>
Component: Individual Port(s)Assignee: Roman Bogorodskiy <novel>
Status: Closed FIXED    
Severity: Affects Only Me CC: agh, eduardo
Priority: --- Flags: bugzilla: maintainer-feedback? (novel)
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://github.com/qutebrowser/qutebrowser/blob/main/doc/changelog.asciidoc#v300-2023-08-18
Attachments:
Description Flags
www/qutebrowser: Update to 3.0.0 and switch to Qt-6 WebEngine
none
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6 sprinkles
none
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6
none
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6
none
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6
none
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6
none
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6
none
updated patch without MOVED changes none

Description Alastair Hogge 2023-08-21 00:46:13 UTC
Created attachment 244240 [details]
www/qutebrowser: Update to 3.0.0 and switch to Qt-6 WebEngine

Hello,

While working around Python-2.7 challenges in 14-CURRENT, I noticed that upstream had recently merged in support for Qt-6 WebEngine. After updating the Port to use Qt-6, I then noticed that upstream tagged a 3.x release. Attached is patch for both updating and switching to Qt-6.

Changlog: https://github.com/qutebrowser/qutebrowser/blob/main/doc/changelog.asciidoc#v300-2023-08-18

* Update to 3.0.0
* Add ${LICENSE_FILE}
* Add Python setuptools and wheel pkgs to dependencies
* port{clippy,fmt,lint} maintenance
Comment 1 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-08-21 18:15:30 UTC
Hi Alastair, thanks for the patch.
What do you think about adding a flavor for qt6, and keep a fallback option for qt5 for users who don't want to move to qt6 yet?

Similarly how it's done in `security/gpgme` or any other port found by `egrep -r ".*FLAVOR.*qt[56].*"`
Comment 2 Alastair Hogge 2023-08-21 20:39:47 UTC
Challenge accepted.
Comment 3 Alastair Hogge 2023-08-22 02:50:30 UTC
Created attachment 244276 [details]
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6 sprinkles

Update to 3, tho restructure the port for Qt-5 or Qt-6 flavours of WebEngine.
Comment 4 Alastair Hogge 2023-08-22 02:53:36 UTC
(In reply to Roman Bogorodskiy from comment #1)

Hey Roman,

I think the recent patch addresses your idea of adding ${FLAVORS}, also does the following handle the fallback you are referring to?

FLAVORS=	qt5 qt6
FLAVOR?=	${FLAVORS:[1]}
Comment 5 Nuno Teixeira freebsd_committer freebsd_triage 2023-08-22 07:48:28 UTC
Hello!

This is really good news and I will try new version with qt6 flavor asap!

I have some ports flavorized with qt5/qt6 and some being using qt6 as default depending on upstream recomendation which is the case of qutebrowser.

Cheers
Comment 6 Alastair Hogge 2023-08-22 08:17:35 UTC
(In reply to Nuno Teixeira from comment #5)

Hey Nuno,

I would be interested in hearing your thoughts, as initially, on my host the Qt-6 variant appears sluggish over the Qt-5 variant.
Comment 7 Nuno Teixeira freebsd_committer freebsd_triage 2023-08-22 11:56:02 UTC
(In reply to Alastair Hogge from comment #6)

Sure! I'm doing a major rebuilding of my ports on 14-ALPHA2 and tomorrow morning I will have both flavors fresh and ready to do some comparisons.
Comment 8 Nuno Teixeira freebsd_committer freebsd_triage 2023-08-23 08:41:58 UTC
(In reply to Alastair Hogge from comment #6)

Testing qt6 flavor:

tabs opened:
- mail.google.com OK
- youtube.com (1080p, sound) OK
- facebook.com OK
- wirple.com (gl tests) OK
- github.com OK

All smooth and stable,low cpu, processes spawn and memory
Very curious to test it on my rpi4!

My source of comparison is firefox that I use for many years.
I will switch to qt5 flavor when I have a better experience with qt6.

If/when I switch flavors I will use clean configs:

rm -r .config/qutebrowser
rm -r .local/share/qutebrowser

-----
Questions/Notes:

- :config-edit calls 'gvim' that I don't use. I will search for a way to use 'nvi'(base) if that possible

- Any specific situation/test that I should compare between flavors?
- Does port needs flavor CONFLICTS or it is possible to install both?
-----
Comment 9 Nuno Teixeira freebsd_committer freebsd_triage 2023-08-23 10:44:49 UTC
(In reply to Nuno Teixeira from comment #8)

> - :config-edit calls 'gvim' that I don't use. I will search for a way to use
> 'nvi'(base) if that possible

It seems that it only works with gui editors.
We don't have gvim, but I'm working on flavorize editors/neovim-qt and add qt6 to it.
Comment 10 Nuno Teixeira freebsd_committer freebsd_triage 2023-08-23 11:04:28 UTC
(In reply to Nuno Teixeira from comment #9)

> We don't have gvim, ...

editors/vim:

.  for F in (...) gvim (...)
        ${LN} -sf vim ${STAGEDIR}${PREFIX}/bin/$F

Will try both, but I think neovim-qt will be best since it shares qt5/qt6 flavors when flavorized port is done.

Tomorrow morning I will have results.
Comment 11 Nuno Teixeira freebsd_committer freebsd_triage 2023-08-23 14:40:10 UTC
(In reply to Nuno Teixeira from comment #10)

Nice! Now port have the possibility of depending on upstream default editor gvim from editors/vim or flavored editors/neovim-qt which is nice because it shares same deps as qutebrowser on selected flavor.

https://cgit.freebsd.org/ports/commit/?id=759dd1d9268bede36ef83561616c6f9d46d48549

Cheers
Comment 12 Alastair Hogge 2023-08-23 14:55:25 UTC
(In reply to Nuno Teixeira from comment #11)

That is so cool! I will try and translate that, to the patch here...when I get a booting system again.
Comment 13 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-08-27 16:38:28 UTC
- I guess we'd need to have CONFLICTS_INSTALL between flavors as most of the plist files will be the same, not allowing packages to be installed at the same time,
- Also, it looks like we'd need to add a MOVED entry for the smooth transition from the non-flavored version.

In the meantime I've briefly tested the qt5 version, and plan to test the qt6 soon.

PS The patch itself looks good, wondering about the ADBLOCK_DESC formatting changes, is that caused by the linter complain?
Comment 14 Alastair Hogge 2023-08-27 19:31:27 UTC
(In reply to Roman Bogorodskiy from comment #13)

Yes, a double tab was from removed from ${ADBLOCK_DESC} due to a warning from portlint.

I am still stuck with tracing a boot panic, and an old classic (root mount hang on CAM) on my 15-CURRENT desktop/build box, so I might be a few more days away before I can continue, if someone else beats me, awesome, otherwise I will work at all the suggestions when I can.

Thanks.
Comment 15 Alastair Hogge 2023-09-05 05:13:13 UTC
Created attachment 244650 [details]
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6

Hi all,

Latest .diff:
• install man page
• add ${flavor_CONFLICTS_INSTALL} 
• add local patches to modify the default GUI editor from gvim to neovim-qt

Regarding the MOVED entry, I added an entry similar to security/gpgme-qt5:

> www/qutebrowser|www/qutebrowser@qt5|2023-09-05|Flavorize, qutebrowser@qt5 (default), or use www/qutebrowser@qt6

However, this prevented me from building the -qt6 variation. I have only tested the Qt6 variation, and it works great, with nvim-qt too.
Comment 16 Alastair Hogge 2023-09-05 08:36:29 UTC
Created attachment 244654 [details]
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6

• Update local patches to provide some more info about editor.command regarding nvim-qt.
Comment 17 Nuno Teixeira freebsd_committer freebsd_triage 2023-09-05 10:02:17 UTC
Hello!

Sugestions:

-qt5_RUN_DEPENDS=	nvim-qt:editors/neovim-qt@qt5
-qt6_RUN_DEPENDS=	nvim-qt:editors/neovim-qt@qt6
+RUN_DEPENDS=		(...)
+			nvim-qt:editors/neovim-qt@${FLAVOR}

[1]
	${INSTALL_MAN} ${WRKSRC}/doc/${PORTNAME}.1 \
-		${STAGEDIR}${MAN1PREFIX}/man/man1
+		${STAGEDIR}${PREFIX}/share/man/man1

-PLIST_FILES=	man/man1/${PORTNAME}.1.gz \
		share/applications/${PORTNAME}-${PYTHON_VER}.desktop
+PLIST_FILES=	share/man/man1/${PORTNAME}.1.gz \
		share/applications/${PORTNAME}-${PYTHON_VER}.desktop
[1]
20200115:
AUTHOR: bapt@FreeBSD.org

  ${PREFIX}/share/man is now a valid location for manpages ${PREFIX}/man being
  considered as deprecated.

Cheers
Comment 18 Alastair Hogge 2023-09-05 13:58:41 UTC
Created attachment 244661 [details]
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6

Thanks Nuno, awesome suggestions (comment #17), updated diff to reflect that, thanks so much.
Comment 19 Alastair Hogge 2023-09-05 14:23:30 UTC
Created attachment 244663 [details]
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6

• add dos2unix for use with one patch file, and regenerate patch (portlint)
• fix ordering of Uses block (portlint)
Comment 20 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-09-05 17:58:24 UTC
I'm not sure I like the runtime dependency on nvim-qt. I don't use qt flavors of vim and with this change there's no way for me to opt out of that feature. I'm imagine this scenario is valid not only for me.
Comment 21 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-09-05 18:04:22 UTC
(In reply to Alastair Hogge from comment #6)

Is that still a case that qt6 flavor is more sluggish for you?
I gave it some testing and qt6 flavors feels a little better than qt5 on my system.
Comment 22 Alastair Hogge 2023-09-05 22:26:41 UTC
(In reply to Roman Bogorodskiy from comment #20)
Fair enuf, I will remove the nvim-qt patches.
Comment 23 Alastair Hogge 2023-09-05 22:32:16 UTC
(In reply to Roman Bogorodskiy from comment #21)

I am unable to build WebEngine-5 at all on any release anymore, so I can no longer test the qt5 variation, the qt6 variation tho, that runs very well at the moment. I think the previous sluggishness may have resulted from pkg updates between 14 and 15.
Comment 24 Alastair Hogge 2023-09-05 22:56:06 UTC
Created attachment 244669 [details]
www/qutebrowser: Update to 3.0.0 and flavourise WebEngine with Qt-5 or Qt-6

• drop local patches to make nvim-qt default editor
• remove runtime dependency on nvim-qt
Comment 25 Nuno Teixeira freebsd_committer freebsd_triage 2023-09-06 07:14:06 UTC
(In reply to Alastair Hogge from comment #16)

> • Update local patches to provide some more info about editor.command
> regarding nvim-qt.

Could you open an PR or a pull request for those changes at upstream?
It would be nice to have it documented.

Thanks.
Comment 26 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-09-06 16:28:26 UTC
(In reply to Alastair Hogge from comment #23)

Great, if qt6 version works good for you too, I'll make it default to follow upstream here, and push the commit after some testing.
Comment 27 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-09-06 18:34:29 UTC
Created attachment 244683 [details]
updated patch without MOVED changes

I have to apologize because, apparently, my recommendation about the MOVED entry was incorrect, and according to Tools/scripts/MOVEDlint.awk, the entry shouldn't point to the flavorized version of itself.

What I did is the following:

 - Removed the MOVED entry
 - Removed pkg suffix for qt6 flavor, i.e. qt6 flavor is now just "qutebrowser", and the qt5 flavor is "qutebrowser-qt5". I've also updated CONFLICTS accordingly. 

I'm still running test builds as it take a while.
Comment 28 Alastair Hogge 2023-09-06 22:54:31 UTC
(In reply to Nuno Teixeira from comment #25)

Sure, will do that, and record the issue here.
Comment 29 Alastair Hogge 2023-09-06 23:05:13 UTC
(In reply to Roman Bogorodskiy from comment #26)

That would be so awesome, thanking you very much.

(In reply to Roman Bogorodskiy from comment #27)

I am still confused, because the MOVED entry did not point to the flavourised -qt5 Port:

>  www/qutebrowser||2023-09-05|Flavorize, use qutebrowser@qt5 (default), or www/qutebrowser@qt6

The second column between the two |'s is empty.

Regardless, thanks for your help.
Comment 30 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-09-07 03:26:15 UTC
(In reply to Alastair Hogge from comment #29)

Yes, I should have elaborated about MOVED:

 - With the second column empty, it'd mean the port is deleted, which is not applicable to our situation
 - With the second column pointing to the flavorized version it doesn't work properly due to reasons described above
Comment 31 Alastair Hogge 2023-09-07 03:28:34 UTC
(In reply to Roman Bogorodskiy from comment #30)
That makes sense, thanks for that.
Comment 32 Nuno Teixeira freebsd_committer freebsd_triage 2023-09-07 08:10:38 UTC
(In reply to Roman Bogorodskiy from comment #30)

e.g.:
audio/kid3-qt5|audio/kid3@qt5|2022-09-13|Merged into flavorized version
net-im/qxmpp-qt5|net-im/qxmpp|2023-05-26|Port flavorized for Qt 5 and 6
(etc)

The oposit doesn't work as jbeich replied to ea3553f:

---
Note, MOVED doesn't support flavors as "from port" field e.g.,

$ echo "x11/waybar@hyprland|x11/waybar|2023-09-03|Test" >>MOVED
$ poudriere bulk -Nj 132amd64 x11/waybar@hyprland
[...]
[00:00:02] Ignoring x11/waybar@hyprland | waybar-hyprland-0.9.22: Unknown flavor 'hyprland', possible flavors: default nopulse
[...]
---

But I think considering 'qt6' flavor as 'qt' and 'qt5' as 'qt5' when upstream defaults to qt6.
Comment 33 Nuno Teixeira freebsd_committer freebsd_triage 2023-09-07 08:40:47 UTC
(In reply to Nuno Teixeira from comment #32)

(...)
But I think considering 'qt6' flavor as 'qt' and 'qt5' as 'qt5' when upstream defaults to qt6 a very nice decision.
I will do the same for some ports I maintain when upstream defaults/sugests to qt6.
Comment 34 commit-hook freebsd_committer freebsd_triage 2023-09-07 17:57:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7129b6aed00364678b9380fa036fb471fac2f91e

commit 7129b6aed00364678b9380fa036fb471fac2f91e
Author:     Alastair Hogge <agh@riseup.net>
AuthorDate: 2023-09-06 16:35:10 +0000
Commit:     Roman Bogorodskiy <novel@FreeBSD.org>
CommitDate: 2023-09-07 17:54:25 +0000

    www/qutebrowser: Update to 3.0.0 and flavourise

     - Update to 3.0.0
     - Flavourise WebEngine with Qt-5 or Qt-6, Qt-6 being default
       version as per upstream
     - Add ${LICENSE_FILE}
     - Pet portlint

    PR:             273252
    Reviewed by:    eduardo, novel
    Approved by:    novel (maintainer)

 www/qutebrowser/Makefile | 48 ++++++++++++++++++++++++++++++++++++------------
 www/qutebrowser/distinfo |  6 +++---
 2 files changed, 39 insertions(+), 15 deletions(-)
Comment 35 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-09-07 17:59:03 UTC
(In reply to Nuno Teixeira from comment #33)

I think the "qt" flavor doesn't add too much value as qutebrowser cannot be used without qt, so it's implied that qt is always there.
Comment 36 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-09-07 17:59:23 UTC
Committed, thanks!
Comment 37 Alastair Hogge 2023-11-15 05:24:58 UTC
(In reply to Nuno Teixeira from comment #25)

Hello,

> Could you open an PR or a pull request for those changes at upstream?
> It would be nice to have it documented.

I previously said I would do this, however, I am well over Surveillance Capitalism and the struggle to reduce my exposure to it, on top of the absurd workflow that GitHub brings, to an already laughable dumpster fire that is git(1), I will not be pursuing this for the time being. Sorry compas.