From 4d234c01ddc9177ba684fb3577bec8be91cf6c85 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 31 Aug 2022 06:20:30 +0200 Subject: [PATCH] =?UTF-8?q?build:=20Switch=20to=20Meson=E2=80=99s=20gnome.?= =?UTF-8?q?post=5Finstall=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of using a custom post install script. This drops the GTK 3 dependency. Required bumping minimum Meson version to 0.59 for the `update_desktop_database` kwarg. https://mesonbuild.com/Gnome-module.html#gnomepost_install --- build-aux/meson_post_install.py | 18 ------------------ meson.build | 7 +++++-- 2 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 build-aux/meson_post_install.py diff --git a/build-aux/meson_post_install.py b/build-aux/meson_post_install.py deleted file mode 100644 index aefcadf..0000000 --- a/build-aux/meson_post_install.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import os -import subprocess - -install_prefix = os.environ['MESON_INSTALL_PREFIX'] - -if not os.environ.get('DESTDIR'): - icon_cache_dir = os.path.join(install_prefix, 'share', 'icons', 'hicolor') - if os.path.exists(icon_cache_dir): - print('Updating icon cacheā€¦') - subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) - - desktop_database_dir = os.path.join(install_prefix, 'share', 'applications') - if os.path.exists(desktop_database_dir): - print('Updating desktop databaseā€¦') - subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) diff --git a/meson.build b/meson.build index 10dd469..d6f65bf 100644 --- a/meson.build +++ b/meson.build @@ -146,8 +146,11 @@ endif subdir('malcontent-client') if get_option('ui').enabled() subdir('malcontent-control') + + gnome.post_install( + gtk_update_icon_cache: true, + update_desktop_database: true, + ) endif subdir('pam') subdir('po') - -meson.add_install_script('build-aux/meson_post_install.py')