]> git.friedersdorff.com Git - max/gentoo-overlay.git/blob - www-client/qutebrowser/qutebrowser-9999.ebuild
2d38fd0a3ed7f1b0c9eb6de5ac7177edbb522021
[max/gentoo-overlay.git] / www-client / qutebrowser / qutebrowser-9999.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.7.1[${PYTHON_USEDEP},declarative,multimedia,gui,network,opengl,printsupport,sql,webengine,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         exeinto /usr/share/qutebrowser/userscripts/
59         use scripts && doexe misc/userscripts/*
60
61         distutils-r1_python_install_all
62 }
63
64 pkg_postinst() {
65         optfeature "PDF display support" www-plugins/pdfjs
66         xdg_desktop_database_update
67         xdg_mimeinfo_database_update
68         gnome2_icon_cache_update
69 }
70
71 pkg_postrm() {
72         xdg_desktop_database_update
73         xdg_mimeinfo_database_update
74         gnome2_icon_cache_update
75 }