Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/qutebrowser/
Date: Fri, 15 Oct 2021 15:53:46
Message-Id: 1634312635.0b8b467249ed31d90aaeb9e535d039c08379bafa.ionen@gentoo
1 commit: 0b8b467249ed31d90aaeb9e535d039c08379bafa
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 12 19:02:25 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 15 15:43:55 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b8b4672
7
8 www-client/qutebrowser: sync and update live ebuild
9
10 Now also running asciidoc2html needed for :help / qute://help
11 to function (these are pre-converted in release copy).
12
13 Done in prepare_all given has to be before python_compile for
14 simplicity (compile_all runs after compile) and only only done
15 once rather than per-implementation (not that using multiple).
16
17 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
18
19 www-client/qutebrowser/metadata.xml | 2 -
20 www-client/qutebrowser/qutebrowser-9999.ebuild | 162 +++++++++++++++----------
21 2 files changed, 95 insertions(+), 69 deletions(-)
22
23 diff --git a/www-client/qutebrowser/metadata.xml b/www-client/qutebrowser/metadata.xml
24 index bfc1e23ae3f..44b66f5f900 100644
25 --- a/www-client/qutebrowser/metadata.xml
26 +++ b/www-client/qutebrowser/metadata.xml
27 @@ -24,8 +24,6 @@
28 <use>
29 <flag name="adblock">Enable Brave's ABP-style adblocker library
30 for improved adblocking</flag>
31 - <flag name="scripts">Installs userscripts from the misc/userscripts
32 - directory to /usr/share/qutebrowser/userscripts.</flag>
33 <flag name="widevine">Unsupported closed-source DRM capability
34 (required by Netflix VOD)</flag>
35 </use>
36
37 diff --git a/www-client/qutebrowser/qutebrowser-9999.ebuild b/www-client/qutebrowser/qutebrowser-9999.ebuild
38 index c015de929af..22d3277e686 100644
39 --- a/www-client/qutebrowser/qutebrowser-9999.ebuild
40 +++ b/www-client/qutebrowser/qutebrowser-9999.ebuild
41 @@ -3,92 +3,120 @@
42
43 EAPI=8
44
45 -PYTHON_COMPAT=( python3_{8..9} )
46 -DISTUTILS_USE_SETUPTOOLS="rdepend"
47 +DISTUTILS_SINGLE_IMPL=1
48 +PYTHON_COMPAT=( python3_{8..10} )
49 +inherit distutils-r1 optfeature xdg
50
51 -inherit desktop distutils-r1 git-r3 optfeature xdg
52 +if [[ ${PV} == 9999 ]]; then
53 + inherit git-r3
54 + EGIT_REPO_URI="https://github.com/qutebrowser/qutebrowser.git"
55 +else
56 + SRC_URI="https://github.com/qutebrowser/qutebrowser/releases/download/v${PV}/${P}.tar.gz"
57 + KEYWORDS="~amd64 ~arm64 ~x86"
58 +fi
59
60 DESCRIPTION="Keyboard-driven, vim-like browser based on PyQt5 and QtWebEngine"
61 -HOMEPAGE="https://www.qutebrowser.org/ https://github.com/qutebrowser/qutebrowser"
62 -EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
63 +HOMEPAGE="https://www.qutebrowser.org/"
64
65 LICENSE="GPL-3+"
66 SLOT="0"
67 -IUSE="scripts test"
68 +IUSE="+adblock widevine"
69
70 -BDEPEND="
71 - app-text/asciidoc"
72 RDEPEND="
73 - dev-python/attrs[${PYTHON_USEDEP}]
74 - dev-python/colorama[${PYTHON_USEDEP}]
75 - dev-python/cssutils[${PYTHON_USEDEP}]
76 + dev-qt/qtcore:5[icu]
77 + dev-qt/qtgui:5[png]
78 $(python_gen_cond_dep 'dev-python/importlib_resources[${PYTHON_USEDEP}]' python3_8)
79 - dev-python/jinja[${PYTHON_USEDEP}]
80 - dev-python/markupsafe[${PYTHON_USEDEP}]
81 - dev-python/pygments[${PYTHON_USEDEP}]
82 - dev-python/pypeg2[${PYTHON_USEDEP}]
83 - dev-python/PyQt5[${PYTHON_USEDEP},dbus,declarative,multimedia,gui,network,opengl,printsupport,sql,widgets]
84 - dev-python/PyQtWebEngine[${PYTHON_USEDEP}]
85 - >=dev-python/pyyaml-5.4.1[${PYTHON_USEDEP},libyaml(+)]
86 - dev-python/typing-extensions[${PYTHON_USEDEP}]
87 - dev-python/zipp[${PYTHON_USEDEP}]
88 -"
89 -
90 -distutils_enable_tests setup.py
91 -
92 -# Tests restricted as the deplist (misc/requirements/requirements-tests.txt)
93 -# isn't complete and X11 is required in order to start up qutebrowser.
94 -RESTRICT="test"
95 -
96 -python_compile() {
97 - ${EPYTHON} scripts/asciidoc2html.py || die
98 - distutils-r1_python_compile
99 + $(python_gen_cond_dep '
100 + >=dev-python/colorama-0.4.4[${PYTHON_USEDEP}]
101 + >=dev-python/jinja-3.0.2[${PYTHON_USEDEP}]
102 + >=dev-python/markupsafe-2.0.1[${PYTHON_USEDEP}]
103 + dev-python/pygments[${PYTHON_USEDEP}]
104 + dev-python/PyQt5[${PYTHON_USEDEP},dbus,declarative,multimedia,gui,network,opengl,printsupport,sql,widgets]
105 + dev-python/PyQtWebEngine[${PYTHON_USEDEP}]
106 + >=dev-python/pyyaml-5.4.1[${PYTHON_USEDEP},libyaml(+)]
107 + >=dev-python/typing-extensions-3.10.0.2[${PYTHON_USEDEP}]
108 + >=dev-python/zipp-3.6.0[${PYTHON_USEDEP}]
109 + adblock? ( dev-python/adblock[${PYTHON_USEDEP}] )
110 + ')
111 + widevine? ( www-plugins/chrome-binary-plugins )"
112 +BDEPEND="
113 + app-text/asciidoc
114 + $(python_gen_cond_dep '
115 + test? (
116 + dev-python/beautifulsoup4[${PYTHON_USEDEP}]
117 + dev-python/cheroot[${PYTHON_USEDEP}]
118 + dev-python/flask[${PYTHON_USEDEP}]
119 + dev-python/hypothesis[${PYTHON_USEDEP}]
120 + dev-python/pytest-bdd[${PYTHON_USEDEP}]
121 + dev-python/pytest-mock[${PYTHON_USEDEP}]
122 + dev-python/pytest-qt[${PYTHON_USEDEP}]
123 + dev-python/pytest-rerunfailures[${PYTHON_USEDEP}]
124 + dev-python/pytest-xvfb[${PYTHON_USEDEP}]
125 + dev-python/tldextract[${PYTHON_USEDEP}]
126 + )
127 + ')"
128 +
129 +distutils_enable_tests pytest
130 +
131 +python_prepare_all() {
132 + distutils-r1_python_prepare_all
133 +
134 + if use widevine; then
135 + sed "/yield from _qtwebengine_settings_args/a\ yield '--widevine-path=${EPREFIX}/usr/$(get_libdir)/chromium-browser/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so'" \
136 + -i ${PN}/config/qtargs.py || die
137 + fi
138 +
139 + sed -i '/setup.py/d' misc/Makefile || die
140 +
141 + [[ ${PV} != 9999 ]] || ${EPYTHON} scripts/asciidoc2html.py || die
142 +
143 + # these plugins/tests are unnecessary here and have extra dependencies
144 + sed -e '/pytest-benchmark/d;s/--benchmark[^ ]*//' \
145 + -e '/pytest-instafail/d;s/--instafail//' \
146 + -i pytest.ini || die
147 + [[ ${PV} == 9999 ]] || rm tests/unit/scripts/test_problemmatchers.py || die
148 + [[ ${PV} != 9999 ]] || rm tests/unit/scripts/test_run_vulture.py || die
149 }
150
151 -python_compile_all() {
152 - a2x -f manpage doc/${PN}.1.asciidoc || die "Failed generating man page"
153 +python_test() {
154 + local EPYTEST_DESELECT=(
155 + # end2end and other IPC tests are broken with "Name error" if
156 + # socket path is over 104 characters (=124 in /var/tmp/portage)
157 + # https://github.com/qutebrowser/qutebrowser/issues/888 (not just OSX)
158 + tests/end2end
159 + tests/unit/misc/test_ipc.py
160 + # tests that don't know about our newer qtwebengine
161 + tests/unit/browser/webengine/test_webenginedownloads.py::TestDataUrlWorkaround
162 + tests/unit/utils/test_version.py::TestChromiumVersion
163 + # needs qtwebkit and isn't skipped by default
164 + tests/unit/config/test_websettings.py::test_config_init
165 + # may misbehave depending on installed old python versions
166 + tests/unit/misc/test_checkpyver.py::test_old_python
167 + )
168 + use widevine && EPYTEST_DESELECT+=( tests/unit/config/test_qtargs.py )
169 +
170 + # skip benchmarks (incl. _tree), and warning tests broken by -Wdefault
171 + epytest -k 'not _bench and not _matches_tree and not _warning'
172 }
173
174 python_install_all() {
175 - doman doc/${PN}.1
176 - domenu misc/org.${PN}.${PN}.desktop
177 - doicon -s scalable icons/${PN}.svg
178 -
179 - if use scripts; then
180 - insinto /usr/share/qutebrowser/userscripts/
181 - doins misc/userscripts/README.md
182 - exeinto /usr/share/qutebrowser/userscripts/
183 - doexe misc/userscripts/add-nextcloud-bookmarks \
184 - misc/userscripts/add-nextcloud-cookbook \
185 - misc/userscripts/cast \
186 - misc/userscripts/dmenu_qutebrowser \
187 - misc/userscripts/format_json \
188 - misc/userscripts/getbib \
189 - misc/userscripts/kodi \
190 - misc/userscripts/open_download \
191 - misc/userscripts/openfeeds \
192 - misc/userscripts/password_fill \
193 - misc/userscripts/qr \
194 - misc/userscripts/qute-bitwarden \
195 - misc/userscripts/qutedmenu \
196 - misc/userscripts/qute-keepass \
197 - misc/userscripts/qute-keepassxc \
198 - misc/userscripts/qute-lastpass \
199 - misc/userscripts/qute-pass \
200 - misc/userscripts/readability \
201 - misc/userscripts/readability-js \
202 - misc/userscripts/ripbang \
203 - misc/userscripts/rss \
204 - misc/userscripts/taskadd \
205 - misc/userscripts/tor_identity \
206 - misc/userscripts/view_in_mpv
207 - fi
208 + emake -f misc/Makefile DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
209
210 - distutils-r1_python_install_all
211 + rm "${ED}"/usr/share/${PN}/scripts/{mkvenv,utils}.py || die
212 + fperms -x /usr/share/${PN}/{scripts/cycle-inputs.js,userscripts/README.md}
213 + python_fix_shebang "${ED}"/usr/share/${PN}
214 +
215 + einstalldocs
216 }
217
218 pkg_postinst() {
219 xdg_pkg_postinst
220
221 optfeature "PDF display support" www-plugins/pdfjs
222 +
223 + if [[ ! ${REPLACING_VERSIONS} ]]; then
224 + elog "Note that optional scripts in ${EROOT}/usr/share/${PN}/{user,}scripts"
225 + elog "have additional dependencies not covered by this ebuild, for example"
226 + elog "view_in_mpv needs media-video/mpv setup to use yt-dlp or youtube-dl."
227 + fi
228 }