build: Switch to Meson’s gnome.post_install function

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
This commit is contained in:
Jan Tojnar 2022-08-31 06:20:30 +02:00 committed by Philip Withnall
parent 6c96a5e7b6
commit 4d234c01dd
2 changed files with 5 additions and 20 deletions

View File

@ -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])

View File

@ -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')