From 54aadf0169e1ab4ba94e6a3ba9edbb40f7a766e6 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Fri, 25 Oct 2024 14:48:27 +0200 Subject: [PATCH] meson: add icons and schemas options Signed-off-by: Pavel Hrdina --- meson.build | 6 ++++++ meson_options.txt | 2 ++ setup.py | 27 --------------------------- 3 files changed, 8 insertions(+), 27 deletions(-) create mode 100644 meson_options.txt diff --git a/meson.build b/meson.build index 757845771..d46911db7 100644 --- a/meson.build +++ b/meson.build @@ -40,6 +40,12 @@ foreach bin : bin_data ) endforeach +gnome = import('gnome') +gnome.post_install( + glib_compile_schemas: get_option('compile-schemas'), + gtk_update_icon_cache: get_option('update-icon-cache'), +) + if git spec_conf = configuration_data({ 'VERSION': meson.project_version(), diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 000000000..4c723a9db --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,2 @@ +option('update-icon-cache', type: 'boolean', value: true, description: 'whether to run gtk-update-icon-cache') +option('compile-schemas', type: 'boolean', value: true, description: 'whether to compile gsettings schemas') diff --git a/setup.py b/setup.py index 249a9b8a9..676daee24 100755 --- a/setup.py +++ b/setup.py @@ -80,20 +80,6 @@ class my_install(setuptools.command.install.install): super().finalize_options() - def run(self): - super().run() - - if not self.distribution.no_update_icon_cache: - print("running gtk-update-icon-cache") - icon_path = os.path.join(self.install_data, "share/icons/hicolor") - self.spawn(["gtk-update-icon-cache", "-q", "-t", icon_path]) - - if not self.distribution.no_compile_schemas: - print("compiling gsettings schemas") - gschema_install = os.path.join(self.install_data, - "share/glib-2.0/schemas") - self.spawn(["glib-compile-schemas", gschema_install]) - ################### # Custom commands # @@ -237,18 +223,6 @@ class CheckPylint(setuptools.Command): pylint.lint.Run(lintfiles + pylint_opts) -class VMMDistribution(setuptools.dist.Distribution): - global_options = setuptools.dist.Distribution.global_options + [ - ("no-update-icon-cache", None, "Don't run gtk-update-icon-cache"), - ("no-compile-schemas", None, "Don't compile gsettings schemas"), - ] - - def __init__(self, *args, **kwargs): - self.no_update_icon_cache = False - self.no_compile_schemas = False - super().__init__(*args, **kwargs) - - setuptools.setup( name="virt-manager", version=BuildConfig.version, @@ -274,6 +248,5 @@ setuptools.setup( 'test': TestCommand, }, - distclass=VMMDistribution, packages=[], )