[gnote/meson] Add post install script for updating caches
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote/meson] Add post install script for updating caches
- Date: Mon, 5 Apr 2021 11:29:52 +0000 (UTC)
commit f875ea2b3f75faaf450dc44b1f255e230e9f7f35
Author: Aurimas Černius <aurisc4 gmail com>
Date: Mon Apr 5 13:34:49 2021 +0300
Add post install script for updating caches
meson.build | 4 ++++
post-install.py | 19 +++++++++++++++++++
2 files changed, 23 insertions(+)
---
diff --git a/meson.build b/meson.build
index f8c61037..f4b13bdc 100644
--- a/meson.build
+++ b/meson.build
@@ -2,6 +2,7 @@ project('gnote', 'cpp', version: '41.alpha', meson_version: '>=0.49.0')
gnome = import('gnome')
i18n = import('i18n')
+python = import('python')
gnote_release = meson.project_version().split('.')[0]
libgnote_version_info = '0.0.0'
@@ -39,6 +40,9 @@ configure_file(
root_include_dir = include_directories('.')
srcdir = meson.current_source_dir()
+meson.add_install_script(python.find_installation('python3').path(),
+ join_paths(meson.source_root(), 'post-install.py'))
+
subdir('data')
subdir('help')
subdir('src')
diff --git a/post-install.py b/post-install.py
new file mode 100755
index 00000000..69d526a3
--- /dev/null
+++ b/post-install.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+import os
+import pathlib
+import subprocess
+
+prefix = pathlib.Path(os.environ.get('MESON_INSTALL_PREFIX', '/usr/local'))
+datadir = prefix / 'share'
+destdir = os.environ.get('DESTDIR', '')
+
+if not destdir:
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', str(datadir / 'glib-2.0' / 'schemas')])
+
+ print('Updating icon cache...')
+ subprocess.call(['gtk-update-icon-cache', '-qtf', str(datadir / 'icons' / 'hicolor')])
+
+ print('Updating desktop database...')
+ subprocess.call(['update-desktop-database', '-q', str(datadir / 'applications')])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]