1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_6 )
7 DISTUTILS_SINGLE_IMPL=true
9 inherit distutils-r1 readme.gentoo-r1 virtualx
11 DESCRIPTION="The highly caffeinated git GUI"
12 HOMEPAGE="https://git-cola.github.io/"
13 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
17 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
19 RESTRICT="!test? ( test )"
21 RDEPEND="dev-python/QtPy[gui,${PYTHON_USEDEP}]
22 dev-python/numpy[${PYTHON_USEDEP}]
23 dev-python/pygments[${PYTHON_USEDEP}]
24 dev-python/send2trash[${PYTHON_USEDEP}]
29 dev-python/sphinx[${PYTHON_USEDEP}]
30 python_targets_python2_7? ( dev-python/sphinxtogithub[$(python_gen_usedep 'python2*')] )
34 dev-python/nose[${PYTHON_USEDEP}]
35 dev-python/mock[${PYTHON_USEDEP}]
38 python_prepare_all() {
39 # make sure that tests also use the system provided QtPy
42 rm share/git-cola/bin/*askpass* || die
44 # don't install docs into wrong location
45 sed -i -e '/doc/d' setup.py || die
47 # fix doc directory reference
49 -e "s/'doc', 'git-cola'/'doc', '${PF}'/" \
50 cola/resources.py || die
52 # fix ssh-askpass directory reference
53 sed -i -e 's/resources\.share/resources\.prefix/' cola/app.py || die
55 distutils-r1_python_prepare_all
58 python_configure_all() {
59 mydistutilsargs=( --no-vendor-libs )
62 python_compile_all() {
63 cd share/doc/${PN}/ || die
68 -e '/^install:/s:install-html::g' \
69 -e '/^install:/s:install-man::g' \
75 PYTHONPATH="${S}:${S}/build/lib:${PYTHONPATH}" LC_ALL="en_US.utf8" \
76 virtx nosetests --verbose --with-id --with-doctest \
77 --exclude=sphinxtogithub
81 distutils-r1_src_install
84 python_install_all() {
85 cd share/doc/${PN}/ || die
88 docdir="${EPREFIX}/usr/share/doc/${PF}" \
89 prefix="${EPREFIX}/usr" \
92 python_fix_shebang "${ED}/usr/share/git-cola/bin/git-xbase" "${ED}"/usr/bin/git-cola
93 python_optimize "${ED}/usr/share/git-cola/lib/cola"
95 use doc || HTML_DOCS=( "${FILESDIR}"/index.html )
97 distutils-r1_python_install_all
98 readme.gentoo_create_doc