diff options
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.patch | 76 |
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 @@ | |||
1 | From bcdb3555b924573e85039b54d63d6173ad99b846 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Le Guen de Kerneizon <paul.leguendekerneizon@savoirfairelinux.com> | ||
3 | Date: Wed, 28 Feb 2024 10:24:00 +0100 | ||
4 | Subject: [PATCH] setup.py: move global args to install args | ||
5 | |||
6 | Presently, during the installation process, global arguments such as | ||
7 | `no-update-icon-cache` and `no-compile-schemas` are utilized to | ||
8 | prevent the installation of specific graphical components. These | ||
9 | arguments are essential, for instance, when installing virt-manager | ||
10 | without any GUI dependencies on the target system. However, these | ||
11 | global arguments must be set before the install command, yet they only | ||
12 | take effect during the execution of the command. | ||
13 | |||
14 | Since the Yocto `setuptools3_legacy` class parses arguments after the | ||
15 | command, this commit aims to make these arguments applicable locally to | ||
16 | the install command. | ||
17 | |||
18 | Signed-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 | |||
23 | diff --git a/setup.py b/setup.py | ||
24 | index 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 | -- | ||
75 | 2.34.1 | ||
76 | |||