GSettings scheme in meson build

This commit is contained in:
Daniel García Moreno 2018-05-10 13:38:05 +02:00
parent 6bdc21398f
commit cadea0aa7a
4 changed files with 39 additions and 0 deletions

View file

@ -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'))

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<schemalist>
<enum id="org.gnome.Fractal.PasswordStorage">
<value nick="Secret Service" value="0"/>
<value nick="Plain text" value="1"/>
</enum>
<schema path="/org/gnome/factal/" id="org.gnome.Fractal">
<key name="password-storage" enum="org.gnome.Fractal.PasswordStorage">
<default>'Secret Service'</default>
<summary>Type of password and token storage</summary>
<description>
Type of password and token storage, default value is: Secret Service
</description>
</key>
</schema>
</schemalist>

View file

@ -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')

15
scripts/meson_post_install.py Executable file
View file

@ -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])