diff --git a/build-aux/meson_post_install.py b/build-aux/meson_post_install.py new file mode 100644 index 0000000..bfdbebe --- /dev/null +++ b/build-aux/meson_post_install.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os +import subprocess + +install_prefix = os.environ['MESON_INSTALL_PREFIX'] +schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas') + +if not os.environ.get('DESTDIR'): + print('Compiling gsettings schemas…') + subprocess.call(['glib-compile-schemas', schemadir]) + + print('Updating icon cache…') + icon_cache_dir = os.path.join(install_prefix, 'share', 'icons', 'hicolor') + subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) + + print('Updating desktop database…') + desktop_database_dir = os.path.join(install_prefix, 'share', 'applications') + subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) diff --git a/malcontent-control/icons/meson.build b/malcontent-control/icons/meson.build new file mode 100644 index 0000000..3c05e6a --- /dev/null +++ b/malcontent-control/icons/meson.build @@ -0,0 +1,8 @@ +install_data( + join_paths('scalable', application_id + '.svg'), + install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'), +) +install_data( + join_paths('symbolic', application_id + '-symbolic.svg'), + install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'symbolic', 'apps'), +) diff --git a/malcontent-control/icons/scalable/org.freedesktop.MalcontentControl.Devel.svg b/malcontent-control/icons/scalable/org.freedesktop.MalcontentControl.Devel.svg new file mode 100644 index 0000000..3fb10b7 --- /dev/null +++ b/malcontent-control/icons/scalable/org.freedesktop.MalcontentControl.Devel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/malcontent-control/icons/scalable/org.freedesktop.MalcontentControl.svg b/malcontent-control/icons/scalable/org.freedesktop.MalcontentControl.svg new file mode 100644 index 0000000..4fb1fb3 --- /dev/null +++ b/malcontent-control/icons/scalable/org.freedesktop.MalcontentControl.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/malcontent-control/icons/symbolic/org.freedesktop.MalcontentControl-symbolic.svg b/malcontent-control/icons/symbolic/org.freedesktop.MalcontentControl-symbolic.svg new file mode 100644 index 0000000..38529cf --- /dev/null +++ b/malcontent-control/icons/symbolic/org.freedesktop.MalcontentControl-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/malcontent-control/meson.build b/malcontent-control/meson.build index 2ee2415..11f1ff9 100644 --- a/malcontent-control/meson.build +++ b/malcontent-control/meson.build @@ -113,6 +113,6 @@ if xmllint.found() ) endif -# FIXME: Add icons and tests -#subdir('icons') +# FIXME: Add tests +subdir('icons') #subdir('tests') diff --git a/meson.build b/meson.build index 301a10b..7aa9e3b 100644 --- a/meson.build +++ b/meson.build @@ -133,3 +133,5 @@ subdir('malcontent-client') subdir('malcontent-control') subdir('pam') subdir('po') + +meson.add_install_script('build-aux/meson_post_install.py')