build: Run postinstall script where necessary

Package managers usually take care of compiling GSettings schemas and
updating the .desktop database on installation, but when building
manually from source, we should perform the aforementioned actions
ourselves.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/127
This commit is contained in:
Florian Müllner 2018-03-18 22:07:32 +01:00 committed by Jonas Ådahl
parent 78a92fb6be
commit 9c0707d4dc
2 changed files with 12 additions and 0 deletions

View File

@ -189,3 +189,5 @@ subdir('tests')
if get_option('gtk_doc')
subdir('docs/reference')
endif
meson.add_install_script('meson/meson-postinstall.sh')

10
meson/meson-postinstall.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Package managers set this so we don't need to run
if [ -z "$DESTDIR" ]; then
echo Compiling GSettings schemas...
glib-compile-schemas ${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas
echo Updating desktop database...
update-desktop-database -q ${MESON_INSTALL_PREFIX}/share/applications
fi