]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/freerdp/freerdp.mk
458bd5eea7f0c476adb8049c5c09e7b20ea6eba9
[coffee/buildroot.git] / package / freerdp / freerdp.mk
1 ################################################################################
2 #
3 # freerdp
4 #
5 ################################################################################
6
7 FREERDP_VERSION = 2.0.0-rc0
8 FREERDP_SITE = $(call github,FreeRDP,FreeRDP,$(FREERDP_VERSION))
9 FREERDP_DEPENDENCIES = libglib2 openssl zlib
10 FREERDP_LICENSE = Apache-2.0
11 FREERDP_LICENSE_FILES = LICENSE
12
13 FREERDP_INSTALL_STAGING = YES
14
15 FREERDP_CONF_OPTS = -DWITH_MANPAGES=OFF -Wno-dev
16
17 ifeq ($(BR2_PACKAGE_FREERDP_GSTREAMER),y)
18 FREERDP_CONF_OPTS += -DWITH_GSTREAMER_0_10=ON
19 FREERDP_DEPENDENCIES += gstreamer gst-plugins-base libxml2
20 else
21 FREERDP_CONF_OPTS += -DWITH_GSTREAMER_0_10=OFF
22 endif
23
24 ifeq ($(BR2_PACKAGE_FREERDP_GSTREAMER1),y)
25 FREERDP_CONF_OPTS += -DWITH_GSTREAMER_1_0=ON
26 FREERDP_DEPENDENCIES += gstreamer1 gst1-plugins-base
27 else
28 FREERDP_CONF_OPTS += -DWITH_GSTREAMER_1_0=OFF
29 endif
30
31 ifeq ($(BR2_PACKAGE_CUPS),y)
32 FREERDP_CONF_OPTS += -DWITH_CUPS=ON
33 FREERDP_DEPENDENCIES += cups
34 else
35 FREERDP_CONF_OPTS += -DWITH_CUPS=OFF
36 endif
37
38 ifeq ($(BR2_PACKAGE_FFMPEG),y)
39 FREERDP_CONF_OPTS += -DWITH_FFMPEG=ON
40 FREERDP_DEPENDENCIES += ffmpeg
41 else
42 FREERDP_CONF_OPTS += -DWITH_FFMPEG=OFF
43 endif
44
45 ifeq ($(BR2_PACKAGE_ALSA_LIB_MIXER),y)
46 FREERDP_CONF_OPTS += -DWITH_ALSA=ON
47 FREERDP_DEPENDENCIES += alsa-lib
48 else
49 FREERDP_CONF_OPTS += -DWITH_ALSA=OFF
50 endif
51
52 ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
53 FREERDP_CONF_OPTS += -DWITH_PULSEAUDIO=ON
54 FREERDP_DEPENDENCIES += pulseaudio
55 else
56 FREERDP_CONF_OPTS += -DWITH_PULSEAUDIO=OFF
57 endif
58
59 # For the systemd journal
60 ifeq ($(BR2_PACKAGE_SYSTEMD),y)
61 FREERDP_CONF_OPTS += -DWITH_LIBSYSTEMD=ON
62 FREERDP_DEPENDENCIES += systemd
63 else
64 FREERDP_CONF_OPTS += -DWITH_LIBSYSTEMD=OFF
65 endif
66
67 ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
68 FREERDP_CONF_OPTS += -DWITH_NEON=ON
69 else
70 FREERDP_CONF_OPTS += -DWITH_NEON=OFF
71 endif
72
73 ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
74 FREERDP_CONF_OPTS += -DWITH_SSE2=ON
75 else
76 FREERDP_CONF_OPTS += -DWITH_SSE2=OFF
77 endif
78
79 ifeq ($(BR2_arm)$(BR2_armeb),y)
80 FREERDP_CONF_OPTS += -DARM_FP_ABI=$(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
81 endif
82
83 #---------------------------------------
84 # Enabling server and/or client
85
86 # Clients and server interface must always be enabled to build the
87 # corresponding libraries.
88 FREERDP_CONF_OPTS += -DWITH_SERVER_INTERFACE=ON
89 FREERDP_CONF_OPTS += -DWITH_CLIENT_INTERFACE=ON
90
91 ifeq ($(BR2_PACKAGE_FREERDP_SERVER),y)
92 FREERDP_CONF_OPTS += -DWITH_SERVER=ON
93 endif
94
95 ifneq ($(BR2_PACKAGE_FREERDP_CLIENT_X11)$(BR2_PACKAGE_FREERDP_CLIENT_WL),)
96 FREERDP_CONF_OPTS += -DWITH_CLIENT=ON
97 endif
98
99 #---------------------------------------
100 # Libraries for client and/or server
101
102 # The FreeRDP buildsystem uses non-orthogonal options. For example it
103 # is not possible to build the server and the wayland client without
104 # also building the X client. That's because the dependencies of the
105 # server (the X libraries) are a superset of those of the X client.
106 # So, as soon as FreeRDP is configured for the server and the wayland
107 # client, it will believe it also has to build the X client, because
108 # the libraries it needs are enabled.
109 #
110 # Furthermore, the shadow server is always built, even if there's nothing
111 # it can serve (i.e. the X libs are disabled).
112 #
113 # So, we do not care whether we build too much; we remove, as
114 # post-install hooks, whatever we do not want.
115
116 # If Xorg is enabled, and the server or the X client are, then libX11
117 # and libXext are forcibly enabled at the Kconfig level. However, if
118 # Xorg is enabled but neither the server nor the X client are, then
119 # there's nothing that guarantees those two libs are enabled. So we
120 # really must check for them.
121 ifeq ($(BR2_PACKAGE_XLIB_LIBX11)$(BR2_PACKAGE_XLIB_LIBXEXT),yy)
122 FREERDP_DEPENDENCIES += xlib_libX11 xlib_libXext
123 FREERDP_CONF_OPTS += -DWITH_X11=ON
124 else
125 FREERDP_CONF_OPTS += -DWITH_X11=OFF
126 endif
127
128 # The following libs are either optional or mandatory only for either
129 # the server or the client. A mandatory library for either one is
130 # selected from Kconfig, so we can make it conditional here
131 ifeq ($(BR2_PACKAGE_XLIB_LIBXCURSOR),y)
132 FREERDP_CONF_OPTS += -DWITH_XCURSOR=ON
133 FREERDP_DEPENDENCIES += xlib_libXcursor
134 else
135 FREERDP_CONF_OPTS += -DWITH_XCURSOR=OFF
136 endif
137
138 ifeq ($(BR2_PACKAGE_XLIB_LIBXDAMAGE),y)
139 FREERDP_CONF_OPTS += -DWITH_XDAMAGE=ON
140 FREERDP_DEPENDENCIES += xlib_libXdamage
141 else
142 FREERDP_CONF_OPTS += -DWITH_XDAMAGE=OFF
143 endif
144
145 ifeq ($(BR2_PACKAGE_XLIB_LIBXFIXES),y)
146 FREERDP_CONF_OPTS += -DWITH_XFIXES=ON
147 FREERDP_DEPENDENCIES += xlib_libXfixes
148 else
149 FREERDP_CONF_OPTS += -DWITH_XFIXES=OFF
150 endif
151
152 ifeq ($(BR2_PACKAGE_XLIB_LIBXI),y)
153 FREERDP_CONF_OPTS += -DWITH_XI=ON
154 FREERDP_DEPENDENCIES += xlib_libXi
155 else
156 FREERDP_CONF_OPTS += -DWITH_XI=OFF
157 endif
158
159 ifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA),y)
160 FREERDP_CONF_OPTS += -DWITH_XINERAMA=ON
161 FREERDP_DEPENDENCIES += xlib_libXinerama
162 else
163 FREERDP_CONF_OPTS += -DWITH_XINERAMA=OFF
164 endif
165
166 ifeq ($(BR2_PACKAGE_XLIB_LIBXKBFILE),y)
167 FREERDP_CONF_OPTS += -DWITH_XKBFILE=ON
168 FREERDP_DEPENDENCIES += xlib_libxkbfile
169 else
170 FREERDP_CONF_OPTS += -DWITH_XKBFILE=OFF
171 endif
172
173 ifeq ($(BR2_PACKAGE_XLIB_LIBXRANDR),y)
174 FREERDP_CONF_OPTS += -DWITH_XRANDR=ON
175 FREERDP_DEPENDENCIES += xlib_libXrandr
176 else
177 FREERDP_CONF_OPTS += -DWITH_XRANDR=OFF
178 endif
179
180 ifeq ($(BR2_PACKAGE_XLIB_LIBXRENDER),y)
181 FREERDP_CONF_OPTS += -DWITH_XRENDER=ON
182 FREERDP_DEPENDENCIES += xlib_libXrender
183 else
184 FREERDP_CONF_OPTS += -DWITH_XRENDER=OFF
185 endif
186
187 ifeq ($(BR2_PACKAGE_XLIB_LIBXTST),y)
188 FREERDP_CONF_OPTS += -DWITH_XTEST=ON
189 FREERDP_DEPENDENCIES += xlib_libXtst
190 else
191 FREERDP_CONF_OPTS += -DWITH_XTEST=OFF
192 endif
193
194 ifeq ($(BR2_PACKAGE_XLIB_LIBXV),y)
195 FREERDP_CONF_OPTS += -DWITH_XV=ON
196 FREERDP_DEPENDENCIES += xlib_libXv
197 else
198 FREERDP_CONF_OPTS += -DWITH_XV=OFF
199 endif
200
201 ifeq ($(BR2_PACKAGE_WAYLAND),y)
202 FREERDP_DEPENDENCIES += wayland
203 FREERDP_CONF_OPTS += -DWITH_WAYLAND=ON
204 else
205 FREERDP_CONF_OPTS += -DWITH_WAYLAND=OFF
206 endif
207
208 #---------------------------------------
209 # Post-install hooks to cleanup and install missing stuff
210
211 # Shadow server is always installed, no matter what, so we manually
212 # remove it if the user does not want the server.
213 ifeq ($(BR2_PACKAGE_FREERDP_SERVER),)
214 define FREERDP_RM_SHADOW_SERVER
215         rm -f $(TARGET_DIR)/usr/bin/freerdp-shadow
216 endef
217 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_RM_SHADOW_SERVER
218 endif # ! server
219
220 # X client is always built as soon as a client is enabled and the
221 # necessary libs are enabled (e.g. because of the server), so manually
222 # remove it if the user does not want it.
223 ifeq ($(BR2_PACKAGE_FREERDP_CLIENT_X11),)
224 define FREERDP_RM_CLIENT_X11
225         rm -f $(TARGET_DIR)/usr/bin/xfreerdp
226         rm -f $(TARGET_DIR)/usr/lib/libxfreerdp-client*
227 endef
228 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_RM_CLIENT_X11
229 define FREERDP_RM_CLIENT_X11_LIB
230         rm -f $(STAGING_DIR)/usr/lib/libxfreerdp-client*
231 endef
232 FREERDP_POST_INSTALL_STAGING_HOOKS += FREERDP_RM_CLIENT_X11_LIB
233 endif # ! X client
234
235 # Wayland client is always built as soon as wayland is enabled, so
236 # manually remove it if the user does not want it.
237 ifeq ($(BR2_PACKAGE_FREERDP_CLIENT_WL),)
238 define FREERDP_RM_CLIENT_WL
239         rm -f $(TARGET_DIR)/usr/bin/wlfreerdp
240 endef
241 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_RM_CLIENT_WL
242 endif
243
244 # Remove static libraries in unusual dir
245 define FREERDP_CLEANUP
246         rm -rf $(TARGET_DIR)/usr/lib/freerdp
247 endef
248 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_CLEANUP
249
250 # Install the server key and certificate, so that a client can connect.
251 # A user can override them with its own in a post-build script, if needed.
252 # We install them even if the server is not enabled, since another server
253 # can be built and linked with libfreerdp (e.g. weston with the  RDP
254 # backend). Key and cert are installed world-readable, so non-root users
255 # can start a server.
256 define FREERDP_INSTALL_KEYS
257         $(INSTALL) -m 0644 -D $(@D)/server/Sample/server.key \
258                 $(TARGET_DIR)/etc/freerdp/keys/server.key
259         $(INSTALL) -m 0644 -D $(@D)/server/Sample/server.crt \
260                 $(TARGET_DIR)/etc/freerdp/keys/server.crt
261 endef
262 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_INSTALL_KEYS
263
264 $(eval $(cmake-package))