diff --git a/build-aux/meson/post-install.sh b/build-aux/meson/post-install.sh new file mode 100755 index 0000000000..a59d7d5c66 --- /dev/null +++ b/build-aux/meson/post-install.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +gtk_version=$1 +gtk_abi_version=$2 +gtk_libdir=$3 +gtk_datadir=$4 + +# Package managers set this so we don't need to run +if [ -z "$DESTDIR" ]; then + echo Compiling GSettings schemas... + glib-compile-schemas ${gtk_datadir}/glib-2.0/schemas + + echo Updating desktop database... + update-desktop-database -q ${gtk_datadir}/applications + + echo Updating icon cache... + gtk-update-icon-cache -q -t -f ${gtk_datadir}/icons/hicolor + + echo Updating input method modules cache... + gtk4-query-immodules > ${gtk_libdir}/gtk-${version}/${gtk_abi_version}/immodules.cache +fi diff --git a/meson.build b/meson.build index 4dcc641a19..58cbee1969 100644 --- a/meson.build +++ b/meson.build @@ -95,10 +95,13 @@ endif os_unix = not os_win32 gtk_prefix = get_option('prefix') +gtk_includedir = join_paths(gtk_prefix, get_option('includedir')) gtk_libdir = join_paths(gtk_prefix, get_option('libdir')) gtk_datadir = join_paths(gtk_prefix, get_option('datadir')) gtk_localedir = join_paths(gtk_prefix, get_option('localedir')) gtk_sysconfdir = join_paths(gtk_prefix, get_option('sysconfdir')) +gtk_applicationsdir = join_paths(gtk_datadir, 'applications') +gtk_schemasdir = join_paths(gtk_datadir, 'glib-2.0/schemas') cc = meson.get_compiler('c') @@ -584,3 +587,10 @@ if get_option('enable-documentation') subdir('docs/tools') subdir('docs/reference') endif + +# Keep this in sync with post-install.sh expected arguments +meson.add_install_script('build-aux/meson/post-install.sh', + gtk_version, + gtk_binary_version, + gtk_libdir, + gtk_datadir)