[Spice-devel] [PATCH spice-gtk 08/34] build-sys: drop support for libcacard < 2.5.1

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Mon Jan 7 08:00:37 UTC 2019


From: Marc-André Lureau <marcandre.lureau at redhat.com>

v2.5.1 was released the 2015-11-24.

According to repology, from the distro we care about, CentOS 6,
openSUSE Leap 42.3 have too old version (0.1.2).

I didn't bother updating SPICE_CHECK_SMARTCARD, since spice-gtk is
probably the only user, and we are slowly dropping autoconf build-sys.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 configure.ac            | 18 +++++++++++++++++-
 meson.build             | 18 ++----------------
 src/channel-smartcard.c |  4 ----
 src/smartcard-manager.c |  6 ------
 tools/spicy.c           |  4 ----
 5 files changed, 19 insertions(+), 31 deletions(-)

diff --git a/configure.ac b/configure.ac
index a17af9c..70587ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -262,7 +262,23 @@ AC_SUBST(JPEG_LIBS)
 AC_CHECK_LIB(z, deflate, Z_LIBS='-lz', AC_MSG_ERROR([zlib not found]))
 AC_SUBST(Z_LIBS)
 
-SPICE_CHECK_SMARTCARD
+AC_ARG_ENABLE([smartcard],
+  AS_HELP_STRING([--enable-smartcard=@<:@yes/no/auto@:>@],
+                 [Enable smartcard support @<:@default=auto@:>@]),
+  [],
+  [enable_smartcard="auto"])
+
+if test "x$enable_smartcard" = "xno"; then
+  have_smartcard=no
+else
+  PKG_CHECK_MODULES([SMARTCARD], [libcacard >= 2.5.1], [have_smartcard=yes], [have_smartcard=no])
+  if test "x$enable_smartcard" = "xyes" && test "x$have_smartcard" = "xno"; then
+    AC_MSG_ERROR([smarcard support explicitly requested, but some required packages are not available])
+  fi
+  if test "x$have_smartcard" = "xyes"; then
+    AC_DEFINE(USE_SMARTCARD, [1], [Define if supporting smartcard proxying])
+  fi
+fi
 AM_CONDITIONAL([WITH_SMARTCARD], [test "x$have_smartcard" = "xyes"])
 
 AC_ARG_ENABLE([usbredir],
diff --git a/meson.build b/meson.build
index 13c1756..42c18f0 100644
--- a/meson.build
+++ b/meson.build
@@ -311,22 +311,8 @@ endif
 # smartcard check
 spice_gtk_has_smartcard = false
 if get_option('smartcard')
-  smartcard_dep = dependency('libcacard', required : false, version : '>= 2.5.1')
-  if smartcard_dep.found()
-    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_glib_deps += smartcard012_dep
-      spice_gtk_config_data.set('USE_SMARTCARD_012', '1')
-    endif
-  endif
-
-  spice_gtk_has_smartcard = smartcard_dep.found() or smartcard012_dep.found()
-  if not spice_gtk_has_smartcard
-    error('Building with smartcard support but dependency not found')
-  endif
+  spice_glib_deps += dependency('libcacard', version : '>= 2.5.1')
+  spice_gtk_config_data.set('USE_SMARTCARD', '1')
 endif
 
 #
diff --git a/src/channel-smartcard.c b/src/channel-smartcard.c
index 6d0facd..aad5f8f 100644
--- a/src/channel-smartcard.c
+++ b/src/channel-smartcard.c
@@ -17,10 +17,6 @@
 */
 #include "config.h"
 
-#ifdef USE_SMARTCARD_012
-#include <vreader.h>
-#endif
-
 #include "spice-client.h"
 #include "spice-common.h"
 
diff --git a/src/smartcard-manager.c b/src/smartcard-manager.c
index 9c94f95..ceecfdc 100644
--- a/src/smartcard-manager.c
+++ b/src/smartcard-manager.c
@@ -20,15 +20,9 @@
 #include <glib-object.h>
 #include <string.h>
 
-#ifdef USE_SMARTCARD_012
-#include <vcard_emul.h>
-#include <vevent.h>
-#include <vreader.h>
-#else
 #ifdef USE_SMARTCARD
 #include <libcacard.h>
 #endif
-#endif
 
 #include "spice-client.h"
 #include "smartcard-manager.h"
diff --git a/tools/spicy.c b/tools/spicy.c
index 3dca3dc..06af15e 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -24,10 +24,6 @@
 #include <termios.h>
 #endif
 
-#ifdef USE_SMARTCARD_012
-#include <vreader.h>
-#endif
-
 #include "spice-widget.h"
 #include "spice-gtk-session.h"
 #include "spice-audio.h"
-- 
2.20.1.2.gb21ebb671b



More information about the Spice-devel mailing list