aboutsummaryrefslogtreecommitdiffstats
path: root/community/gnome-boxes/add-smartcard-disable-option.patch
blob: 7c35eea5b2715934a6da23ff41e6ecf994c7f602 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From db0d70ada9f64b3af41fd34a4a31485cb5ac9ed5 Mon Sep 17 00:00:00 2001
From: knuxify <knuxify@gmail.com>
Date: Fri, 15 Apr 2022 14:32:05 +0200
Subject: [PATCH] build, config: Add separate option for enabling smartcard
 support

Allows for disabling smartcard support on systems where it is disabled
in QEMU.
---
 meson.build                                 | 1 +
 meson_options.txt                           | 5 +++++
 src/config.vapi                             | 1 +
 src/vm-configurator.vala                    | 2 +-
 4 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 4df18cbb..e13689c2 100644
--- a/meson.build
+++ b/meson.build
@@ -37,6 +37,7 @@ conf.set_quoted ('DATADIR', data_dir)
 conf.set_quoted ('CACHEDIR', '/var/cache')
 conf.set_quoted ('LOCALEDIR', locale_dir)
 conf.set10 ('UEFI_INSTALLS_SUPPORTED', get_option ('uefi'))
+conf.set10 ('SMARTCARD_SUPPORTED', get_option ('smartcard'))
 conf.set('PACKAGE_BUGREPORT', '"http://gitlab.gnome.org/gnome/gnome-boxes/issues"')
 
 if get_option ('profile') == 'development'
diff --git a/meson_options.txt b/meson_options.txt
index ebd86b47..2d0b4d4a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -34,3 +34,8 @@ option ('uefi',
         type: 'boolean',
         value: true,
         description: 'Allow installing operating systems with UEFI')
+
+option ('smartcard',
+        type: 'boolean',
+        value: true,
+        description: 'Whether to enable smartcard support or not')
diff --git a/src/config.vapi b/src/config.vapi
index f6144e59..1aef8d9b 100644
--- a/src/config.vapi
+++ b/src/config.vapi
@@ -15,4 +15,5 @@ namespace Config {
         public const string NAME_SUFFIX;
         public const string VERSION;
         public const bool UEFI_INSTALLS_SUPPORTED;
+        public const bool SMARTCARD_SUPPORTED;
 }
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 6d817df7..45b12f20 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -92,7 +92,7 @@ public static Domain create_domain_config (InstallerMedia install_media, string
 
         add_usb_support (domain, install_media);
 
-        if (!App.is_running_in_flatpak ())
+        if (Config.SMARTCARD_SUPPORTED && !App.is_running_in_flatpak ())
             add_smartcard_support (domain);
 
         set_video_config (domain, install_media);
-- 
2.35.2