From 8b64dc3de1b10005ecae72f1491336b8c2c02c9f Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Thu, 19 Sep 2024 21:32:09 +0900 Subject: [PATCH] meson: Use gnome module instead of Python script --- meson.build | 11 ++++++++--- meson/post_install.py | 17 ----------------- 2 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 meson/post_install.py diff --git a/meson.build b/meson.build index 233c19c..85f28df 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,6 @@ project('com.github.dahenson.agenda', ['vala', 'c'], - version: '1.2.0' + version: '1.2.0', + meson_version: '>= 0.59.0' ) gnome = import('gnome') @@ -64,10 +65,14 @@ executable( vala_args: vala_args, c_args: c_args, dependencies: agenda_deps, - install : true + install: true ) -meson.add_install_script('meson/post_install.py') +gnome.post_install( + glib_compile_schemas: true, + gtk_update_icon_cache: true, + update_desktop_database: true +) subdir('data') subdir('po') diff --git a/meson/post_install.py b/meson/post_install.py deleted file mode 100644 index 09828fa..0000000 --- a/meson/post_install.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 - -from os import path, environ -import subprocess - -prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') -schemadir = path.join(environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') -datadir = path.join(prefix, 'share') -desktop_database_dir = path.join(datadir, 'applications') - -if not environ.get('DESTDIR'): - print('Compiling gsettings schemas…') - subprocess.call(['glib-compile-schemas', schemadir]) - print('Updating desktop database…') - subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) - print('Updating icon cache…') - subprocess.call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])