]> git.friedersdorff.com Git - max/gentoo-overlay.git/blob - www-client/qutebrowser/qutebrowser-1.6.0.ebuild
www-client/qutebrowser: Correctly depend on PyQtWebengine
[max/gentoo-overlay.git] / www-client / qutebrowser / qutebrowser-1.6.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{3_5,3_6} )
6
7 inherit distutils-r1 eutils gnome2-utils xdg-utils
8
9 if [[ ${PV} == "9999" ]] ; then
10         EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
11         inherit git-r3
12 else
13         SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.gz"
14         KEYWORDS="~amd64 ~x86"
15 fi
16
17 DESCRIPTION="A keyboard-driven, vim-like browser based on PyQt5 and QtWebEngine"
18 HOMEPAGE="https://www.qutebrowser.org/ https://github.com/qutebrowser/qutebrowser"
19
20 LICENSE="GPL-3"
21 SLOT="0"
22 IUSE="scripts test"
23
24 COMMON_DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
25 DEPEND="${COMMON_DEPEND}
26         app-text/asciidoc
27         test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
28 RDEPEND="${COMMON_DEPEND}
29         dev-python/attrs[${PYTHON_USEDEP}]
30         >=dev-python/jinja-2.8[${PYTHON_USEDEP}]
31         >=dev-python/pygments-2.1.3[${PYTHON_USEDEP}]
32         >=dev-python/pypeg2-2.15.2[${PYTHON_USEDEP}]
33         >=dev-python/PyQt5-5.12_pre[${PYTHON_USEDEP},declarative,multimedia,gui,network,opengl,printsupport,sql,widgets]
34         >=dev-python/PyQtWebEngine-5.12[${PYTHON_USEDEP},widgets]
35         >=dev-python/pyyaml-3.12[${PYTHON_USEDEP},libyaml]
36 "
37
38 # Tests restricted as the deplist (misc/requirements/requirements-tests.txt)
39 # isn't complete and X11 is required in order to start up qutebrowser.
40 RESTRICT="test"
41
42 python_compile_all() {
43         if [[ ${PV} == "9999" ]]; then
44                 "${PYTHON}" scripts/asciidoc2html.py || die "Failed generating docs"
45         fi
46
47         a2x -f manpage doc/${PN}.1.asciidoc || die "Failed generating man page"
48 }
49
50 python_test() {
51         py.test tests || die "Tests failed with ${EPYTHON}"
52 }
53
54 python_install_all() {
55         doman doc/${PN}.1
56         domenu misc/${PN}.desktop
57         doicon -s scalable icons/${PN}.svg
58
59         if use scripts; then
60                 # Install only those userscripts that have an explicit license header
61                 exeinto /usr/share/qutebrowser/userscripts/
62                 doexe misc/userscripts/dmenu_qutebrowser
63                 doexe misc/userscripts/openfeeds
64                 doexe misc/userscripts/qute-keepass
65                 doexe misc/userscripts/qute-pass
66                 doexe misc/userscripts/rss
67                 doexe misc/userscripts/tor_identity
68         fi
69
70         distutils-r1_python_install_all
71 }
72
73 pkg_postinst() {
74         optfeature "PDF display support" www-plugins/pdfjs
75         xdg_desktop_database_update
76         xdg_mimeinfo_database_update
77         gnome2_icon_cache_update
78 }
79
80 pkg_postrm() {
81         xdg_desktop_database_update
82         xdg_mimeinfo_database_update
83         gnome2_icon_cache_update
84 }