app-emulation/virtualbox: x86 stable (bug #717626)
[gentoo.git] / app-emulation / virt-manager / virt-manager-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_{6,7} )
7 DISTUTILS_SINGLE_IMPL=1
8
9 DISTUTILS_USE_SETUPTOOLS=no
10 inherit gnome2 distutils-r1
11
12 DESCRIPTION="A graphical tool for administering virtual machines"
13 HOMEPAGE="http://virt-manager.org"
14
15 if [[ ${PV} = *9999* ]]; then
16         inherit git-r3
17         SRC_URI=""
18         KEYWORDS=""
19         EGIT_REPO_URI="https://github.com/virt-manager/virt-manager.git"
20 else
21         SRC_URI="http://virt-manager.org/download/sources/${PN}/${P}.tar.gz"
22         KEYWORDS="~amd64 ~ppc64 ~x86"
23 fi
24
25 LICENSE="GPL-2"
26 SLOT="0"
27 IUSE="gtk policykit sasl"
28
29 RDEPEND="!app-emulation/virtinst
30         ${PYTHON_DEPS}
31         app-cdr/cdrtools
32         >=app-emulation/libvirt-glib-1.0.0[introspection]
33         $(python_gen_cond_dep '
34                 dev-libs/libxml2[python,${PYTHON_MULTI_USEDEP}]
35                 dev-python/argcomplete[${PYTHON_MULTI_USEDEP}]
36                 dev-python/ipaddr[${PYTHON_MULTI_USEDEP}]
37                 dev-python/libvirt-python[${PYTHON_MULTI_USEDEP}]
38                 dev-python/pygobject:3[${PYTHON_MULTI_USEDEP}]
39                 dev-python/requests[${PYTHON_MULTI_USEDEP}]
40         ')
41         >=sys-libs/libosinfo-0.2.10[introspection]
42         gtk? (
43                 gnome-base/dconf
44                 >=net-libs/gtk-vnc-0.3.8[gtk3(+),introspection]
45                 net-misc/spice-gtk[usbredir,gtk3,introspection,sasl?]
46                 net-misc/x11-ssh-askpass
47                 x11-libs/gtk+:3[introspection]
48                 x11-libs/gtksourceview:4[introspection]
49                 x11-libs/vte:2.91[introspection]
50                 policykit? ( sys-auth/polkit[introspection] )
51         )
52 "
53 DEPEND="${RDEPEND}
54         dev-lang/perl
55         dev-util/intltool
56 "
57
58 DOCS=( README.md NEWS.md )
59
60 src_prepare() {
61         distutils-r1_src_prepare
62 }
63
64 python_configure() {
65         esetup.py configure \
66                 --default-graphics=spice
67 }
68
69 python_install() {
70         esetup.py install
71 }
72
73 src_install() {
74         local mydistutilsargs=( --no-update-icon-cache --no-compile-schemas )
75         distutils-r1_src_install
76
77         python_fix_shebang "${ED}"/usr/share/virt-manager
78 }
79
80 pkg_preinst() {
81         if use gtk; then
82                 gnome2_pkg_preinst
83
84                 cd "${ED}"
85                 export GNOME2_ECLASS_ICONS=$(find 'usr/share/virt-manager/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
86         else
87                 rm -rf "${ED}/usr/share/virt-manager/virtManager"
88                 rm -f "${ED}/usr/share/virt-manager/virt-manager"
89                 rm -rf "${ED}/usr/share/virt-manager/ui/"
90                 rm -rf "${ED}/usr/share/virt-manager/icons/"
91                 rm -rf "${ED}/usr/share/man/man1/virt-manager.1*"
92                 rm -rf "${ED}/usr/share/icons/"
93                 rm -rf "${ED}/usr/share/applications/virt-manager.desktop"
94                 rm -rf "${ED}/usr/bin/virt-manager"
95         fi
96 }
97
98 pkg_postinst() {
99         use gtk && gnome2_pkg_postinst
100 }