*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / app-misc / gramps / gramps-5.0.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python3_6 )
6 PYTHON_REQ_USE="sqlite"
7
8 DISTUTILS_SINGLE_IMPL=1
9 inherit distutils-r1 xdg-utils
10
11 DESCRIPTION="Genealogical Research and Analysis Management Programming System"
12 HOMEPAGE="https://gramps-project.org/"
13 SRC_URI="https://github.com/gramps-project/${PN}/archive/v${PV}.tar.gz
14         -> ${P}.tar.gz"
15
16 LICENSE="GPL-2+"
17 SLOT="0"
18 KEYWORDS="amd64 x86"
19 IUSE="+rcs +reports exif geo postscript spell"
20
21 RDEPEND="
22         dev-python/bsddb3[${PYTHON_USEDEP}]
23         dev-python/pycairo[${PYTHON_USEDEP}]
24         >=dev-python/pygobject-3.12:3[cairo,${PYTHON_USEDEP}]
25         dev-python/pyicu[${PYTHON_USEDEP}]
26         gnome-base/librsvg:2
27         >x11-libs/gtk+-3.14.8:3[introspection]
28         x11-libs/pango[introspection]
29         x11-misc/xdg-utils
30         reports? ( media-gfx/graphviz[postscript?] )
31         exif? ( >=media-libs/gexiv2-0.5[${PYTHON_USEDEP},introspection] )
32         geo? ( >=sci-geosciences/osm-gps-map-1.1.0 )
33         spell? ( app-text/gtkspell:3[introspection] )
34         rcs? ( dev-vcs/rcs )
35 "
36
37 python_prepare_all() {
38         # Install documentation to the proper location. This can't be done
39         # easily with a patch because we substitute in the $PF variable,
40         # and that changes with every revision.
41         sed -i "s:share/doc/gramps:share/doc/${PF}:g" setup.py || die
42         distutils-r1_python_prepare_all
43 }
44
45 python_configure_all() {
46         mydistutilsargs=(
47                 --resourcepath=/usr/share
48                 --no-compress-manpages
49         )
50 }
51
52 python_test_all() {
53         # GRAMPS builds just fine out of tree but it confuses its test suite.
54         # The following might be an ugly hack but at least it lets the tests
55         # run properly until either I or upstream have come up with something
56         # better.
57         rm -rf "${S}/build" && ln -s "${BUILD_DIR}" "${S}"/build || \
58                 die "Failed to symlink build directory to source directory"
59
60         esetup.py test
61 }
62
63 pkg_postinst() {
64         xdg_desktop_database_update
65         xdg_mimeinfo_database_update
66 }
67
68 pkg_postrm() {
69         xdg_desktop_database_update
70         xdg_mimeinfo_database_update
71 }