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