From b7e84c432664f76f10680c04781ab5c3cafdd247 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 17 Feb 2022 22:37:28 +0800 Subject: [PATCH] build: Use gnome.post_install Also requires meson 0.57.0. Otherwise the post install script will fail if GTK 3 is not installed. --- build-aux/meson.build | 1 - build-aux/meson/meson.build | 1 - build-aux/meson/meson_post_install.py | 15 --------------- meson.build | 13 +++++++++++-- 4 files changed, 11 insertions(+), 19 deletions(-) delete mode 100644 build-aux/meson.build delete mode 100644 build-aux/meson/meson.build delete mode 100644 build-aux/meson/meson_post_install.py diff --git a/build-aux/meson.build b/build-aux/meson.build deleted file mode 100644 index 8800f009..00000000 --- a/build-aux/meson.build +++ /dev/null @@ -1 +0,0 @@ -subdir('meson') diff --git a/build-aux/meson/meson.build b/build-aux/meson/meson.build deleted file mode 100644 index 1ab810bb..00000000 --- a/build-aux/meson/meson.build +++ /dev/null @@ -1 +0,0 @@ -meson.add_install_script('meson_post_install.py') diff --git a/build-aux/meson/meson_post_install.py b/build-aux/meson/meson_post_install.py deleted file mode 100644 index bf320a9d..00000000 --- a/build-aux/meson/meson_post_install.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env python3 - -import os -import subprocess - -install_prefix = os.environ['MESON_INSTALL_PREFIX'] -icondir = os.path.join(install_prefix, 'share', 'icons', 'hicolor') -schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas') - -if not os.environ.get('DESTDIR'): - print('Update icon cache...') - subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir]) - - print('Compiling gsettings schemas...') - subprocess.call(['glib-compile-schemas', schemadir]) diff --git a/meson.build b/meson.build index d26e3116..8da3cf2b 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'c', version: '42.rc', license: 'GPL3+', - meson_version: '>= 0.53.0' + meson_version: '>= 0.57.0' ) @@ -187,7 +187,6 @@ src_dir = join_paths(meson.source_root(), 'src') # Subdirs # ########### -subdir('build-aux') subdir('data') subdir('src') subdir('po') @@ -206,3 +205,13 @@ summary({ 'Debug': calendar_debug, 'Tracing': enable_tracing, }, section: 'Development') + + +########### +# Scripts # +########### + +gnome.post_install( + glib_compile_schemas: true, + gtk_update_icon_cache: true, +)