summaryrefslogtreecommitdiffstats
path: root/recipes-extended/virt-manager/virt-manager/0001-setup.py-move-global-args-to-install-args.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/virt-manager/virt-manager/0001-setup.py-move-global-args-to-install-args.patch')
-rw-r--r--recipes-extended/virt-manager/virt-manager/0001-setup.py-move-global-args-to-install-args.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/recipes-extended/virt-manager/virt-manager/0001-setup.py-move-global-args-to-install-args.patch b/recipes-extended/virt-manager/virt-manager/0001-setup.py-move-global-args-to-install-args.patch
new file mode 100644
index 00000000..2a08aa19
--- /dev/null
+++ b/recipes-extended/virt-manager/virt-manager/0001-setup.py-move-global-args-to-install-args.patch
@@ -0,0 +1,76 @@
1From bcdb3555b924573e85039b54d63d6173ad99b846 Mon Sep 17 00:00:00 2001
2From: Paul Le Guen de Kerneizon <paul.leguendekerneizon@savoirfairelinux.com>
3Date: Wed, 28 Feb 2024 10:24:00 +0100
4Subject: [PATCH] setup.py: move global args to install args
5
6Presently, during the installation process, global arguments such as
7`no-update-icon-cache` and `no-compile-schemas` are utilized to
8prevent the installation of specific graphical components. These
9arguments are essential, for instance, when installing virt-manager
10without any GUI dependencies on the target system. However, these
11global arguments must be set before the install command, yet they only
12take effect during the execution of the command.
13
14Since the Yocto `setuptools3_legacy` class parses arguments after the
15command, this commit aims to make these arguments applicable locally to
16the install command.
17
18Signed-off-by: Paul Le Guen de Kerneizon <paul.leguendekerneizon@savoirfairelinux.com>
19---
20 setup.py | 20 ++++++++++++--------
21 1 file changed, 12 insertions(+), 8 deletions(-)
22
23diff --git a/setup.py b/setup.py
24index cd6cd83e..faca546a 100755
25--- a/setup.py
26+++ b/setup.py
27@@ -242,6 +242,16 @@ class my_egg_info(setuptools.command.install_egg_info.install_egg_info):
28
29
30 class my_install(setuptools.command.install.install):
31+ setuptools.command.install.install.user_options += [
32+ ("no-update-icon-cache", None, "Don't run gtk-update-icon-cache"),
33+ ("no-compile-schemas", None, "Don't compile gsettings schemas"),
34+ ]
35+
36+ def initialize_options(self):
37+ setuptools.command.install.install.initialize_options(self)
38+ self.no_update_icon_cache = None
39+ self.no_compile_schemas = None
40+
41 """
42 Error if we weren't 'configure'd with the correct install prefix
43 """
44@@ -266,12 +276,12 @@ class my_install(setuptools.command.install.install):
45 def run(self):
46 setuptools.command.install.install.run(self)
47
48- if not self.distribution.no_update_icon_cache:
49+ if not self.no_update_icon_cache:
50 print("running gtk-update-icon-cache")
51 icon_path = os.path.join(self.install_data, "share/icons/hicolor")
52 self.spawn(["gtk-update-icon-cache", "-q", "-t", icon_path])
53
54- if not self.distribution.no_compile_schemas:
55+ if not self.no_compile_schemas:
56 print("compiling gsettings schemas")
57 gschema_install = os.path.join(self.install_data,
58 "share/glib-2.0/schemas")
59@@ -421,14 +431,8 @@ class CheckPylint(setuptools.Command):
60
61
62 class VMMDistribution(setuptools.dist.Distribution):
63- global_options = setuptools.dist.Distribution.global_options + [
64- ("no-update-icon-cache", None, "Don't run gtk-update-icon-cache"),
65- ("no-compile-schemas", None, "Don't compile gsettings schemas"),
66- ]
67
68 def __init__(self, *args, **kwargs):
69- self.no_update_icon_cache = False
70- self.no_compile_schemas = False
71 setuptools.dist.Distribution.__init__(self, *args, **kwargs)
72
73
74--
752.34.1
76