]> git.friedersdorff.com Git - max/gentoo-overlay.git/blob - www-client/qutebrowser/qutebrowser-1.6.0.ebuild
71e3ff018fa9794d3334f2b85af68bdc844b91ee
[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/pyyaml-3.12[${PYTHON_USEDEP},libyaml]
35 "
36
37 # Tests restricted as the deplist (misc/requirements/requirements-tests.txt)
38 # isn't complete and X11 is required in order to start up qutebrowser.
39 RESTRICT="test"
40
41 python_compile_all() {
42         if [[ ${PV} == "9999" ]]; then
43                 "${PYTHON}" scripts/asciidoc2html.py || die "Failed generating docs"
44         fi
45
46         a2x -f manpage doc/${PN}.1.asciidoc || die "Failed generating man page"
47 }
48
49 python_test() {
50         py.test tests || die "Tests failed with ${EPYTHON}"
51 }
52
53 python_install_all() {
54         doman doc/${PN}.1
55         domenu misc/${PN}.desktop
56         doicon -s scalable icons/${PN}.svg
57
58         if use scripts; then
59                 # Install only those userscripts that have an explicit license header
60                 exeinto /usr/share/qutebrowser/userscripts/
61                 doexe misc/userscripts/dmenu_qutebrowser
62                 doexe misc/userscripts/openfeeds
63                 doexe misc/userscripts/qute-keepass
64                 doexe misc/userscripts/qute-pass
65                 doexe misc/userscripts/rss
66                 doexe misc/userscripts/tor_identity
67         fi
68
69         distutils-r1_python_install_all
70 }
71
72 pkg_postinst() {
73         optfeature "PDF display support" www-plugins/pdfjs
74         xdg_desktop_database_update
75         xdg_mimeinfo_database_update
76         gnome2_icon_cache_update
77 }
78
79 pkg_postrm() {
80         xdg_desktop_database_update
81         xdg_mimeinfo_database_update
82         gnome2_icon_cache_update
83 }