1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-28 14:49:30 +00:00

build: Use GNOME module post_install()

This greatly simplifies the post install script. As this functionality
depends on newer meson (0.59.0) it is guarded by a version check.
Distributions usually use their own tooling so it's does not matter if
they don't run the postinstall scripts (e.g. because of using too old
meson)
This commit is contained in:
Matt Turner 2022-09-03 11:44:14 -04:00 committed by Evangelos Ribeiro Tzaras
parent 7587d0a5c9
commit ce3cc6ec38
2 changed files with 11 additions and 19 deletions

View file

@ -1,18 +0,0 @@
#!/usr/bin/env python3
from os import environ, path
from subprocess import call
# Package managers set this, so we don't need to run
if not environ.get('DESTDIR', ''):
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = path.join(prefix, 'share')
print('Updating icon cache...')
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
print('Updating desktop database...')
call(['update-desktop-database', path.join(datadir, 'applications')])
print('Compiling schemas...')
call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])

View file

@ -137,4 +137,14 @@ subdir('plugins')
subdir('doc')
subdir('data')
meson.add_install_script('build-aux/meson/postinstall.py')
# gnome.post_install() is available since meson 0.59.0
# Distributions use their own tooling (e.g. postinst, triggers, etc)
# so it is okay if the post_install() is not run on distro builds
m_ver = meson.version().split('.')
if m_ver[0].to_int() > 0 or m_ver[1].to_int() > 58
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true,
)
endif