Merge remote-tracking branch 'github/pr/1591'
[gentoo.git] / dev-libs / weston / weston-1.9.0.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
7 if [[ ${PV} = 9999* ]]; then
8         EGIT_REPO_URI="git://anongit.freedesktop.org/git/wayland/${PN}"
9         GIT_ECLASS="git-r3"
10         EXPERIMENTAL="true"
11 fi
12 VIRTUALX_REQUIRED="test"
13 RESTRICT="test"
14
15 inherit autotools readme.gentoo toolchain-funcs virtualx $GIT_ECLASS
16
17 DESCRIPTION="Wayland reference compositor"
18 HOMEPAGE="https://wayland.freedesktop.org/"
19
20 if [[ $PV = 9999* ]]; then
21         SRC_URI="${SRC_PATCHES}"
22         KEYWORDS="arm"
23 else
24         SRC_URI="https://wayland.freedesktop.org/releases/${P}.tar.xz"
25         KEYWORDS="amd64 arm x86 ~arm-linux"
26 fi
27
28 LICENSE="MIT CC-BY-SA-3.0"
29 SLOT="0"
30 IUSE="colord dbus +drm editor examples fbdev +gles2 headless ivi rdp +resize-optimization rpi +launch screen-sharing static-libs +suid systemd test unwind wayland-compositor +X xwayland"
31
32 REQUIRED_USE="
33         drm? ( gles2 )
34         screen-sharing? ( rdp )
35         test? ( X )
36         wayland-compositor? ( gles2 )
37 "
38
39 RDEPEND="
40         >=dev-libs/libinput-0.8.0
41         >=dev-libs/wayland-1.9.0
42         media-libs/lcms:2
43         media-libs/libpng:0=
44         media-libs/libwebp:0=
45         virtual/jpeg:0=
46         >=x11-libs/cairo-1.11.3
47         >=x11-libs/libdrm-2.4.30
48         x11-libs/libxkbcommon
49         x11-libs/pixman
50         x11-misc/xkeyboard-config
51         fbdev? (
52                 >=sys-libs/mtdev-1.1.0
53                 >=virtual/udev-136
54         )
55         colord? ( >=x11-misc/colord-0.1.27 )
56         dbus? ( sys-apps/dbus )
57         drm? (
58                 media-libs/mesa[gbm]
59                 >=sys-libs/mtdev-1.1.0
60                 >=virtual/udev-136
61         )
62         editor? ( x11-libs/pango )
63         gles2? (
64                 media-libs/mesa[gles2,wayland]
65         )
66         rdp? ( >=net-misc/freerdp-1.1.0_beta1_p20130710 )
67         rpi? (
68                 >=sys-libs/mtdev-1.1.0
69                 >=virtual/udev-136
70         )
71         systemd? (
72                 sys-auth/pambase[systemd]
73                 sys-apps/systemd[pam]
74         )
75         launch? ( sys-auth/pambase )
76         unwind? ( sys-libs/libunwind )
77         X? (
78                 x11-libs/libxcb
79                 x11-libs/libX11
80         )
81         xwayland? (
82                 x11-base/xorg-server[wayland]
83                 x11-libs/cairo[xcb]
84                 x11-libs/libxcb
85                 x11-libs/libXcursor
86         )
87 "
88 DEPEND="${RDEPEND}
89         virtual/pkgconfig
90 "
91
92 src_prepare() {
93         if [[ ${PV} = 9999* ]]; then
94                 eautoreconf
95         fi
96 }
97
98 src_configure() {
99         local myconf
100         if use examples || use test; then
101                 myconf="--enable-simple-clients"
102         else
103                 myconf="--disable-simple-clients"
104         fi
105
106         myconf+=" --with-cairo=image --disable-simple-egl-clients"
107
108         econf \
109                 $(use_enable examples demo-clients-install) \
110                 $(use_enable fbdev fbdev-compositor) \
111                 $(use_enable dbus) \
112                 $(use_enable drm drm-compositor) \
113                 $(use_enable headless headless-compositor) \
114                 $(use_enable ivi ivi-shell) \
115                 $(use_enable rdp rdp-compositor) \
116                 $(use_enable rpi rpi-compositor) \
117                 $(use_enable wayland-compositor) \
118                 $(use_enable X x11-compositor) \
119                 $(use_enable launch weston-launch) \
120                 $(use_enable colord) \
121                 $(use_enable gles2 egl) \
122                 $(use_enable unwind libunwind) \
123                 $(use_enable resize-optimization) \
124                 $(use_enable screen-sharing) \
125                 $(use_enable suid setuid-install) \
126                 $(use_enable xwayland) \
127                 $(use_enable xwayland xwayland-test) \
128                 ${myconf}
129 }
130
131 src_test() {
132         export XDG_RUNTIME_DIR="${T}/runtime-dir"
133         mkdir "${XDG_RUNTIME_DIR}" || die
134         chmod 0700 "${XDG_RUNTIME_DIR}" || die
135
136         cd "${BUILD_DIR}" || die
137         Xemake check
138 }
139
140 src_install() {
141         default
142
143         readme.gentoo_src_install
144 }