1 |
commit: 020a3d4461eb733c50046cbaf395010156d133d8 |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 20 07:25:40 2022 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 3 00:21:24 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=020a3d44 |
7 |
|
8 |
www-client/qutebrowser: add 3.0.0_pre9999 |
9 |
|
10 |
Test version using the wip-but-mostly-fine qt6-v2 branch to |
11 |
prepare for the 3.0.0 release planned to have qt6 support. |
12 |
|
13 |
Also some misc ebuild improvements, notably trying python-xdist |
14 |
which used to fail but seems fine now (upstream uses it too). |
15 |
|
16 |
Will be merged into normal -9999 when upstream merges to master. |
17 |
|
18 |
Closes: https://github.com/gentoo/gentoo/pull/26504 |
19 |
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> |
20 |
|
21 |
www-client/qutebrowser/metadata.xml | 1 + |
22 |
.../qutebrowser/qutebrowser-3.0.0_pre9999.ebuild | 174 +++++++++++++++++++++ |
23 |
2 files changed, 175 insertions(+) |
24 |
|
25 |
diff --git a/www-client/qutebrowser/metadata.xml b/www-client/qutebrowser/metadata.xml |
26 |
index 44b66f5f9007..224624c5a073 100644 |
27 |
--- a/www-client/qutebrowser/metadata.xml |
28 |
+++ b/www-client/qutebrowser/metadata.xml |
29 |
@@ -24,6 +24,7 @@ |
30 |
<use> |
31 |
<flag name="adblock">Enable Brave's ABP-style adblocker library |
32 |
for improved adblocking</flag> |
33 |
+ <flag name="qt6">Use Qt6 that provides a newer Chromium version</flag> |
34 |
<flag name="widevine">Unsupported closed-source DRM capability |
35 |
(required by Netflix VOD)</flag> |
36 |
</use> |
37 |
|
38 |
diff --git a/www-client/qutebrowser/qutebrowser-3.0.0_pre9999.ebuild b/www-client/qutebrowser/qutebrowser-3.0.0_pre9999.ebuild |
39 |
new file mode 100644 |
40 |
index 000000000000..50f156d349ff |
41 |
--- /dev/null |
42 |
+++ b/www-client/qutebrowser/qutebrowser-3.0.0_pre9999.ebuild |
43 |
@@ -0,0 +1,174 @@ |
44 |
+# Copyright 1999-2022 Gentoo Authors |
45 |
+# Distributed under the terms of the GNU General Public License v2 |
46 |
+ |
47 |
+EAPI=8 |
48 |
+ |
49 |
+DISTUTILS_SINGLE_IMPL=1 |
50 |
+DISTUTILS_USE_PEP517=setuptools |
51 |
+PYTHON_COMPAT=( python3_{8..11} ) |
52 |
+inherit distutils-r1 multiprocessing optfeature xdg |
53 |
+ |
54 |
+if [[ ${PV} == *9999 ]]; then |
55 |
+ inherit git-r3 |
56 |
+ EGIT_REPO_URI="https://github.com/qutebrowser/qutebrowser.git" |
57 |
+ EGIT_BRANCH="qt6-v2" |
58 |
+else |
59 |
+ SRC_URI="https://github.com/qutebrowser/qutebrowser/releases/download/v${PV}/${P}.tar.gz" |
60 |
+ KEYWORDS="~amd64" |
61 |
+fi |
62 |
+ |
63 |
+DESCRIPTION="Keyboard-driven, vim-like browser based on Python and Qt" |
64 |
+HOMEPAGE="https://www.qutebrowser.org/" |
65 |
+ |
66 |
+LICENSE="GPL-3+" |
67 |
+SLOT="0" |
68 |
+IUSE="+adblock +qt6 widevine" |
69 |
+ |
70 |
+RDEPEND=" |
71 |
+ $(python_gen_cond_dep ' |
72 |
+ dev-python/importlib_resources[${PYTHON_USEDEP}]' 3.8) |
73 |
+ $(python_gen_cond_dep ' |
74 |
+ dev-python/colorama[${PYTHON_USEDEP}] |
75 |
+ >=dev-python/jinja-3.1.2[${PYTHON_USEDEP}] |
76 |
+ >=dev-python/markupsafe-2.1.1[${PYTHON_USEDEP}] |
77 |
+ dev-python/pygments[${PYTHON_USEDEP}] |
78 |
+ >=dev-python/pyyaml-6[${PYTHON_USEDEP}] |
79 |
+ dev-python/zipp[${PYTHON_USEDEP}] |
80 |
+ adblock? ( dev-python/adblock[${PYTHON_USEDEP}] )') |
81 |
+ qt6? ( |
82 |
+ dev-qt/qtbase:6[icu] |
83 |
+ $(python_gen_cond_dep ' |
84 |
+ dev-python/PyQt6[${PYTHON_USEDEP},dbus,gui,network,opengl,printsupport,qml,sql,widgets] |
85 |
+ dev-python/PyQt6_WebEngine[${PYTHON_USEDEP},widgets]') |
86 |
+ ) |
87 |
+ !qt6? ( |
88 |
+ dev-qt/qtcore:5[icu] |
89 |
+ dev-qt/qtgui:5[png] |
90 |
+ $(python_gen_cond_dep ' |
91 |
+ dev-python/PyQt5[${PYTHON_USEDEP},dbus,declarative,gui,network,opengl,printsupport,sql,widgets] |
92 |
+ dev-python/PyQtWebEngine[${PYTHON_USEDEP}]') |
93 |
+ ) |
94 |
+ widevine? ( www-plugins/chrome-binary-plugins )" |
95 |
+BDEPEND=" |
96 |
+ $(python_gen_cond_dep ' |
97 |
+ test? ( |
98 |
+ dev-python/beautifulsoup4[${PYTHON_USEDEP}] |
99 |
+ dev-python/cheroot[${PYTHON_USEDEP}] |
100 |
+ dev-python/flask[${PYTHON_USEDEP}] |
101 |
+ dev-python/hypothesis[${PYTHON_USEDEP}] |
102 |
+ dev-python/pytest-bdd[${PYTHON_USEDEP}] |
103 |
+ dev-python/pytest-mock[${PYTHON_USEDEP}] |
104 |
+ dev-python/pytest-qt[${PYTHON_USEDEP}] |
105 |
+ dev-python/pytest-rerunfailures[${PYTHON_USEDEP}] |
106 |
+ dev-python/pytest-xdist[${PYTHON_USEDEP}] |
107 |
+ dev-python/pytest-xvfb[${PYTHON_USEDEP}] |
108 |
+ dev-python/tldextract[${PYTHON_USEDEP}] |
109 |
+ qt6? ( dev-python/PyQt6[testlib] ) |
110 |
+ !qt6? ( dev-python/PyQt5[testlib] ) |
111 |
+ )')" |
112 |
+[[ ${PV} == *9999 ]] && BDEPEND+=" app-text/asciidoc" |
113 |
+ |
114 |
+distutils_enable_tests pytest |
115 |
+ |
116 |
+src_prepare() { |
117 |
+ distutils-r1_src_prepare |
118 |
+ |
119 |
+ if use widevine; then |
120 |
+ # Qt6 knows Gentoo's, but pass to ensure libdir, EPREFIX, and for Qt5 |
121 |
+ local widevine=${EPREFIX}/usr/$(get_libdir)/chromium-browser/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so |
122 |
+ sed "/yield from _qtwebengine_settings_args/a\ yield '--widevine-path=${widevine}'" \ |
123 |
+ -i ${PN}/config/qtargs.py || die |
124 |
+ fi |
125 |
+ |
126 |
+ # ensure run the requested Qt backend |
127 |
+ sed -i '/^_WRAPPERS = /,/^]/c\_WRAPPERS = [ "PyQt'$(usex qt6 6 5)'" ]' \ |
128 |
+ ${PN}/qt/machinery.py || die |
129 |
+ |
130 |
+ # let eclass handle python |
131 |
+ sed -i '/setup.py/d' misc/Makefile || die |
132 |
+ |
133 |
+ # live version lacks pre-generated docs |
134 |
+ [[ ${PV} != *9999 ]] || ${EPYTHON} scripts/asciidoc2html.py || die |
135 |
+ |
136 |
+ # disable unnecessary tests/plugins that need extras (_ignore not enough) |
137 |
+ sed -e '/pytest-benchmark/d' -e 's/--benchmark[^ ]*//' \ |
138 |
+ -e '/pytest-instafail/d' -e 's/--instafail//' \ |
139 |
+ -i pytest.ini || die |
140 |
+ if [[ ${PV} == *9999 ]]; then |
141 |
+ rm tests/unit/scripts/test_run_vulture.py || die |
142 |
+ else |
143 |
+ rm tests/unit/scripts/test_problemmatchers.py || die |
144 |
+ fi |
145 |
+} |
146 |
+ |
147 |
+python_test() { |
148 |
+ local -x PYTEST_QT_API=pyqt$(usex qt6 6 5) |
149 |
+ |
150 |
+ local EPYTEST_DESELECT=( |
151 |
+ # end2end and other IPC tests are broken with "Name error" if |
152 |
+ # socket path is over ~104 characters (=124 in /var/tmp/portage) |
153 |
+ # https://github.com/qutebrowser/qutebrowser/issues/888 (not just OSX) |
154 |
+ tests/end2end |
155 |
+ tests/unit/misc/test_ipc.py |
156 |
+ # not worth running dbus over |
157 |
+ tests/unit/browser/test_notification.py::TestDBus |
158 |
+ # bug 819393 |
159 |
+ tests/unit/commands/test_userscripts.py::test_custom_env[_POSIXUserscriptRunner] |
160 |
+ # calls eclass' python2 "failure" wrapper |
161 |
+ tests/unit/misc/test_checkpyver.py::test_old_python |
162 |
+ # qtargs are mangled with USE=widevine |
163 |
+ $(usev widevine tests/unit/config/test_qtargs.py) |
164 |
+ ) |
165 |
+ |
166 |
+ # single thread is slow, but do half+1 given spikes ram usage quickly |
167 |
+ local jobs=$(($(makeopts_jobs) / 2 + 1)) |
168 |
+ |
169 |
+ # skip benchmarks (incl. _tree), and warning tests broken by -Wdefault |
170 |
+ epytest -n ${jobs} -k 'not _bench and not _matches_tree and not _warning' |
171 |
+} |
172 |
+ |
173 |
+python_install_all() { |
174 |
+ emake -f misc/Makefile DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install |
175 |
+ |
176 |
+ rm "${ED}"/usr/share/${PN}/scripts/{mkvenv,utils}.py || die |
177 |
+ fperms -x /usr/share/${PN}/{scripts/cycle-inputs.js,userscripts/README.md} |
178 |
+ python_fix_shebang "${ED}"/usr/share/${PN} |
179 |
+ |
180 |
+ einstalldocs |
181 |
+} |
182 |
+ |
183 |
+pkg_preinst() { |
184 |
+ xdg_pkg_preinst |
185 |
+ |
186 |
+ has_version "${CATEGORY}/${PN}[qt6]" && QUTEBROWSER_HAD_QT6= |
187 |
+} |
188 |
+ |
189 |
+pkg_postinst() { |
190 |
+ xdg_pkg_postinst |
191 |
+ |
192 |
+ optfeature "PDF display support" www-plugins/pdfjs |
193 |
+ |
194 |
+ if [[ ! ${REPLACING_VERSIONS} ]]; then |
195 |
+ elog "Note that optional scripts in ${EROOT}/usr/share/${PN}/{user,}scripts" |
196 |
+ elog "have additional dependencies not covered by this ebuild, for example" |
197 |
+ elog "view_in_mpv needs media-video/mpv[lua] and net-misc/yt-dlp." |
198 |
+ fi |
199 |
+ |
200 |
+ if [[ ! -v QUTEBROWSER_HAD_QT6 ]] && use qt6; then |
201 |
+ elog "USE=qt6 is enabled using the qt6-v2 branch, it is work-in-progress" |
202 |
+ elog "and some issues are to be expected. Can follow upstream progress at:" |
203 |
+ elog " https://github.com/qutebrowser/qutebrowser/issues/7202 [qt6 general]" |
204 |
+ elog " https://github.com/qutebrowser/qutebrowser/tree/qt6-v2 [used branch]" |
205 |
+ elog |
206 |
+ elog "You may optionally want to backup your ~/.local/share/${PN} before" |
207 |
+ elog "it is converted to use Qt6 WebEngine (one-way conversion). ${PN}" |
208 |
+ elog "will also warn about this on launch for a last chance to abort." |
209 |
+ fi |
210 |
+ |
211 |
+ # TODO: left-out given be confusing while IUSE is masked anywhere |
212 |
+# if use !qt6; then |
213 |
+# ewarn "USE=qt6 is disabled, be warned that Qt5's WebEngine uses an older" |
214 |
+# ewarn "chromium version. While it is relatively maintained for security, it may" |
215 |
+# ewarn "cause issues for sites/features designed with a newer version in mind." |
216 |
+# fi |
217 |
+} |