diff --git a/README.md b/README.md index 3bb9c0e..9c86af0 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,17 @@ Package Name | Required Version :--- |---:| - meson | 0.50 - valac | 0.48 - libglib-2.0-dev | 2.30 - libjson-glib-dev | 1.4.4 - libxml2-dev | 2.9.10 - libgee-0.8-dev | 0.8.5 - libsoup2.4-dev | 2.64 - libgtk-4-dev | 4.3.0 - libadwaita-1.0-dev | 1.2.0 - libsecret-1-dev | 0.20 - + meson | 0.56 + valac | 0.48 + libglib-2.0-dev | 2.30 + libjson-glib-dev | 1.4.4 + libxml2-dev | 2.9.10 + libgee-0.8-dev | 0.8.5 + libsoup2.4-dev | 2.64 + libgtk-4-dev | 4.3.0 + libadwaita-1.0-dev | 1.2.0 + libsecret-1-dev | 0.20 + 2. Run `install.sh` in the project directory. The app will launch automatically on success. diff --git a/build-aux/meson_post_install.py b/build-aux/meson_post_install.py new file mode 100644 index 0000000..c71d178 --- /dev/null +++ b/build-aux/meson_post_install.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +import os +import subprocess + +prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') +data_dir = os.path.join(prefix, 'share') +icon_dir = os.path.join(data_dir, 'icons', 'hicolor') +app_dir = os.path.join(data_dir, 'applications') +schema_dir = os.path.join(data_dir, 'glib-2.0', 'schemas') + +if not os.environ.get('DESTDIR'): + print('Compiling gsettings schemas...') + subprocess.call (['glib-compile-schemas', schema_dir]) + + print('Update icon cache...') + subprocess.call(['gtk-update-icon-cache', '-f', '-t', icon_dir]) + + print('Updating desktop database...') + subprocess.call(['update-desktop-database', '-q', app_dir]) diff --git a/data/meson.build b/data/meson.build index 4188f34..27cfb1a 100644 --- a/data/meson.build +++ b/data/meson.build @@ -50,6 +50,6 @@ if appstream_util.found() test( 'Validate appstream file', appstream_util, - args: ['validate', appstream_file], + args: ['validate-relax', appstream_file], ) endif diff --git a/meson.build b/meson.build index 585678d..6b8084f 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'dev.geopjr.tooth', ['c', 'vala'], version: '2.1.0', - meson_version: '>= 0.59.0', + meson_version: '>= 0.56.0', default_options: [ 'warning_level=2', 'werror=false', @@ -153,8 +153,15 @@ executable( subdir('data') subdir('po') -gnome.post_install( +# gnome.post_install() is available since meson 0.59.0 +# Distributions use their own tooling (e.g. postinst, triggers, etc) +# so it is okay if the post_install() is not run on distro builds +if meson.version().version_compare('>=0.59.0') + gnome.post_install( glib_compile_schemas: true, gtk_update_icon_cache: true, update_desktop_database: true, -) + ) +else + meson.add_install_script('build-aux/meson_post_install.py') +endif