5dcafddd7a5993ddf8a4d249cb9d36316315e974
[gentoo.git] / x11-wm / xpra / xpra-2.2.6.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 # PyCObject_Check and PyCObject_AsVoidPtr vanished with python 3.3
7 PYTHON_COMPAT=( python2_7 )
8 inherit xdg distutils-r1 eutils flag-o-matic user tmpfiles prefix
9
10 DESCRIPTION="X Persistent Remote Apps (xpra) and Partitioning WM (parti) based on wimpiggy"
11 HOMEPAGE="http://xpra.org/ http://xpra.org/src/"
12 SRC_URI="http://xpra.org/src/${P}.tar.xz"
13
14 LICENSE="GPL-2 BSD"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="+client +clipboard csc cups dbus dec_avcodec2 enc_ffmpeg enc_x264 enc_x265 jpeg libav +lz4 lzo opengl pillow pulseaudio server sound test vpx webcam webp"
18
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}
20         clipboard? ( || ( server client ) )
21         cups? ( dbus )
22         opengl? ( client )
23         || ( client server )
24         client? ( enc_x264? ( dec_avcodec2 ) enc_x265? ( dec_avcodec2 ) )"
25
26 COMMON_DEPEND="${PYTHON_DEPS}
27         dev-python/pygobject:2[${PYTHON_USEDEP}]
28         dev-python/pygtk:2[${PYTHON_USEDEP}]
29         x11-libs/gtk+:2
30         x11-libs/libX11
31         x11-libs/libXcomposite
32         x11-libs/libXdamage
33         x11-libs/libXfixes
34         x11-libs/libXrandr
35         x11-libs/libXtst
36         x11-libs/libxkbfile
37         csc? (
38                 !libav? ( >=media-video/ffmpeg-1.2.2:0= )
39                 libav? ( media-video/libav:0= )
40         )
41         dec_avcodec2? (
42                 !libav? ( >=media-video/ffmpeg-2:0= )
43                 libav? ( media-video/libav:0= )
44         )
45         enc_ffmpeg? (
46                 !libav? ( >=media-video/ffmpeg-3.2.2:0= )
47                 libav? ( media-video/libav:0= )
48         )
49         enc_x264? ( media-libs/x264
50                 !libav? ( >=media-video/ffmpeg-1.0.4:0= )
51                 libav? ( media-video/libav:0= )
52         )
53         enc_x265? ( media-libs/x265
54                 !libav? ( >=media-video/ffmpeg-2:0= )
55                 libav? ( media-video/libav:0= ) )
56         jpeg? ( media-libs/libjpeg-turbo )
57         opengl? ( dev-python/pygtkglext )
58         pulseaudio? ( media-sound/pulseaudio )
59         sound? ( media-libs/gstreamer:1.0
60                 media-libs/gst-plugins-base:1.0
61                 dev-python/gst-python:1.0 )
62         vpx? ( media-libs/libvpx virtual/ffmpeg )
63         webp? ( media-libs/libwebp )"
64
65 RDEPEND="${COMMON_DEPEND}
66         dev-python/ipython[${PYTHON_USEDEP}]
67         dev-python/netifaces[${PYTHON_USEDEP}]
68         dev-python/rencode[${PYTHON_USEDEP}]
69         virtual/ssh
70         x11-apps/xmodmap
71         cups? ( dev-python/pycups[${PYTHON_USEDEP}] )
72         dbus? ( dev-python/dbus-python[${PYTHON_USEDEP}] )
73         lz4? ( dev-python/lz4[${PYTHON_USEDEP}] )
74         lzo? ( >=dev-python/python-lzo-0.7.0[${PYTHON_USEDEP}] )
75         opengl? (
76                 client? ( dev-python/pyopengl_accelerate[${PYTHON_USEDEP}] )
77         )
78         pillow? ( dev-python/pillow[${PYTHON_USEDEP}] )
79         server? ( x11-base/xorg-server[-minimal,xvfb]
80                 x11-drivers/xf86-input-void
81         )
82         webcam? ( dev-python/numpy[${PYTHON_USEDEP}]
83                 media-libs/opencv[python]
84                 dev-python/pyinotify[${PYTHON_USEDEP}] )"
85 DEPEND="${COMMON_DEPEND}
86         virtual/pkgconfig
87         >=dev-python/cython-0.16[${PYTHON_USEDEP}]"
88
89 PATCHES=( "${FILESDIR}"/${PN}-0.13.1-ignore-gentoo-no-compile.patch
90         "${FILESDIR}"/${PN}-2.0-suid-warning.patch )
91
92 pkg_postinst() {
93         enewgroup ${PN}
94         tmpfiles_process /usr/lib/tmpfiles.d/xpra.conf
95
96         xdg_pkg_postinst
97 }
98
99 python_prepare_all() {
100         hprefixify -w '/os.path/' setup.py
101         hprefixify tmpfiles.d/xpra.conf xpra/server/{server,socket}_util.py \
102                 xpra/platform{/xposix,}/paths.py xpra/scripts/server.py
103
104         distutils-r1_python_prepare_all
105 }
106
107 python_configure_all() {
108         sed -e "/'pulseaudio'/s:DEFAULT_PULSEAUDIO:$(usex pulseaudio True False):" \
109                 -i setup.py || die
110
111         mydistutilsargs=(
112                 --without-PIC
113                 --without-Xdummy
114                 $(use_with client)
115                 $(use_with clipboard)
116                 $(use_with csc csc_swscale)
117                 --without-csc_libyuv
118                 $(use_with cups printing)
119                 --without-debug
120                 $(use_with dbus)
121                 $(use_with dec_avcodec2)
122                 $(use_with enc_ffmpeg)
123                 $(use_with enc_x264)
124                 $(use_with enc_x265)
125                 --with-gtk2
126                 --without-gtk3
127                 --without-html5
128                 $(use_with jpeg)
129                 --without-mdns
130                 --without-minify
131                 $(use_with opengl)
132                 $(use_with server shadow)
133                 $(use_with server)
134                 $(use_with sound)
135                 --with-strict
136                 $(use_with vpx)
137                 --with-warn
138                 $(use_with webcam)
139                 $(use_with webp)
140                 --with-x11
141         )
142
143         # see https://www.xpra.org/trac/ticket/1080
144         # and http://trac.cython.org/ticket/395
145         append-cflags -fno-strict-aliasing
146
147         export XPRA_SOCKET_DIRS="${EPREFIX}/run/xpra"
148 }