Skip to content

Commit 2d4ea61

Browse files
committed
Fix meson not installing the schemas file; create a post_install script
1 parent 04f2b67 commit 2d4ea61

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

data/meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ i18n.merge_file(
2020
install_dir: join_paths(get_option('datadir'), 'applications')
2121
)
2222

23+
install_data (
24+
meson.project_name () + '.gschema.xml',
25+
install_dir: join_paths (get_option ('datadir'), 'glib-2.0', 'schemas')
26+
)
27+
2328
i18n.merge_file(
2429
input: meson.project_name() + '.appdata.xml',
2530
output: meson.project_name() + '.appdata.xml',

meson/post_install.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import subprocess
5+
6+
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
7+
datadir = os.path.join(prefix, 'share')
8+
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
9+
10+
# Packaging tools define DESTDIR and this isn't needed for them
11+
if 'DESTDIR' not in os.environ:
12+
print('Updating icon cache...')
13+
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
14+
if not os.path.exists(icon_cache_dir):
15+
os.makedirs(icon_cache_dir)
16+
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
17+
18+
print('Updating desktop database...')
19+
desktop_database_dir = os.path.join(datadir, 'applications')
20+
if not os.path.exists(desktop_database_dir):
21+
os.makedirs(desktop_database_dir)
22+
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
23+
24+
print('Compiling gsettings schemas...')
25+
subprocess.call(['glib-compile-schemas', schemadir])

0 commit comments

Comments
 (0)