From cadea0aa7a90c45e32328ee247ba234532e0dff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Moreno?= Date: Thu, 10 May 2018 13:38:05 +0200 Subject: [PATCH] GSettings scheme in meson build --- fractal-gtk/res/meson.build | 1 + fractal-gtk/res/org.gnome.Fractal.gschema.xml | 21 +++++++++++++++++++ meson.build | 2 ++ scripts/meson_post_install.py | 15 +++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 fractal-gtk/res/org.gnome.Fractal.gschema.xml create mode 100755 scripts/meson_post_install.py diff --git a/fractal-gtk/res/meson.build b/fractal-gtk/res/meson.build index d050c6f1..6635e3d7 100644 --- a/fractal-gtk/res/meson.build +++ b/fractal-gtk/res/meson.build @@ -2,3 +2,4 @@ subdir('icons') install_data('org.gnome.Fractal.desktop', install_dir : datadir + '/applications') install_data('org.gnome.Fractal.appdata.xml', install_dir : datadir + '/appdata') +install_data('org.gnome.Fractal.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')) diff --git a/fractal-gtk/res/org.gnome.Fractal.gschema.xml b/fractal-gtk/res/org.gnome.Fractal.gschema.xml new file mode 100644 index 00000000..9f1aba57 --- /dev/null +++ b/fractal-gtk/res/org.gnome.Fractal.gschema.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + 'Secret Service' + Type of password and token storage + + Type of password and token storage, default value is: Secret Service + + + + + + diff --git a/meson.build b/meson.build index a7b7f577..b8c5a7a8 100644 --- a/meson.build +++ b/meson.build @@ -39,3 +39,5 @@ cargo_release = custom_target('cargo-build', run_target('release', command: ['scripts/release.sh', meson.project_name() + '-' + fractal_version ]) + +meson.add_install_script('scripts/meson_post_install.py') diff --git a/scripts/meson_post_install.py b/scripts/meson_post_install.py new file mode 100755 index 00000000..bf320a9d --- /dev/null +++ b/scripts/meson_post_install.py @@ -0,0 +1,15 @@ +#!/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])