[gnome-remote-desktop] build: Bump FreeRDP version to 2.3.x



commit 807cc4ec13fdcf5b42841fa5fe5de854115105b2
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Fri Aug 6 07:57:45 2021 +0200

    build: Bump FreeRDP version to 2.3.x
    
    After a very long time, Fedora finally started shipping FreeRDP >=
    2.3.x stable releases, which allow now to bump the version requirement.
    
    So, do exactly that and get rid of all the HAVE_FREERDP_2_3 ifdefs.

 .gitlab-ci.yml               |  2 +-
 config.h.meson               |  3 ---
 meson.build                  | 11 ++---------
 src/grd-clipboard-rdp.c      | 31 -------------------------------
 src/grd-rdp-fuse-clipboard.c | 20 --------------------
 src/grd-rdp-fuse-clipboard.h |  8 --------
 src/grd-session-rdp.c        | 18 ------------------
 7 files changed, 3 insertions(+), 90 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index db77ddb..17272d6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,7 +9,7 @@ stages:
 .gnome-remote-desktop.fedora:33@common:
   variables:
     FDO_DISTRIBUTION_VERSION: 34
-    BASE_TAG: '2021-03-26.0'
+    BASE_TAG: '2021-08-06.0'
     FDO_UPSTREAM_REPO: GNOME/gnome-remote-desktop
     FDO_DISTRIBUTION_EXEC: |
       dnf -y update && dnf -y upgrade &&
diff --git a/config.h.meson b/config.h.meson
index e7fa370..dd1b26e 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -11,6 +11,3 @@
 
 /* Defined if VNC backend is enabled */
 #mesondefine HAVE_VNC
-
-/* Defined if FreeRDP >= 2.3.x is available */
-#mesondefine HAVE_FREERDP_2_3
diff --git a/meson.build b/meson.build
index 17948a5..c3a53d8 100644
--- a/meson.build
+++ b/meson.build
@@ -4,7 +4,7 @@ project('gnome-remote-desktop', 'c',
         default_options: ['warning_level=1',
                           'buildtype=debugoptimized'])
 
-freerdp_req = '>= 2.2.0'
+freerdp_req = '>= 2.3.0'
 fuse_req = '>= 3.9.1'
 xkbcommon_req = '>= 1.0.0'
 
@@ -22,7 +22,6 @@ libnotify_dep = dependency('libnotify')
 
 have_rdp = get_option('rdp')
 have_vnc = get_option('vnc')
-have_freerdp_2_3 = true
 
 if not have_rdp and not have_vnc
   error('Must enable at least one backend')
@@ -31,12 +30,7 @@ endif
 if have_rdp
   add_global_arguments('-D_GNU_SOURCE', language : 'c')
 
-  freerdp_dep = dependency('freerdp2', version: '>= 2.3.0', required: false)
-  if not freerdp_dep.found()
-    freerdp_dep = dependency('freerdp2', version: freerdp_req)
-    have_freerdp_2_3 = false
-  endif
-
+  freerdp_dep = dependency('freerdp2', version: freerdp_req)
   freerdp_client_dep = dependency('freerdp-client2', version: freerdp_req)
   freerdp_server_dep = dependency('freerdp-server2', version: freerdp_req)
   fuse_dep = dependency('fuse3', version: fuse_req)
@@ -55,7 +49,6 @@ cdata.set_quoted('VERSION', meson.project_version())
 
 cdata.set('HAVE_RDP', have_rdp)
 cdata.set('HAVE_VNC', have_vnc)
-cdata.set('HAVE_FREERDP_2_3', have_freerdp_2_3)
 
 configure_file(input: 'config.h.meson',
                output: 'config.h',
diff --git a/src/grd-clipboard-rdp.c b/src/grd-clipboard-rdp.c
index e00a38a..3841c20 100644
--- a/src/grd-clipboard-rdp.c
+++ b/src/grd-clipboard-rdp.c
@@ -562,13 +562,8 @@ get_uri_list_from_packet_file_list (GrdClipboardRdp *clipboard_rdp,
                                     uint32_t        *dst_size,
                                     uint32_t         clip_data_id)
 {
-#ifdef HAVE_FREERDP_2_3
   FILEDESCRIPTORW *files = NULL;
   FILEDESCRIPTORW *file;
-#else
-  FILEDESCRIPTOR *files = NULL;
-  FILEDESCRIPTOR *file;
-#endif /* HAVE_FREERDP_2_3 */
   uint32_t n_files = 0;
   char *clip_data_dir_name;
   char *filename = NULL;
@@ -700,13 +695,8 @@ convert_client_content_for_server (GrdClipboardRdp *clipboard_rdp,
   if (mime_type == GRD_MIME_TYPE_TEXT_URILIST ||
       mime_type == GRD_MIME_TYPE_XS_GNOME_COPIED_FILES)
     {
-#ifdef HAVE_FREERDP_2_3
       FILEDESCRIPTORW *files = NULL;
       FILEDESCRIPTORW *file;
-#else
-      FILEDESCRIPTOR *files = NULL;
-      FILEDESCRIPTOR *file;
-#endif /* HAVE_FREERDP_2_3 */
       uint32_t n_files = 0;
       gboolean result;
       char *clip_data_dir_name;
@@ -912,21 +902,12 @@ grd_clipboard_rdp_request_client_content_for_mime_type (GrdClipboard     *clipbo
 }
 
 static void
-#ifdef HAVE_FREERDP_2_3
 serialize_file_list (FILEDESCRIPTORW  *files,
                      uint32_t          n_files,
                      uint8_t         **dst_data,
                      uint32_t         *dst_size)
 {
   FILEDESCRIPTORW *file;
-#else
-serialize_file_list (FILEDESCRIPTOR  *files,
-                     uint32_t         n_files,
-                     uint8_t        **dst_data,
-                     uint32_t        *dst_size)
-{
-  FILEDESCRIPTOR *file;
-#endif /* HAVE_FREERDP_2_3 */
   wStream* s = NULL;
   uint64_t last_write_time;
   uint32_t i, j;
@@ -1012,19 +993,11 @@ grd_clipboard_rdp_submit_requested_server_content (GrdClipboard *clipboard,
                 {
                   uint64_t serial = clipboard_rdp->serial;
                   ClipDataEntry *entry;
-#ifdef HAVE_FREERDP_2_3
                   FILEDESCRIPTORW *files;
                   uint32_t n_files;
 
                   files = (FILEDESCRIPTORW *) dst_data;
                   n_files = dst_size / sizeof (FILEDESCRIPTORW);
-#else
-                  FILEDESCRIPTOR *files;
-                  uint32_t n_files;
-
-                  files = (FILEDESCRIPTOR *) dst_data;
-                  n_files = dst_size / sizeof (FILEDESCRIPTOR);
-#endif /* HAVE_FREERDP_2_3 */
 
                   dst_data = NULL;
                   dst_size = 0;
@@ -1086,10 +1059,8 @@ cliprdr_client_capabilities (CliprdrServerContext       *cliprdr_context,
     g_strv_builder_add (client_capabilities, "file clip no file paths");
   if (cliprdr_context->canLockClipData)
     g_strv_builder_add (client_capabilities, "can lock clip data");
-#ifdef HAVE_FREERDP_2_3
   if (cliprdr_context->hasHugeFileSupport)
     g_strv_builder_add (client_capabilities, "huge file support");
-#endif /* HAVE_FREERDP_2_3 */
 
   client_caps_strings = g_strv_builder_end (client_capabilities);
   caps_string = g_strjoinv (", ", client_caps_strings);
@@ -2007,9 +1978,7 @@ grd_clipboard_rdp_new (GrdSessionRdp *session_rdp,
   cliprdr_context->streamFileClipEnabled = TRUE;
   cliprdr_context->fileClipNoFilePaths = TRUE;
   cliprdr_context->canLockClipData = TRUE;
-#ifdef HAVE_FREERDP_2_3
   cliprdr_context->hasHugeFileSupport = TRUE;
-#endif /* HAVE_FREERDP_2_3 */
 
   cliprdr_context->ClientCapabilities = cliprdr_client_capabilities;
   cliprdr_context->TempDirectory = cliprdr_temp_directory;
diff --git a/src/grd-rdp-fuse-clipboard.c b/src/grd-rdp-fuse-clipboard.c
index fe52f44..1d45820 100644
--- a/src/grd-rdp-fuse-clipboard.c
+++ b/src/grd-rdp-fuse-clipboard.c
@@ -600,11 +600,7 @@ get_parent_directory (GrdRdpFuseClipboard *rdp_fuse_clipboard,
 
 static gboolean
 set_selection_for_clip_data_entry (GrdRdpFuseClipboard *rdp_fuse_clipboard,
-#ifdef HAVE_FREERDP_2_3
                                    FILEDESCRIPTORW     *files,
-#else
-                                   FILEDESCRIPTOR      *files,
-#endif /* HAVE_FREERDP_2_3 */
                                    uint32_t             n_files,
                                    ClipDataEntry       *entry)
 {
@@ -619,11 +615,7 @@ set_selection_for_clip_data_entry (GrdRdpFuseClipboard *rdp_fuse_clipboard,
 
   for (i = 0; i < n_files; ++i)
     {
-#ifdef HAVE_FREERDP_2_3
       FILEDESCRIPTORW *file;
-#else
-      FILEDESCRIPTOR *file;
-#endif /* HAVE_FREERDP_2_3 */
       FuseFile *fuse_file, *parent;
       char *filename = NULL;
       uint32_t j;
@@ -676,11 +668,7 @@ set_selection_for_clip_data_entry (GrdRdpFuseClipboard *rdp_fuse_clipboard,
                             file->nFileSizeLow;
           fuse_file->has_size = TRUE;
         }
-#ifdef HAVE_FREERDP_2_3
       if (file->dwFlags & FD_WRITETIME)
-#else
-      if (file->dwFlags & FD_WRITESTIME)
-#endif /* HAVE_FREERDP_2_3 */
         {
           uint64_t filetime;
 
@@ -705,11 +693,7 @@ set_selection_for_clip_data_entry (GrdRdpFuseClipboard *rdp_fuse_clipboard,
 
 gboolean
 grd_rdp_fuse_clipboard_set_cdi_selection (GrdRdpFuseClipboard *rdp_fuse_clipboard,
-#ifdef HAVE_FREERDP_2_3
                                           FILEDESCRIPTORW     *files,
-#else
-                                          FILEDESCRIPTOR      *files,
-#endif /* HAVE_FREERDP_2_3 */
                                           uint32_t             n_files,
                                           uint32_t             clip_data_id)
 {
@@ -740,11 +724,7 @@ grd_rdp_fuse_clipboard_set_cdi_selection (GrdRdpFuseClipboard *rdp_fuse_clipboar
 
 gboolean
 grd_rdp_fuse_clipboard_set_no_cdi_selection (GrdRdpFuseClipboard *rdp_fuse_clipboard,
-#ifdef HAVE_FREERDP_2_3
                                              FILEDESCRIPTORW     *files,
-#else
-                                             FILEDESCRIPTOR      *files,
-#endif /* HAVE_FREERDP_2_3 */
                                              uint32_t             n_files)
 {
   gboolean result;
diff --git a/src/grd-rdp-fuse-clipboard.h b/src/grd-rdp-fuse-clipboard.h
index 3d44b8d..82814f7 100644
--- a/src/grd-rdp-fuse-clipboard.h
+++ b/src/grd-rdp-fuse-clipboard.h
@@ -46,20 +46,12 @@ void grd_rdp_fuse_clipboard_clear_no_cdi_selection (GrdRdpFuseClipboard *rdp_fus
 void grd_rdp_fuse_clipboard_lazily_clear_all_cdi_selections (GrdRdpFuseClipboard *rdp_fuse_clipboard);
 
 gboolean grd_rdp_fuse_clipboard_set_cdi_selection (GrdRdpFuseClipboard *rdp_fuse_clipboard,
-#ifdef HAVE_FREERDP_2_3
                                                    FILEDESCRIPTORW     *files,
-#else
-                                                   FILEDESCRIPTOR      *files,
-#endif /* HAVE_FREERDP_2_3 */
                                                    uint32_t             n_files,
                                                    uint32_t             clip_data_id);
 
 gboolean grd_rdp_fuse_clipboard_set_no_cdi_selection (GrdRdpFuseClipboard *rdp_fuse_clipboard,
-#ifdef HAVE_FREERDP_2_3
                                                       FILEDESCRIPTORW     *files,
-#else
-                                                      FILEDESCRIPTOR      *files,
-#endif /* HAVE_FREERDP_2_3 */
                                                       uint32_t             n_files);
 
 void grd_rdp_fuse_clipboard_submit_file_contents_response (GrdRdpFuseClipboard *rdp_fuse_clipboard,
diff --git a/src/grd-session-rdp.c b/src/grd-session-rdp.c
index 5b59eb9..6f62e7a 100644
--- a/src/grd-session-rdp.c
+++ b/src/grd-session-rdp.c
@@ -566,15 +566,9 @@ rdp_peer_refresh_rfx (freerdp_peer   *peer,
   RFX_RECT *rfx_rects, *rfx_rect;
   int n_rects;
   RFX_MESSAGE *rfx_messages;
-#ifdef HAVE_FREERDP_2_3
   size_t n_messages;
   BOOL first, last;
   size_t i;
-#else
-  int n_messages;
-  BOOL first, last;
-  int i;
-#endif /* HAVE_FREERDP_2_3 */
 
   n_rects = cairo_region_num_rectangles (region);
   rfx_rects = g_malloc0 (n_rects * sizeof (RFX_RECT));
@@ -589,7 +583,6 @@ rdp_peer_refresh_rfx (freerdp_peer   *peer,
       rfx_rect->height = cairo_rect.height;
     }
 
-#ifdef HAVE_FREERDP_2_3
   rfx_messages = rfx_encode_messages_ex (rdp_peer_context->rfx_context,
                                          rfx_rects,
                                          n_rects,
@@ -599,17 +592,6 @@ rdp_peer_refresh_rfx (freerdp_peer   *peer,
                                          src_stride,
                                          &n_messages,
                                          rdp_settings->MultifragMaxRequestSize);
-#else
-  rfx_messages = rfx_encode_messages (rdp_peer_context->rfx_context,
-                                      rfx_rects,
-                                      n_rects,
-                                      data,
-                                      desktop_width,
-                                      desktop_height,
-                                      src_stride,
-                                      &n_messages,
-                                      rdp_settings->MultifragMaxRequestSize);
-#endif /* HAVE_FREERDP_2_3 */
 
   cmd.cmdType = CMDTYPE_STREAM_SURFACE_BITS;
   cmd.bmp.codecID = rdp_settings->RemoteFxCodecId;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]