*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-vcs / stgit / stgit-0.20.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7} )
7
8 inherit bash-completion-r1 distutils-r1
9
10 DESCRIPTION="Manage a stack of patches using GIT as a backend"
11 HOMEPAGE="http://www.procode.org/stgit/"
12 UPSTREAM_VER=
13 [[ -n ${UPSTREAM_VER} ]] && \
14         UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
15
16 SRC_URI="https://github.com/ctmarinas/stgit/archive/v${PV}.tar.gz -> ${P}.tar.gz
17         ${UPSTREAM_PATCHSET_URI}"
18
19 LICENSE="GPL-2"
20 SLOT="0"
21 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
22 IUSE="doc"
23
24 RDEPEND=">=dev-vcs/git-1.6.3.3"
25
26 # NOTE: It seems to be quite important which asciidoc version to use.
27 # So keep an eye on it for the future.
28 DEPEND="${RDEPEND}
29         doc? (
30                 app-text/asciidoc
31                 app-text/xmlto
32                 dev-lang/perl
33         )"
34
35 PATCHES=(
36         "${FILESDIR}/${PN}-0.16-man-linkfix.patch"
37 )
38
39 pkg_setup() {
40         if ! use doc; then
41                 echo
42                 ewarn "Manpages will not be built and installed."
43                 ewarn "Enable the 'doc' useflag, if you want them."
44                 echo
45         fi
46 }
47
48 python_prepare_all() {
49         # Upstream's patchset
50         [[ -n ${UPSTREAM_VER} ]] && \
51                 eapply "${WORKDIR}"/patches-upstream
52
53         # this will be a noop, as we are working with a tarball,
54         # but throws git errors --> just get rid of it
55         echo "version=\"${PV}\"" > "${S}"/stgit/builtin_version.py
56
57         distutils-r1_python_prepare_all
58 }
59
60 src_compile() {
61         distutils-r1_src_compile
62
63         # bug 526468
64         if use doc; then
65                 emake DESTDIR="${D}" \
66                         htmldir="${EPREFIX}/usr/share/doc/${PF}/html/" \
67                         mandir="${EPREFIX}/usr/share/man/" \
68                         doc
69         fi
70 }
71
72 src_install() {
73         if use doc; then
74                 emake DESTDIR="${D}" \
75                         htmldir="${EPREFIX}/usr/share/doc/${PF}/html/" \
76                         mandir="${EPREFIX}/usr/share/man/" \
77                         install-doc install-html
78         fi
79
80         distutils-r1_src_install
81
82         newbashcomp completion/stgit.bash 'stg'
83 }