aboutsummaryrefslogtreecommitdiffstats
path: root/main/freerdp
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-05-01 12:14:36 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2015-05-01 12:14:36 +0200
commit0ce1705ea674d7fc223d05a725af7df9034748e1 (patch)
tree2a4e3c8a7160376765ace1f9c3dcf03b4d07ab03 /main/freerdp
parent289d5519971f26fccff37293e0d1ff100f1df321 (diff)
downloadaports-0ce1705ea674d7fc223d05a725af7df9034748e1.tar.bz2
aports-0ce1705ea674d7fc223d05a725af7df9034748e1.tar.xz
main/freerdp: upgrade to 1.2.0
Diffstat (limited to 'main/freerdp')
-rw-r--r--main/freerdp/APKBUILD51
-rw-r--r--main/freerdp/fix-headers.patch10
-rw-r--r--main/freerdp/freerdp-args.patch186
-rw-r--r--main/freerdp/freerdp-cmake-3.1.patch98
-rw-r--r--main/freerdp/freerdp-cmake-list.patch79
-rw-r--r--main/freerdp/freerdp-fixes-since-24a752a.patch313
-rw-r--r--main/freerdp/musl-fix.patch47
7 files changed, 752 insertions, 32 deletions
diff --git a/main/freerdp/APKBUILD b/main/freerdp/APKBUILD
index a482ba8d18..424da3109e 100644
--- a/main/freerdp/APKBUILD
+++ b/main/freerdp/APKBUILD
@@ -1,8 +1,8 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=freerdp
-pkgver=1.1.0_beta2013071101
-_ver=${pkgver/_beta/-beta+}
-pkgrel=1
+pkgver=1.2.0
+_hash=24a752a70840f3e4b027ba7c020af71f2bcfd94a
+pkgrel=0
pkgdesc="Free RDP client"
url="http://freerdp.sourceforge.net"
arch="all"
@@ -11,13 +11,17 @@ depends=""
subpackages="$pkgname-dev $pkgname-plugins $pkgname-libs"
makedepends="openssl-dev libxcursor-dev cups-dev alsa-lib-dev ffmpeg-dev
cups-dev libxkbfile-dev libxinerama-dev libxv-dev libxdamage-dev
- libjpeg-turbo-dev libxi-dev cmake bsd-compat-headers"
-source="freerdp-$_ver.tar.gz::https://github.com/FreeRDP/FreeRDP/archive/$_ver.tar.gz
- fix-headers.patch
- ffmpeg.patch
+ libjpeg-turbo-dev libxi-dev cmake bsd-compat-headers
+ gst-plugins-base1-dev gsm-dev linux-headers"
+source="$pkgname-$pkgver.tar.gz::https://github.com/FreeRDP/FreeRDP/archive/$_hash.tar.gz
+ freerdp-cmake-list.patch
+ freerdp-fixes-since-24a752a.patch
+ freerdp-args.patch
+ musl-fix.patch
"
-_builddir="$srcdir"/FreeRDP-${_ver/+/-}
+_builddir="$srcdir"/FreeRDP-$_hash
+
prepare() {
cd "$_builddir"
for i in $source; do
@@ -45,6 +49,8 @@ build() {
-DWITH_OPENSSL=ON \
-DWITH_PCSC=OFF \
-DWITH_PULSE=OFF \
+ -DWITH_WAYLAND=OFF \
+ -DWITH_SERVER=ON \
-DWITH_X11=ON \
-DWITH_XCURSOR=ON \
-DWITH_XEXT=ON \
@@ -63,11 +69,6 @@ build() {
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
- # hack
- mv "$pkgdir"/usr/lib/libfreerdp-common.so.1.1.0-beta1 \
- "$pkgdir"/usr/lib/libfreerdp-common.so.1.1.0 \
- && ln -s libfreerdp-common.so.1.1.0 \
- "$pkgdir"/usr/lib/libfreerdp-common.so.1.1.0-beta1
}
libs() {
@@ -84,12 +85,18 @@ plugins() {
mv "$pkgdir"/usr/lib/freerdp "$subpkgdir"/usr/lib/
}
-md5sums="37259601bb43bb8f04d65f4ce1057582 freerdp-1.1.0-beta+2013071101.tar.gz
-56376b2291649957d2c396f809a126a9 fix-headers.patch
-cb7604510c737917a8bcb9b94ba29c10 ffmpeg.patch"
-sha256sums="f21c8b2e4d9ff09bff392f37c85358d148f79318cdbf031092ed2517edd44c41 freerdp-1.1.0-beta+2013071101.tar.gz
-28990b23acd3b0eb59e7e01a8d2a4800009acde1333db4f19898c40559e618c9 fix-headers.patch
-5563da187472feb138d824a33d032af3030400a93fd3e38b455f8666cbc7be72 ffmpeg.patch"
-sha512sums="d53b283ed4ced3c69a3644c4f1acc7d10c12ba14a2e890d8ad2c78b491bb457f3ca6b03ee7bc1df7019e05033eecf0c35afa5f8550b12caa5492ae6e19adac5f freerdp-1.1.0-beta+2013071101.tar.gz
-264b11e5a4d055f53a9fb7cbeda6fd41e2fa6f3e1aaab267edbcedb588e9e9e38c34af2d372f35b0cc0cdffe9cea3bfd0423863856dff0af95cee4728431ee91 fix-headers.patch
-981459c347f245b8f2e92c5593b2a5a8d38506196a637435a84e085d4892189127ab176b1ef3748da91b465e1368768bf6917f7da41b0882a7d655324506badb ffmpeg.patch"
+md5sums="2b498c41d265d5cb2fcc25420d0a050e freerdp-1.2.0.tar.gz
+4ad5ef949a4dcd650638c6eb098ae3c3 freerdp-cmake-list.patch
+43457444595927bd330c87b95d8c64b9 freerdp-fixes-since-24a752a.patch
+5b11a229bd7d8e0056358f6c43d4c19c freerdp-args.patch
+c0d0e0eb84cdcc3e2a40c75b3cdc92b4 musl-fix.patch"
+sha256sums="48def80bfc02c90a350e238de7fba331b914c7a73a7308e0b2fc861f61e25ccf freerdp-1.2.0.tar.gz
+77843028ac29f9fc935f9b9880d9e94c1fd9b13c4ec0d8a16f0d9423f90e67f4 freerdp-cmake-list.patch
+c9644fbc15b41a5e82d7a7bc517c8b7425956f375ee1369c68b0f275133f962c freerdp-fixes-since-24a752a.patch
+54b5dd89ef60d36a6123ca95855586e11c4f404dfb9dbc751bf8d539d1d99041 freerdp-args.patch
+996d645ac75620833ba5fdb371853674063805b98cc7da18f17632f7e803e794 musl-fix.patch"
+sha512sums="f85c111befd4717f93cac2472630c1b96a82aa392d4e5082d5f50cf0b7960a2902d5147cb7b26de52282f25a50968d314f404acb7fd78fe425050013037af4c5 freerdp-1.2.0.tar.gz
+c98a19630213c7cce1fc4256987586ff38102560cff0ee4df0c937b2030f6c066e0da8337379b14d41c821652b1a85f5d296efee426e28dc0a1603b9d5ade0f7 freerdp-cmake-list.patch
+76aaa3b3b631728ecf8567a09c44f5b84af494d42b4437ec5198a1fe9d0a7312fcfa5acbf45b2d2b1cda60a530c36e108d7a50581c6f63b2058fcd785499842a freerdp-fixes-since-24a752a.patch
+a845b77b6106d9a3e9d69bc0a6df3f80a6f37bed2847ace387739def695a3b07acc5e859893a9af11b7c74d96b4eeea99d9a79d5c4e4b504bacd51d612882b01 freerdp-args.patch
+2a3edc5df8f2374c023b604b3f523bbc9e510a35707bef2100ac64677109dc7615a11567558aeda3b032576308ef026ed9b80ef2c479d1004f840f18d6cf0890 musl-fix.patch"
diff --git a/main/freerdp/fix-headers.patch b/main/freerdp/fix-headers.patch
deleted file mode 100644
index b3848b33ca..0000000000
--- a/main/freerdp/fix-headers.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- ./winpr/libwinpr/synch/wait.c.orig
-+++ ./winpr/libwinpr/synch/wait.c
-@@ -24,6 +24,7 @@
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-+#include <sys/select.h>
-
- #include <winpr/crt.h>
- #include <winpr/synch.h>
diff --git a/main/freerdp/freerdp-args.patch b/main/freerdp/freerdp-args.patch
new file mode 100644
index 0000000000..d9b7eca16a
--- /dev/null
+++ b/main/freerdp/freerdp-args.patch
@@ -0,0 +1,186 @@
+diff --git a/client/common/cmdline.c b/client/common/cmdline.c
+index f1f9640..72bbd12 100644
+--- a/client/common/cmdline.c
++++ b/client/common/cmdline.c
+@@ -1078,8 +1078,10 @@ BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* flags)
+ if (posix_cli_status <= COMMAND_LINE_STATUS_PRINT)
+ return compatibility;
+
+- if (windows_cli_count >= posix_cli_count)
++ /* Check, if this may be windows style syntax... */
++ if ((windows_cli_count && (windows_cli_count >= posix_cli_count)) || (windows_cli_status <= COMMAND_LINE_STATUS_PRINT))
+ {
++ windows_cli_count = 1;
+ *flags = COMMAND_LINE_SEPARATOR_COLON;
+ *flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS;
+ }
+diff --git a/client/common/compatibility.c b/client/common/compatibility.c
+index 3a7d0da..d6efe50 100644
+--- a/client/common/compatibility.c
++++ b/client/common/compatibility.c
+@@ -122,16 +122,20 @@ void freerdp_client_old_parse_hostname(char* str, char** ServerHostname, UINT32*
+
+ int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* args)
+ {
++ int args_handled = 0;
+ if (strcmp(args->argv[0], "cliprdr") == 0)
+ {
++ args_handled++;
+ settings->RedirectClipboard = TRUE;
+ WLog_WARN(TAG, "--plugin cliprdr -> +clipboard");
+ }
+ else if (strcmp(args->argv[0], "rdpdr") == 0)
+ {
++ args_handled++;
+ if (args->argc < 2)
+- return -1;
++ return 1;
+
++ args_handled++;
+ if ((strcmp(args->argv[1], "disk") == 0) ||
+ (strcmp(args->argv[1], "drive") == 0))
+ {
+@@ -159,21 +163,26 @@ int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* args)
+ }
+ else if (strcmp(args->argv[0], "drdynvc") == 0)
+ {
++ args_handled++;
+ freerdp_client_add_dynamic_channel(settings, args->argc - 1, &args->argv[1]);
+ }
+ else if (strcmp(args->argv[0], "rdpsnd") == 0)
+ {
++ args_handled++;
+ if (args->argc < 2)
+- return -1;
++ return 1;
+
++ args_handled++;
+ freerdp_addin_replace_argument_value(args, args->argv[1], "sys", args->argv[1]);
+ freerdp_client_add_static_channel(settings, args->argc, args->argv);
+ }
+ else if (strcmp(args->argv[0], "rail") == 0)
+ {
++ args_handled++;
+ if (args->argc < 2)
+- return -1;
++ return 1;
+
++ args_handled++;
+ settings->RemoteApplicationProgram = _strdup(args->argv[1]);
+ }
+ else
+@@ -181,14 +190,12 @@ int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* args)
+ freerdp_client_add_static_channel(settings, args->argc, args->argv);
+ }
+
+- return 1;
++ return args_handled;
+ }
+
+ int freerdp_client_old_command_line_pre_filter(void* context, int index, int argc, LPCSTR* argv)
+ {
+- rdpSettings* settings;
+-
+- settings = (rdpSettings*) context;
++ rdpSettings* settings = (rdpSettings*) context;
+
+ if (index == (argc - 1))
+ {
+@@ -204,11 +211,10 @@ int freerdp_client_old_command_line_pre_filter(void* context, int index, int arg
+ return -1;
+ }
+
+- if (settings)
+- {
+- freerdp_client_old_parse_hostname((char*) argv[index],
+- &settings->ServerHostname, &settings->ServerPort);
+- }
++ freerdp_client_old_parse_hostname((char*) argv[index],
++ &settings->ServerHostname, &settings->ServerPort);
++
++ return 2;
+ }
+ else
+ {
+@@ -218,6 +224,7 @@ int freerdp_client_old_command_line_pre_filter(void* context, int index, int arg
+
+ if (strcmp("--plugin", argv[index]) == 0)
+ {
++ int args_handled = 0;
+ int length;
+ char *a, *p;
+ int i, j, t;
+@@ -233,20 +240,19 @@ int freerdp_client_old_command_line_pre_filter(void* context, int index, int arg
+ return -1;
+
+ args = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV));
+- args->argv = (char**) malloc(sizeof(char*) * 5);
++ args->argv = (char**) calloc(argc, sizeof(char*));
+ args->argc = 1;
+
+- args->argv[0] = _strdup(argv[t]);
+-
+ if ((index < argc - 1) && strcmp("--data", argv[index + 1]) == 0)
+ {
+ i = 0;
+ index += 2;
+- args->argc = 1;
+
+ while ((index < argc) && (strcmp("--", argv[index]) != 0))
+ {
++ args_handled ++;
+ args->argc = 1;
++ args->argv[0] = _strdup(argv[t]);
+
+ for (j = 0, p = (char*) argv[index]; (j < 4) && (p != NULL); j++)
+ {
+@@ -267,6 +273,9 @@ int freerdp_client_old_command_line_pre_filter(void* context, int index, int arg
+ if (p != NULL)
+ {
+ p = strchr(p, ':');
++ }
++ if (p != NULL)
++ {
+ length = (int) (p - a);
+ args->argv[j + 1] = (char*) malloc(length + 1);
+ CopyMemory(args->argv[j + 1], a, length);
+@@ -281,11 +290,14 @@ int freerdp_client_old_command_line_pre_filter(void* context, int index, int arg
+ args->argc++;
+ }
+
+- if (settings->instance)
++ if (settings)
+ {
+ freerdp_client_old_process_plugin(settings, args);
+ }
+
++ for (i = 0; i < args->argc; i++)
++ free(args->argv[i]);
++ memset(args->argv, 0, argc * sizeof(char*));
+ index++;
+ i++;
+ }
+@@ -294,19 +306,16 @@ int freerdp_client_old_command_line_pre_filter(void* context, int index, int arg
+ {
+ if (settings)
+ {
+- if (settings->instance)
+- {
+- freerdp_client_old_process_plugin(settings, args);
+- }
++ args->argv[0] = _strdup(argv[t]);
++ args_handled = freerdp_client_old_process_plugin(settings, args);
++ free (args->argv[0]);
+ }
+ }
+
+- for (i = 0; i < args->argc; i++)
+- free(args->argv[i]);
+ free(args->argv);
+ free(args);
+
+- return (index - old_index);
++ return (index - old_index) + args_handled;
+ }
+
+ return 0;
diff --git a/main/freerdp/freerdp-cmake-3.1.patch b/main/freerdp/freerdp-cmake-3.1.patch
new file mode 100644
index 0000000000..462fb56396
--- /dev/null
+++ b/main/freerdp/freerdp-cmake-3.1.patch
@@ -0,0 +1,98 @@
+From 1b663ceffe51008af7ae9749e5b7999b2f7d6698 Mon Sep 17 00:00:00 2001
+From: Bernhard Miklautz <bernhard.miklautz@shacknet.at>
+Date: Fri, 12 Dec 2014 18:26:45 +0100
+Subject: [PATCH] build: cmake 3.1 compatibility
+
+* fix problem with REMOVE_DUPLICATES on undefined lists
+* since 3.1 file(GLOB FILEPATHS RELATIVE .. returns single / instead of // as
+ previously - necessary adoptions for regex and matches done. Should
+ work with all cmake versions.
+
+Tested with 3.1.0-rc3
+---
+ channels/CMakeLists.txt | 4 ++--
+ channels/client/CMakeLists.txt | 2 ++
+ client/CMakeLists.txt | 4 ++--
+ server/CMakeLists.txt | 4 ++--
+ third-party/CMakeLists.txt | 6 +++---
+ 5 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt
+index c4e6048..540b1ac 100644
+--- a/channels/CMakeLists.txt
++++ b/channels/CMakeLists.txt
+@@ -253,8 +253,8 @@ set(FILENAME "ChannelOptions.cmake")
+ file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")
+
+ foreach(FILEPATH ${FILEPATHS})
+- if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}")
+- string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" DIR ${FILEPATH})
++ if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}")
++ string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" DIR ${FILEPATH})
+ set(CHANNEL_OPTION)
+ include(${FILEPATH})
+ if(${CHANNEL_OPTION})
+diff --git a/channels/client/CMakeLists.txt b/channels/client/CMakeLists.txt
+index 049bc7b..2db18e8 100644
+--- a/channels/client/CMakeLists.txt
++++ b/channels/client/CMakeLists.txt
+@@ -24,7 +24,9 @@ set(${MODULE_PREFIX}_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/addin.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/addin.h)
+
++if(CHANNEL_STATIC_CLIENT_ENTRIES)
+ list(REMOVE_DUPLICATES CHANNEL_STATIC_CLIENT_ENTRIES)
++endif()
+
+ foreach(STATIC_ENTRY ${CHANNEL_STATIC_CLIENT_ENTRIES})
+ foreach(STATIC_MODULE ${CHANNEL_STATIC_CLIENT_MODULES})
+diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
+index 14ed363..b8b7699 100644
+--- a/client/CMakeLists.txt
++++ b/client/CMakeLists.txt
+@@ -63,8 +63,8 @@ set(FILENAME "ModuleOptions.cmake")
+ file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")
+
+ foreach(FILEPATH ${FILEPATHS})
+- if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}")
+- string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" FREERDP_CLIENT ${FILEPATH})
++ if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}")
++ string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" FREERDP_CLIENT ${FILEPATH})
+ set(FREERDP_CLIENT_ENABLED 0)
+ include(${FILEPATH})
+ if(FREERDP_CLIENT_ENABLED)
+diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
+index cda14ba..ee9458e 100644
+--- a/server/CMakeLists.txt
++++ b/server/CMakeLists.txt
+@@ -48,8 +48,8 @@ set(FILENAME "ModuleOptions.cmake")
+ file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")
+
+ foreach(FILEPATH ${FILEPATHS})
+- if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}")
+- string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" FREERDP_SERVER ${FILEPATH})
++ if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}")
++ string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" FREERDP_SERVER ${FILEPATH})
+ set(FREERDP_SERVER_ENABLED 0)
+ include(${FILEPATH})
+ if(FREERDP_SERVER_ENABLED)
+diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
+index 09b1fd4..610f35e 100644
+--- a/third-party/CMakeLists.txt
++++ b/third-party/CMakeLists.txt
+@@ -22,11 +22,11 @@
+ file(GLOB all_valid_subdirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/CMakeLists.txt")
+
+ foreach(dir ${all_valid_subdirs})
+- if(${dir} MATCHES "^([^/]*)//CMakeLists.txt")
+- string(REGEX REPLACE "^([^/]*)//CMakeLists.txt" "\\1" dir_trimmed ${dir})
++ if(${dir} MATCHES "^([^/]*)/+CMakeLists.txt")
++ string(REGEX REPLACE "^([^/]*)/+CMakeLists.txt" "\\1" dir_trimmed ${dir})
+ message(STATUS "Adding third-party component ${dir_trimmed}")
+ add_subdirectory(${dir_trimmed})
+ endif()
+ endforeach(dir)
+
+-set(THIRD_PARTY_INCLUDES ${THIRD_PARTY_INCLUDES} PARENT_SCOPE)
+\ No newline at end of file
++set(THIRD_PARTY_INCLUDES ${THIRD_PARTY_INCLUDES} PARENT_SCOPE)
diff --git a/main/freerdp/freerdp-cmake-list.patch b/main/freerdp/freerdp-cmake-list.patch
new file mode 100644
index 0000000000..37fd78b9e6
--- /dev/null
+++ b/main/freerdp/freerdp-cmake-list.patch
@@ -0,0 +1,79 @@
+diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt
+index c4e6048..540b1ac 100644
+--- a/channels/CMakeLists.txt
++++ b/channels/CMakeLists.txt
+@@ -253,8 +253,8 @@ set(FILENAME "ChannelOptions.cmake")
+ file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")
+
+ foreach(FILEPATH ${FILEPATHS})
+- if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}")
+- string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" DIR ${FILEPATH})
++ if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}")
++ string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" DIR ${FILEPATH})
+ set(CHANNEL_OPTION)
+ include(${FILEPATH})
+ if(${CHANNEL_OPTION})
+diff --git a/channels/client/CMakeLists.txt b/channels/client/CMakeLists.txt
+index 049bc7b..2db18e8 100644
+--- a/channels/client/CMakeLists.txt
++++ b/channels/client/CMakeLists.txt
+@@ -24,7 +24,9 @@ set(${MODULE_PREFIX}_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/addin.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/addin.h)
+
++if(CHANNEL_STATIC_CLIENT_ENTRIES)
+ list(REMOVE_DUPLICATES CHANNEL_STATIC_CLIENT_ENTRIES)
++endif()
+
+ foreach(STATIC_ENTRY ${CHANNEL_STATIC_CLIENT_ENTRIES})
+ foreach(STATIC_MODULE ${CHANNEL_STATIC_CLIENT_MODULES})
+diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
+index 14ed363..b8b7699 100644
+--- a/client/CMakeLists.txt
++++ b/client/CMakeLists.txt
+@@ -63,8 +63,8 @@ set(FILENAME "ModuleOptions.cmake")
+ file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")
+
+ foreach(FILEPATH ${FILEPATHS})
+- if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}")
+- string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" FREERDP_CLIENT ${FILEPATH})
++ if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}")
++ string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" FREERDP_CLIENT ${FILEPATH})
+ set(FREERDP_CLIENT_ENABLED 0)
+ include(${FILEPATH})
+ if(FREERDP_CLIENT_ENABLED)
+diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
+index 75acf25..f82b6fe 100644
+--- a/server/CMakeLists.txt
++++ b/server/CMakeLists.txt
+@@ -44,8 +44,8 @@ set(FILENAME "ModuleOptions.cmake")
+ file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")
+
+ foreach(FILEPATH ${FILEPATHS})
+- if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}")
+- string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" FREERDP_SERVER ${FILEPATH})
++ if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}")
++ string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" FREERDP_SERVER ${FILEPATH})
+ set(FREERDP_SERVER_ENABLED 0)
+ include(${FILEPATH})
+ if(FREERDP_SERVER_ENABLED)
+diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
+index 09b1fd4..610f35e 100644
+--- a/third-party/CMakeLists.txt
++++ b/third-party/CMakeLists.txt
+@@ -22,11 +22,11 @@
+ file(GLOB all_valid_subdirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/CMakeLists.txt")
+
+ foreach(dir ${all_valid_subdirs})
+- if(${dir} MATCHES "^([^/]*)//CMakeLists.txt")
+- string(REGEX REPLACE "^([^/]*)//CMakeLists.txt" "\\1" dir_trimmed ${dir})
++ if(${dir} MATCHES "^([^/]*)/+CMakeLists.txt")
++ string(REGEX REPLACE "^([^/]*)/+CMakeLists.txt" "\\1" dir_trimmed ${dir})
+ message(STATUS "Adding third-party component ${dir_trimmed}")
+ add_subdirectory(${dir_trimmed})
+ endif()
+ endforeach(dir)
+
+-set(THIRD_PARTY_INCLUDES ${THIRD_PARTY_INCLUDES} PARENT_SCOPE)
+\ No newline at end of file
++set(THIRD_PARTY_INCLUDES ${THIRD_PARTY_INCLUDES} PARENT_SCOPE)
diff --git a/main/freerdp/freerdp-fixes-since-24a752a.patch b/main/freerdp/freerdp-fixes-since-24a752a.patch
new file mode 100644
index 0000000000..821f57b480
--- /dev/null
+++ b/main/freerdp/freerdp-fixes-since-24a752a.patch
@@ -0,0 +1,313 @@
+commit 7c3adc8449a4fe89920a6438206e8e2690d7f021
+Author: Armin Novak <armin.novak@gmail.com>
+Date: Mon Nov 17 00:21:04 2014 +0100
+
+ Fixed nonnull warning.
+commit 232aa89efd13d21b2e5dca69e0aea70a03d09544
+Author: Armin Novak <armin.novak@gmail.com>
+Date: Mon Nov 17 00:22:33 2014 +0100
+
+ Fixed memory leak.
+commit d9b889ddb7e466837e363b45ae6713c0bcf0f6db
+Author: Armin Novak <armin.novak@gmail.com>
+Date: Mon Nov 17 00:33:37 2014 +0100
+
+ Fixed memory leak.
+commit f34ee395eb9516bd1b91e25acc0fa73a574d531d
+Author: Armin Novak <armin.novak@gmail.com>
+Date: Mon Nov 17 00:34:17 2014 +0100
+
+ Fixed memory leak.
+commit c44f85c2b4e5455e5da1609d2b6d1a73a7ea2371
+Author: Armin Novak <armin.novak@gmail.com>
+Date: Mon Nov 17 00:42:05 2014 +0100
+
+ Fixed memory leak.
+commit 7881ec762e6f9b51e24878f4c3ed5343a4e05509
+Author: Marc-André Moreau <marcandre.moreau@gmail.com>
+Date: Fri Nov 21 15:10:39 2014 -0500
+
+ server/shadow: avoid sending pointer updates when not active, fix remdesk leak
+commit 547054a48b83fe81917cb3b474116225e97d340f
+Author: Armin Novak <armin.novak@gmail.com>
+Date: Sun Dec 7 00:23:46 2014 +0100
+
+ Fixed uninitialized value.
+commit 43beef36ff1521756bc41378cfa251c843375f49
+Author: Bernhard Miklautz <bernhard.miklautz@shacknet.at>
+Date: Fri Dec 12 18:57:40 2014 +0100
+
+ rdtk/shadow: install libraries versioned
+diff --git a/channels/remdesk/server/remdesk_main.c b/channels/remdesk/server/remdesk_main.c
+index 4a7670e..072eec2 100644
+--- a/channels/remdesk/server/remdesk_main.c
++++ b/channels/remdesk/server/remdesk_main.c
+@@ -156,6 +156,8 @@ static int remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context)
+
+ remdesk_virtual_channel_write(context, s);
+
++ Stream_Free(s, TRUE);
++
+ return 1;
+ }
+
+diff --git a/client/common/cmdline.c b/client/common/cmdline.c
+index f1f9640..a731c31 100644
+--- a/client/common/cmdline.c
++++ b/client/common/cmdline.c
+@@ -2077,11 +2077,24 @@ int freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings)
+ }
+ }
+
++ if (settings->LyncRdpMode)
++ {
++ settings->EncomspVirtualChannel = TRUE;
++ settings->RemdeskVirtualChannel = TRUE;
++ settings->CompressionEnabled = FALSE;
++ }
++
+ if (settings->RemoteAssistanceMode)
+ {
++ settings->EncomspVirtualChannel = TRUE;
++ settings->RemdeskVirtualChannel = TRUE;
++ }
++
++ if (settings->EncomspVirtualChannel)
+ freerdp_client_load_static_channel_addin(channels, settings, "encomsp", settings);
++
++ if (settings->RemdeskVirtualChannel)
+ freerdp_client_load_static_channel_addin(channels, settings, "remdesk", settings);
+- }
+
+ for (index = 0; index < settings->StaticChannelCount; index++)
+ {
+diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h
+index a53c14d..ca358f1 100644
+--- a/include/freerdp/settings.h
++++ b/include/freerdp/settings.h
+@@ -599,6 +599,9 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL;
+ #define FreeRDP_RemoteAssistancePassStub 1026
+ #define FreeRDP_RemoteAssistancePassword 1027
+ #define FreeRDP_RemoteAssistanceRCTicket 1028
++#define FreeRDP_EncomspVirtualChannel 1029
++#define FreeRDP_RemdeskVirtualChannel 1030
++#define FreeRDP_LyncRdpMode 1031
+ #define FreeRDP_TlsSecurity 1088
+ #define FreeRDP_NlaSecurity 1089
+ #define FreeRDP_RdpSecurity 1090
+@@ -971,7 +974,10 @@ struct rdp_settings
+ ALIGN64 char* RemoteAssistancePassStub; /* 1026 */
+ ALIGN64 char* RemoteAssistancePassword; /* 1027 */
+ ALIGN64 char* RemoteAssistanceRCTicket; /* 1028 */
+- UINT64 padding1088[1088 - 1029]; /* 1029 */
++ ALIGN64 BOOL EncomspVirtualChannel; /* 1029 */
++ ALIGN64 BOOL RemdeskVirtualChannel; /* 1030 */
++ ALIGN64 BOOL LyncRdpMode; /* 1031 */
++ UINT64 padding1088[1088 - 1032]; /* 1032 */
+
+ /**
+ * X.224 Connection Request/Confirm
+diff --git a/rdtk/CMakeLists.txt b/rdtk/CMakeLists.txt
+index 35b0052..93c5a3c 100644
+--- a/rdtk/CMakeLists.txt
++++ b/rdtk/CMakeLists.txt
+@@ -44,8 +44,9 @@ include(CMakePackageConfigHelpers)
+ set(RDTK_VERSION_MAJOR "1")
+ set(RDTK_VERSION_MINOR "1")
+ set(RDTK_VERSION_REVISION "0")
+-set(RDTK_VERSION "${RDTK_VERSION_MAJOR}.${RDTK_VERSION_MINOR}")
+-set(RDTK_VERSION_FULL "${RDTK_VERSION}.${RDTK_VERSION_REVISION}")
++set(RDTK_API_VERSION "${RDTK_VERSION_MAJOR}.${RDTK_VERSION_MINOR}")
++set(RDTK_VERSION "${RDTK_API_VERSION}.${RDTK_VERSION_REVISION}")
++set(RDTK_VERSION_FULL "${RDTK_VERSION}")
+ set(RDTK_VERSION_FULL ${RDTK_VERSION_FULL} PARENT_SCOPE)
+
+ # Default to release build type
+diff --git a/rdtk/librdtk/CMakeLists.txt b/rdtk/librdtk/CMakeLists.txt
+index 8a81964..950cc7d 100644
+--- a/rdtk/librdtk/CMakeLists.txt
++++ b/rdtk/librdtk/CMakeLists.txt
+@@ -58,6 +58,10 @@ add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
+ list(APPEND ${MODULE_PREFIX}_LIBS winpr)
+ list(APPEND ${MODULE_PREFIX}_LIBS freerdp)
+
++if (WITH_LIBRARY_VERSIONING)
++ set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${RDTK_VERSION} SOVERSION ${RDTK_API_VERSION})
++endif()
++
+ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
+
+ install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT RdTkTargets)
+diff --git a/server/shadow/CMakeLists.txt b/server/shadow/CMakeLists.txt
+index 78f85b0..26a5c7b 100644
+--- a/server/shadow/CMakeLists.txt
++++ b/server/shadow/CMakeLists.txt
+@@ -238,6 +238,10 @@ list(APPEND ${MODULE_PREFIX}_LIBS rdtk)
+
+ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
+
++if (WITH_LIBRARY_VERSIONING)
++ set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
++endif()
++
+ install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT server)
+
+ set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow")
+diff --git a/server/shadow/X11/x11_shadow.c b/server/shadow/X11/x11_shadow.c
+index 3f1a964..d1a8591 100644
+--- a/server/shadow/X11/x11_shadow.c
++++ b/server/shadow/X11/x11_shadow.c
+@@ -386,7 +386,10 @@ int x11_shadow_pointer_alpha_update(x11ShadowSubsystem* subsystem)
+ msg->pixels = (BYTE*) malloc(msg->scanline * msg->height);
+
+ if (!msg->pixels)
++ {
++ free (msg);
+ return -1;
++ }
+
+ CopyMemory(msg->pixels, subsystem->cursorPixels, msg->scanline * msg->height);
+ msg->premultiplied = TRUE;
+diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c
+index 63d0b9e..30ab90e 100644
+--- a/server/shadow/shadow_client.c
++++ b/server/shadow/shadow_client.c
+@@ -67,6 +67,12 @@ void shadow_client_context_new(freerdp_peer* peer, rdpShadowClient* client)
+
+ settings->RdpKeyFile = _strdup(settings->PrivateKeyFile);
+
++ if (server->ipcSocket)
++ {
++ settings->LyncRdpMode = TRUE;
++ settings->CompressionEnabled = FALSE;
++ }
++
+ client->inLobby = TRUE;
+ client->mayView = server->mayView;
+ client->mayInteract = server->mayInteract;
+@@ -217,8 +223,12 @@ void shadow_client_refresh_rect(rdpShadowClient* client, BYTE count, RECTANGLE_1
+
+ wParam = (SHADOW_MSG_IN_REFRESH_OUTPUT*) calloc(1, sizeof(SHADOW_MSG_IN_REFRESH_OUTPUT));
+
+- if (!wParam)
++ if (!wParam || !areas)
++ {
++ if (wParam)
++ free (wParam);
+ return;
++ }
+
+ wParam->numRects = (UINT32) count;
+
+@@ -227,7 +237,10 @@ void shadow_client_refresh_rect(rdpShadowClient* client, BYTE count, RECTANGLE_1
+ wParam->rects = (RECTANGLE_16*) calloc(wParam->numRects, sizeof(RECTANGLE_16));
+
+ if (!wParam->rects)
++ {
++ free (wParam);
+ return;
++ }
+ }
+
+ CopyMemory(wParam->rects, areas, wParam->numRects * sizeof(RECTANGLE_16));
+@@ -832,12 +845,15 @@ int shadow_client_subsystem_process_message(rdpShadowClient* client, wMessage* m
+ pointerPosition.xPos = msg->xPos;
+ pointerPosition.yPos = msg->yPos;
+
+- if ((msg->xPos != client->pointerX) || (msg->yPos != client->pointerY))
++ if (client->activated)
+ {
+- IFCALL(update->pointer->PointerPosition, context, &pointerPosition);
++ if ((msg->xPos != client->pointerX) || (msg->yPos != client->pointerY))
++ {
++ IFCALL(update->pointer->PointerPosition, context, &pointerPosition);
+
+- client->pointerX = msg->xPos;
+- client->pointerY = msg->yPos;
++ client->pointerX = msg->xPos;
++ client->pointerY = msg->yPos;
++ }
+ }
+
+ free(msg);
+@@ -862,14 +878,17 @@ int shadow_client_subsystem_process_message(rdpShadowClient* client, wMessage* m
+
+ pointerCached.cacheIndex = pointerColor->cacheIndex;
+
+- shadow_client_convert_alpha_pointer_data(msg->pixels, msg->premultiplied,
+- msg->width, msg->height, pointerColor);
++ if (client->activated)
++ {
++ shadow_client_convert_alpha_pointer_data(msg->pixels, msg->premultiplied,
++ msg->width, msg->height, pointerColor);
+
+- IFCALL(update->pointer->PointerNew, context, &pointerNew);
+- IFCALL(update->pointer->PointerCached, context, &pointerCached);
++ IFCALL(update->pointer->PointerNew, context, &pointerNew);
++ IFCALL(update->pointer->PointerCached, context, &pointerCached);
+
+- free(pointerColor->xorMaskData);
+- free(pointerColor->andMaskData);
++ free(pointerColor->xorMaskData);
++ free(pointerColor->andMaskData);
++ }
+
+ free(msg->pixels);
+ free(msg);
+diff --git a/server/shadow/shadow_encoder.c b/server/shadow/shadow_encoder.c
+index 1e200ee..8d449bf 100644
+--- a/server/shadow/shadow_encoder.c
++++ b/server/shadow/shadow_encoder.c
+@@ -407,7 +407,10 @@ rdpShadowEncoder* shadow_encoder_new(rdpShadowClient* client)
+ encoder->height = server->screen->height;
+
+ if (shadow_encoder_init(encoder) < 0)
++ {
++ free (encoder);
+ return NULL;
++ }
+
+ return encoder;
+ }
+diff --git a/server/shadow/shadow_subsystem.c b/server/shadow/shadow_subsystem.c
+index f0ed9b8..ac4fd70 100644
+--- a/server/shadow/shadow_subsystem.c
++++ b/server/shadow/shadow_subsystem.c
+@@ -93,11 +93,11 @@ int shadow_subsystem_load_entry_points(RDP_SHADOW_ENTRY_POINTS* pEntryPoints, co
+
+ entry = shadow_subsystem_load_static_entry(name);
+
++ ZeroMemory(pEntryPoints, sizeof(RDP_SHADOW_ENTRY_POINTS));
++
+ if (!entry)
+ return -1;
+
+- ZeroMemory(pEntryPoints, sizeof(RDP_SHADOW_ENTRY_POINTS));
+-
+ if (entry(pEntryPoints) < 0)
+ return -1;
+
+diff --git a/server/shadow/shadow_surface.c b/server/shadow/shadow_surface.c
+index 9c58142..4c13662 100644
+--- a/server/shadow/shadow_surface.c
++++ b/server/shadow/shadow_surface.c
+@@ -44,12 +44,19 @@ rdpShadowSurface* shadow_surface_new(rdpShadowServer* server, int x, int y, int
+ surface->data = (BYTE*) malloc(surface->scanline * surface->height);
+
+ if (!surface->data)
++ {
++ free (surface);
+ return NULL;
++ }
+
+ ZeroMemory(surface->data, surface->scanline * surface->height);
+
+ if (!InitializeCriticalSectionAndSpinCount(&(surface->lock), 4000))
++ {
++ free (surface->data);
++ free (surface);
+ return NULL;
++ }
+
+ region16_init(&(surface->invalidRegion));
+
diff --git a/main/freerdp/musl-fix.patch b/main/freerdp/musl-fix.patch
new file mode 100644
index 0000000000..ffc2e4ad3f
--- /dev/null
+++ b/main/freerdp/musl-fix.patch
@@ -0,0 +1,47 @@
+--- ./winpr/libwinpr/synch/wait.c.orig
++++ ./winpr/libwinpr/synch/wait.c
+@@ -109,12 +109,7 @@
+ #if !defined(HAVE_PTHREAD_GNU_EXT)
+ #include <pthread.h>
+
+-#if defined(__FreeBSD__)
+-/*the only way to get it work is to remove the static*/
+ int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout)
+-#else
+-static int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout)
+-#endif
+ {
+ struct timespec timenow;
+ struct timespec sleepytime;
+--- ./winpr/libwinpr/comm/comm_serial_sys.c.orig
++++ ./winpr/libwinpr/comm/comm_serial_sys.c
+@@ -42,6 +42,9 @@
+ #define TTY_THRESHOLD_UNTHROTTLE 128
+ #define N_TTY_BUF_SIZE 4096
+
++#ifndef CMSPAR
++#define CMSPAR 010000000000
++#endif
+
+ #define _BAUD_TABLE_END 0010020 /* __MAX_BAUD + 1 */
+
+--- ./winpr/libwinpr/synch/wait.c.orig
++++ ./winpr/libwinpr/synch/wait.c
+@@ -24,6 +24,7 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#include <sys/select.h>
+
+ #include <winpr/crt.h>
+ #include <winpr/synch.h>
+--- ./winpr/libwinpr/comm/comm_io.c.orig
++++ ./winpr/libwinpr/comm/comm_io.c
+@@ -27,6 +27,7 @@
+ #include <errno.h>
+ #include <termios.h>
+ #include <unistd.h>
++#include <sys/select.h>
+
+ #include <winpr/io.h>
+ #include <winpr/wlog.h>