[Spice-commits] 3 commits - meson.build src/meson.build src/usb-device-widget.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 2 13:43:25 UTC 2019


 meson.build             |   45 ++++++++++++++++++++++++---------------------
 src/meson.build         |   21 +++++++--------------
 src/usb-device-widget.c |   23 +++++++++--------------
 3 files changed, 40 insertions(+), 49 deletions(-)

New commits:
commit 341424a6869116416a10d11524a0a47c2fb9d8c1
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Sat Dec 22 18:52:21 2018 +0400

    meson: don't link with all dependencies
    
    Split lib dependencies in 3 groups: glib, gtk, and acl.
    
    Fixes:
    https://gitlab.freedesktop.org/spice/spice-gtk/issues/77
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/meson.build b/meson.build
index 67149e7..9cb7ed4 100644
--- a/meson.build
+++ b/meson.build
@@ -31,7 +31,9 @@ spice_gtk_global_cflags = ['-DHAVE_CONFIG_H',
 compiler = meson.get_compiler('c')
 spice_gtk_config_data = configuration_data()
 spice_gtk_include = [include_directories('.')]
+spice_glib_deps = []
 spice_gtk_deps = []
+spice_acl_deps = []
 spice_gtk_host_system = host_machine.system()
 
 #
@@ -39,7 +41,7 @@ spice_gtk_host_system = host_machine.system()
 #
 spice_common = subproject('spice-common', default_options : ['generate-code=client'])
 spice_gtk_config_data.merge_from(spice_common.get_variable('spice_common_config_data'))
-spice_gtk_deps += spice_common.get_variable('spice_common_client_dep')
+spice_glib_deps += spice_common.get_variable('spice_common_client_dep')
 
 #
 # check for system headers
@@ -85,7 +87,7 @@ deps = {'spice-protocol' : spice_protocol_version,
         'openssl'        : '>= 1.0.0'}
 
 foreach dep, version : deps
-  spice_gtk_deps += dependency(dep, version : version)
+  spice_glib_deps += dependency(dep, version : version)
 endforeach
 
 # mandatory dependencies, without specific version requirement
@@ -98,7 +100,7 @@ else
 endif
 
 foreach dep : deps
-  spice_gtk_deps += dependency(dep)
+  spice_glib_deps += dependency(dep)
 endforeach
 
 deps = ['librt', 'libm']
@@ -107,7 +109,7 @@ if spice_gtk_host_system == 'windows'
 endif
 
 foreach dep : deps
-  spice_gtk_deps += compiler.find_library(dep)
+  spice_glib_deps += compiler.find_library(dep)
 endforeach
 
 #
@@ -118,7 +120,7 @@ optional_deps = {'celt051' : '>= 0.5.1.1',
 foreach dep, version : optional_deps
   d = dependency(dep, required : get_option(dep), version : version)
   if d.found()
-    spice_gtk_deps += d
+    spice_glib_deps += d
     spice_gtk_config_data.set('HAVE_ at 0@'.format(dep.underscorify().to_upper()), '1')
   endif
 endforeach
@@ -138,8 +140,8 @@ endif
 # webdav
 spice_gtk_has_phodav = false
 if get_option('webdav')
-  spice_gtk_deps += dependency('libphodav-2.0')
-  spice_gtk_deps += dependency('libsoup-2.4', version : '>= 2.49.91')
+  spice_glib_deps += dependency('libphodav-2.0')
+  spice_glib_deps += dependency('libsoup-2.4', version : '>= 2.49.91')
   spice_gtk_config_data.set('USE_PHODAV', '1')
   spice_gtk_has_phodav = true
 endif
@@ -149,7 +151,7 @@ spice_gtk_has_pulse = false
 if get_option('pulse')
   deps = ['libpulse', 'libpulse-mainloop-glib']
   foreach dep : deps
-    spice_gtk_deps += dependency(dep)
+    spice_glib_deps += dependency(dep)
   endforeach
   spice_gtk_config_data.set('HAVE_PULSE', '1')
   spice_gtk_has_pulse = true
@@ -161,7 +163,7 @@ spice_gtk_has_gstaudio = false
 if get_option('gstaudio')
   deps = gst_base_deps + ['gstreamer-audio-1.0']
   foreach dep : deps
-    spice_gtk_deps += dependency(dep)
+    spice_glib_deps += dependency(dep)
   endforeach
   spice_gtk_config_data.set('HAVE_GSTAUDIO', '1')
   spice_gtk_has_gstaudio = true
@@ -175,7 +177,7 @@ if get_option('gstvideo')
     deps += gst_base_deps
   endif
   foreach dep : deps
-    spice_gtk_deps += dependency(dep)
+    spice_glib_deps += dependency(dep)
   endforeach
   spice_gtk_config_data.set('HAVE_GSTVIDEO', '1')
   spice_gtk_has_gstvideo = true
@@ -199,21 +201,21 @@ if get_option('usbredir')
   if not usb_dep.found()
     usb_dep = dependency('libusbredirparser', version : '>= 0.4')
   endif
-  spice_gtk_deps += usb_dep
+  spice_glib_deps += usb_dep
 
   deps = {'libusbredirhost' : '>= 0.4.2',
           'libusb-1.0' : '>= 1.0.9'}
 
   foreach dep, version : deps
     usb_dep = dependency(dep, version : version)
-    spice_gtk_deps += usb_dep
+    spice_glib_deps += usb_dep
   endforeach
 
   if spice_gtk_host_system != 'windows'
     if usb_dep.version().version_compare('>= 1.0.16')
       spice_gtk_config_data.set('USE_LIBUSB_HOTPLUG', '1')
     else
-      spice_gtk_deps += dependency('gudev-1.0')
+      spice_glib_deps += dependency('gudev-1.0')
       spice_gtk_config_data.set('USE_GUDEV', '1')
     endif
   endif
@@ -239,11 +241,12 @@ if get_option('polkit')
       if not compiler.has_function('acl_get_file', dependencies : acl_dep)
         error('PolicyKit support requested, but some required packages are not available')
       endif
-      spice_gtk_deps += acl_dep
+      spice_acl_deps += acl_dep
     endif
   endif
 
-  spice_gtk_deps += polkit_dep
+  spice_acl_deps += polkit_dep
+  spice_acl_deps += dependency('gio-unix-2.0')
   spice_gtk_config_data.set('USE_POLKIT', '1')
   spice_gtk_has_polkit = true
 endif
@@ -303,7 +306,7 @@ endif
 # introspection
 spice_gtk_has_introspection = false
 if get_option('introspection')
-  spice_gtk_deps += dependency('gobject-introspection-1.0', version : '>= 0.94')
+  spice_glib_deps += dependency('gobject-introspection-1.0', version : '>= 0.94')
   spice_gtk_has_introspection = true
 endif
 
@@ -331,7 +334,7 @@ if get_option('lz4')
     lz4_dep = dependency('liblz4', version : '>= 1.7.3')
   endif
 
-  spice_gtk_deps += lz4_dep
+  spice_glib_deps += lz4_dep
   spice_gtk_config_data.set('USE_LZ4', '1')
   spice_gtk_has_lz4 = true
 endif
@@ -339,7 +342,7 @@ endif
 # sasl
 spice_gtk_has_sasl = false
 if get_option('sasl')
-  spice_gtk_deps += dependency('libsasl2')
+  spice_glib_deps += dependency('libsasl2')
   spice_gtk_config_data.set('HAVE_SASL', '1')
   spice_gtk_has_sasl = true
 endif
@@ -349,12 +352,12 @@ spice_gtk_has_smartcard = false
 if get_option('smartcard')
   smartcard_dep = dependency('libcacard', required : false, version : '>= 2.5.1')
   if smartcard_dep.found()
-    spice_gtk_deps += smartcard_dep
+    spice_glib_deps += smartcard_dep
     spice_gtk_config_data.set('USE_SMARTCARD', '1')
   else
     smartcard012_dep = dependency('libcacard', required : false, version : '>= 0.1.2')
     if smartcard012_dep.found()
-      spice_gtk_deps += smartcard012_dep
+      spice_glib_deps += smartcard012_dep
       spice_gtk_config_data.set('USE_SMARTCARD_012', '1')
     endif
   endif
diff --git a/src/meson.build b/src/meson.build
index a8e1d05..6bbb96b 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -199,12 +199,12 @@ spice_client_glib_lib = library('spice-client-glib-2.0', spice_client_glib_sourc
                                 include_directories : spice_gtk_include,
                                 link_args : [spice_gtk_version_script],
                                 link_depends : spice_client_glib_syms,
-                                dependencies : spice_gtk_deps)
+                                dependencies : spice_glib_deps)
 
 spice_client_glib_dep = declare_dependency(sources : [spice_marshals[1], spice_client_glib_enums[1]],
                                            link_with : spice_client_glib_lib,
                                            include_directories : spice_gtk_include,
-                                           dependencies : spice_gtk_deps)
+                                           dependencies : spice_glib_deps)
 
 #
 # SpiceClientGLib-2.0.gir
@@ -234,7 +234,7 @@ if spice_gtk_has_polkit
              install : true,
              install_dir : spice_gtk_usb_acl_helper_dir,
              install_mode : ['rwsr-xr-x', 'root', 'root'],
-             dependencies : spice_gtk_deps,
+             dependencies : spice_acl_deps,
              pie : spice_gtk_has_pie
             )
 endif
@@ -340,11 +340,11 @@ if spice_gtk_has_gtk
                                  install : true,
                                  link_args : [spice_gtk_version_script],
                                  link_depends : spice_client_gtk_syms,
-                                 dependencies : spice_client_glib_dep)
+                                 dependencies : [spice_client_glib_dep, spice_gtk_deps])
 
   spice_client_gtk_dep = declare_dependency(sources : spice_widget_enums[1],
                                             link_with : spice_client_gtk_lib,
-                                            dependencies : spice_client_glib_dep)
+                                            dependencies : [spice_client_glib_dep, spice_gtk_deps])
 
   #
   # SpiceClientGtk-3.0.gir
commit 25cfb7ed1799bb92f9aa036df1bb1127995b517c
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Sat Dec 22 17:49:35 2018 +0400

    usb-device-widget: replace deprecated Gtk+ API usage
    
    Use widget properties instead, as recommended in the documentation.
    The UI doesn't seem to have changed after these modifications.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Reviewed-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
index da24d00..de62564 100644
--- a/src/usb-device-widget.c
+++ b/src/usb-device-widget.c
@@ -163,9 +163,9 @@ spice_usb_device_widget_show_info_bar(SpiceUsbDeviceWidget *self,
     widget = gtk_label_new(message);
     gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 0);
 
-    priv->info_bar = gtk_alignment_new(0.0, 0.0, 1.0, 0.0);
-    gtk_alignment_set_padding(GTK_ALIGNMENT(priv->info_bar), 0, 0, 12, 0);
-    gtk_container_add(GTK_CONTAINER(priv->info_bar), info_bar);
+    priv->info_bar = info_bar;
+    gtk_widget_set_margin_start(info_bar, 12);
+    gtk_widget_set_halign(info_bar, GTK_ALIGN_FILL);
     gtk_box_pack_start(GTK_BOX(self), priv->info_bar, FALSE, FALSE, 0);
     gtk_widget_show_all(priv->info_bar);
 }
@@ -187,7 +187,8 @@ static void spice_usb_device_widget_constructed(GObject *gobject)
     str = g_strdup_printf("<b>%s</b>", _("Select USB devices to redirect"));
     gtk_label_set_markup(GTK_LABEL (priv->label), str);
     g_free(str);
-    gtk_misc_set_alignment(GTK_MISC(priv->label), 0.0, 0.5);
+    gtk_label_set_xalign(GTK_LABEL(priv->label), 0.0);
+    gtk_label_set_yalign(GTK_LABEL(priv->label), 0.5);
     gtk_box_pack_start(GTK_BOX(self), priv->label, FALSE, FALSE, 0);
 
     priv->manager = spice_usb_device_manager_get(priv->session, &err);
@@ -336,10 +337,6 @@ GtkWidget *spice_usb_device_widget_new(SpiceSession    *session,
 
 static SpiceUsbDevice *get_usb_device(GtkWidget *widget)
 {
-    if (!GTK_IS_ALIGNMENT(widget))
-        return NULL;
-
-    widget = gtk_bin_get_child(GTK_BIN(widget));
     return g_object_get_data(G_OBJECT(widget), "usb-device");
 }
 
@@ -525,7 +522,7 @@ static void device_added_cb(SpiceUsbDeviceManager *manager,
 {
     SpiceUsbDeviceWidget *self = SPICE_USB_DEVICE_WIDGET(user_data);
     SpiceUsbDeviceWidgetPrivate *priv = self->priv;
-    GtkWidget *align, *check;
+    GtkWidget *check;
     gchar *desc;
 
     desc = spice_usb_device_get_description(device,
@@ -544,12 +541,10 @@ static void device_added_cb(SpiceUsbDeviceManager *manager,
     g_signal_connect(G_OBJECT(check), "clicked",
                      G_CALLBACK(checkbox_clicked_cb), self);
 
-    align = gtk_alignment_new(0, 0, 0, 0);
-    gtk_alignment_set_padding(GTK_ALIGNMENT(align), 0, 0, 12, 0);
-    gtk_container_add(GTK_CONTAINER(align), check);
-    gtk_box_pack_end(GTK_BOX(self), align, FALSE, FALSE, 0);
+    gtk_widget_set_margin_start(check, 12);
+    gtk_box_pack_end(GTK_BOX(self), check, FALSE, FALSE, 0);
     spice_usb_device_widget_update_status(self);
-    gtk_widget_show_all(align);
+    gtk_widget_show_all(check);
 }
 
 static void destroy_widget_by_usb_device(GtkWidget *widget, gpointer user_data)
commit b411d14d30a91ec7459386b244d911317eb9f50a
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Sat Dec 22 17:29:22 2018 +0400

    meson: use 0.49 support for pie
    
    Removes:
    WARNING: Use the 'pie' kwarg instead of passing '-fpie' manually to 'spice-client-glib-usb-acl-helper'
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/meson.build b/meson.build
index 4e4bee8..67149e7 100644
--- a/meson.build
+++ b/meson.build
@@ -4,7 +4,7 @@
 project('spice-gtk', 'c',
          version : run_command('build-aux/git-version-gen', '${MESON_SOURCE_ROOT}/.tarball-version', check : true).stdout().strip(),
          license : 'LGPLv2.1',
-         meson_version : '>= 0.47.2')
+         meson_version : '>= 0.49')
 
 message('Updating submodules')
 run_command('build-aux/meson/check-spice-common', check : true)
diff --git a/src/meson.build b/src/meson.build
index dcf4dcc..a8e1d05 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -228,22 +228,15 @@ spice_client_glib_gir = gnome.generate_gir(spice_client_glib_lib,
 # spice-client-glib-usb-acl-helper
 #
 if spice_gtk_has_polkit
-  usb_acl_helper_c_args = []
-  usb_acl_helper_link_args = []
-
-  if spice_gtk_has_pie
-    usb_acl_helper_c_args += compiler.get_supported_arguments(['-fPIE'])
-    usb_acl_helper_link_args += compiler.get_supported_link_arguments(['-pie', '-Wl,-z,relro', '-Wl,-z,now'])
-  endif
   executable('spice-client-glib-usb-acl-helper',
              'spice-client-glib-usb-acl-helper.c',
              include_directories : spice_gtk_include,
              install : true,
              install_dir : spice_gtk_usb_acl_helper_dir,
              install_mode : ['rwsr-xr-x', 'root', 'root'],
-             c_args : usb_acl_helper_c_args,
-             link_args : usb_acl_helper_link_args,
-             dependencies : spice_gtk_deps)
+             dependencies : spice_gtk_deps,
+             pie : spice_gtk_has_pie
+            )
 endif
 
 


More information about the Spice-commits mailing list