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