aboutsummaryrefslogtreecommitdiffstats
path: root/community/gnome-boxes/add-smartcard-disable-option.patch
blob: dfb1e823c33a636ab721cb39806721ef55be8d3b (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 ac3d004f793307a89787acdf99e368ffc118d24f Mon Sep 17 00:00:00 2001
From: knuxify <knuxify@gmail.com>
Date: Tue, 5 Jul 2022 19:34:24 +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 d08220a..4e4782d 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 ebd86b4..2d0b4d4 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 f6144e5..1aef8d9 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 17720b5..e234c36 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -95,7 +95,7 @@ public static Domain create_domain_config (InstallerMedia install_media, string
             domain.add_device (create_graphics_device());
             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);
         }
 
-- 
2.37.0