Merge remote-tracking branch 'github/pr/708'.
[gentoo.git] / net-misc / spice-gtk / spice-gtk-0.29.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 GCONF_DEBUG="no"
7 WANT_AUTOMAKE="1.12"
8 VALA_MIN_API_VERSION="0.14"
9 VALA_USE_DEPEND="vapigen"
10
11 PYTHON_COMPAT=( python2_7 )
12
13 inherit autotools eutils multibuild python-single-r1 vala
14
15 DESCRIPTION="Set of GObject and Gtk objects for connecting to Spice servers and a client GUI"
16 HOMEPAGE="http://spice-space.org http://gitorious.org/spice-gtk"
17
18 LICENSE="LGPL-2.1"
19 SLOT="0"
20 SRC_URI="http://spice-space.org/download/gtk/${P}.tar.bz2"
21 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
22 IUSE="dbus gstreamer gtk3 +introspection lz4 policykit pulseaudio python sasl smartcard static-libs usbredir vala webdav"
23
24 REQUIRED_USE="
25         python? ( ${PYTHON_REQUIRED_USE} )
26         ?? ( pulseaudio gstreamer )
27 "
28
29 # TODO:
30 # * check if sys-freebsd/freebsd-lib (from virtual/acl) provides acl/libacl.h
31 # * use external pnp.ids as soon as that means not pulling in gnome-desktop
32 RDEPEND="
33         ${PYTHON_DEPS}
34         pulseaudio? ( media-sound/pulseaudio[glib] )
35         gstreamer? (
36                 media-libs/gstreamer:1.0
37                 media-libs/gst-plugins-base:1.0 )
38         >=x11-libs/pixman-0.17.7
39         >=media-libs/celt-0.5.1.1:0.5.1
40         media-libs/opus
41         dev-libs/openssl:=
42         gtk3? ( x11-libs/gtk+:3[introspection?] )
43         x11-libs/gtk+:2[introspection?]
44         >=dev-libs/glib-2.28:2
45         >=x11-libs/cairo-1.2
46         virtual/jpeg:=
47         sys-libs/zlib
48         introspection? ( dev-libs/gobject-introspection )
49         lz4? ( app-arch/lz4 )
50         python? ( dev-python/pygtk:2 )
51         sasl? ( dev-libs/cyrus-sasl )
52         smartcard? ( app-emulation/qemu[smartcard] )
53         usbredir? (
54                 sys-apps/hwids
55                 >=sys-apps/usbredir-0.4.2
56                 virtual/libusb:1
57                 virtual/libgudev:=
58                 policykit? (
59                         sys-apps/acl
60                         >=sys-auth/polkit-0.110-r1
61                         !~sys-auth/polkit-0.111 )
62                 )
63         webdav? (
64                 net-libs/phodav:2.0
65                 >=dev-libs/glib-2.43.90:2
66                 >=net-libs/libsoup-2.49.91 )
67 "
68 DEPEND="${RDEPEND}
69         dev-lang/python
70         dev-python/pyparsing
71         dev-perl/Text-CSV
72         >=dev-util/gtk-doc-am-1.14
73         >=dev-util/intltool-0.40.0
74         >=sys-devel/gettext-0.17
75         virtual/pkgconfig
76         vala? ( $(vala_depend) )
77 "
78
79 # Hard-deps while building from git:
80 # dev-lang/vala:0.14
81 # dev-lang/perl
82
83 src_prepare() {
84         epatch_user
85
86         AT_NO_RECURSIVE="yes" eautoreconf
87
88         use vala && vala_src_prepare
89 }
90
91 src_configure() {
92         local myconf
93         local audio="no"
94
95         use gstreamer && audio="gstreamer"
96         use pulseaudio && audio="pulse"
97
98         if use vala ; then
99                 # force vala regen for MinGW, etc
100                 rm -fv gtk/controller/controller.{c,vala.stamp} gtk/controller/menu.c
101         fi
102
103         myconf="
104                 --disable-maintainer-mode \
105                 $(use_enable static-libs static) \
106                 $(use_enable introspection) \
107                 --with-audio=${audio} \
108                 $(use_with sasl) \
109                 $(use_enable smartcard) \
110                 $(use_enable usbredir) \
111                 $(use_with usbredir usb-ids-path /usr/share/misc/usb.ids) \
112                 $(use_with usbredir usb-acl-helper-dir /usr/libexec) \
113                 $(use_enable policykit polkit) \
114                 $(use_enable vala) \
115                 $(use_enable webdav) \
116                 $(use_enable dbus) \
117                 --disable-gtk-doc \
118                 --disable-werror \
119                 --enable-pie"
120
121         # Parameter of --with-gtk
122         MULTIBUILD_VARIANTS=( 2.0 )
123         use gtk3 && MULTIBUILD_VARIANTS+=( 3.0 )
124
125         configure() {
126                 local myconf=()
127                 myconf+=( --with-gtk=${MULTIBUILD_VARIANT} )
128
129                 if [[ ${MULTIBUILD_ID} =~ "2.0" ]] ; then
130                         myconf+=( $(use_with python) )
131                 else
132                         myconf+=( --without-python )
133                 fi
134
135                 ECONF_SOURCE="${S}" econf $@ ${myconf[@]}
136         }
137         multibuild_foreach_variant run_in_build_dir configure ${myconf}
138 }
139
140 src_compile() {
141         multibuild_foreach_variant run_in_build_dir default
142 }
143
144 src_test() {
145         multibuild_foreach_variant run_in_build_dir default
146 }
147
148 src_install() {
149         dodoc AUTHORS ChangeLog NEWS README THANKS TODO
150
151         multibuild_foreach_variant run_in_build_dir default
152
153         # Remove .la files if they're not needed
154         use static-libs || prune_libtool_files
155
156         use python && rm -rf "${ED}"/usr/lib*/python*/site-packages/*.la
157
158         make_desktop_entry spicy Spicy "utilities-terminal" "Network;RemoteAccess;"
159 }