commit:     68bccf5f15c24ae1af8eaf66425628cb68d976f5
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  8 21:06:52 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Oct 15 15:43:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68bccf5f

www-client/qutebrowser: simplify, use single impl, tighten deps

misc/Makefile can do most of the install work (picking scripts,
man page, icons, etc...), just need to strip out setup.py to
leave this up to the eclass.

Since this isn't a library, there's little sense in not being
single python impl. Additionally use that single impl to fix
shebang of /usr/share/qutebrowser extra scripts.

Two new USE deps:
- qtcore:5[icu]: fix TestFileCompletion test (locale issues)
- qtgui:5[png]: fix 'Failed to load :/icons/qutebrowser-16x16.png'
May have other ill effects if missing, so ensure availability.

Also added basic postinst elog to warn that shouldn't expect all
scripts/userscripts to work as-is due to untracked dependencies.
Many are irrelevant to most users (kodi, nextcloud, keepassxc)
and do not wish to add more optfeature noise or control with USE.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 www-client/qutebrowser/qutebrowser-2.3.1-r2.ebuild | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/www-client/qutebrowser/qutebrowser-2.3.1-r2.ebuild 
b/www-client/qutebrowser/qutebrowser-2.3.1-r2.ebuild
new file mode 100644
index 00000000000..f5481f420b5
--- /dev/null
+++ b/www-client/qutebrowser/qutebrowser-2.3.1-r2.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_SINGLE_IMPL=1
+PYTHON_COMPAT=( python3_{8..9} )
+inherit distutils-r1 optfeature xdg
+
+if [[ ${PV} == 9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/qutebrowser/qutebrowser.git";
+else
+       
SRC_URI="https://github.com/qutebrowser/qutebrowser/releases/download/v${PV}/${P}.tar.gz";
+       KEYWORDS="~amd64 ~arm64 ~x86"
+fi
+
+DESCRIPTION="Keyboard-driven, vim-like browser based on PyQt5 and QtWebEngine"
+HOMEPAGE="https://www.qutebrowser.org/";
+
+LICENSE="GPL-3+"
+SLOT="0"
+IUSE="+adblock"
+# Tests depend (misc/requirements/requirements-tests.txt) on plugins
+# we don't have packages for.
+RESTRICT="test"
+
+RDEPEND="
+       dev-qt/qtcore:5[icu]
+       dev-qt/qtgui:5[png]
+       $(python_gen_cond_dep 
'dev-python/importlib_resources[${PYTHON_USEDEP}]' python3_8)
+       $(python_gen_cond_dep '
+               >=dev-python/colorama-0.4.4[${PYTHON_USEDEP}]
+               >=dev-python/jinja-3.0.1[${PYTHON_USEDEP}]
+               >=dev-python/markupsafe-2.0.1[${PYTHON_USEDEP}]
+               dev-python/pygments[${PYTHON_USEDEP}]
+               
dev-python/PyQt5[${PYTHON_USEDEP},dbus,declarative,multimedia,gui,network,opengl,printsupport,sql,widgets]
+               dev-python/PyQtWebEngine[${PYTHON_USEDEP}]
+               >=dev-python/pyyaml-5.4.1[${PYTHON_USEDEP},libyaml(+)]
+               dev-python/typing-extensions[${PYTHON_USEDEP}]
+               dev-python/zipp[${PYTHON_USEDEP}]
+               adblock? ( dev-python/adblock[${PYTHON_USEDEP}] )
+       ')"
+BDEPEND="app-text/asciidoc"
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+       distutils-r1_python_prepare_all
+
+       sed -i '/setup.py/d' misc/Makefile || die
+
+       [[ ${PV} != 9999 ]] || ${EPYTHON} scripts/asciidoc2html.py || die
+}
+
+python_install_all() {
+       emake -f misc/Makefile DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
+
+       rm "${ED}"/usr/share/${PN}/scripts/{mkvenv,utils}.py || die
+       fperms -x 
/usr/share/${PN}/{scripts/cycle-inputs.js,userscripts/README.md}
+       python_fix_shebang "${ED}"/usr/share/${PN}
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       optfeature "PDF display support" www-plugins/pdfjs
+
+       if [[ ! ${REPLACING_VERSIONS} ]]; then
+               elog "Note that optional scripts in 
${EROOT}/usr/share/${PN}/{user,}scripts"
+               elog "have additional dependencies not covered by this ebuild, 
for example"
+               elog "view_in_mpv needs media-video/mpv setup to use yt-dlp or 
youtube-dl."
+       fi
+}

Reply via email to