diff --git a/build-aux/meson_post_install.py b/build-aux/meson_post_install.py index bfdbebe..aefcadf 100644 --- a/build-aux/meson_post_install.py +++ b/build-aux/meson_post_install.py @@ -5,16 +5,14 @@ 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]) + if os.path.exists(icon_cache_dir): + print('Updating icon cache…') + 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]) + if os.path.exists(desktop_database_dir): + print('Updating desktop database…') + subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) diff --git a/meson.build b/meson.build index 7f7b24d..3b50f4e 100644 --- a/meson.build +++ b/meson.build @@ -44,6 +44,7 @@ polkitpolicydir = polkit_gobject.get_pkgconfig_variable('policydir', config_h = configuration_data() config_h.set_quoted('GETTEXT_PACKAGE', 'malcontent') config_h.set_quoted('PACKAGE_LOCALE_DIR', join_paths(get_option('prefix'), get_option('localedir'))) +config_h.set_quoted('PAMLIBDIR', pamlibdir) config_h.set_quoted('VERSION', meson.project_version()) configure_file( output: 'config.h', diff --git a/pam/tests/pam_malcontent.c b/pam/tests/pam_malcontent.c index 871516b..8aebb3d 100644 --- a/pam/tests/pam_malcontent.c +++ b/pam/tests/pam_malcontent.c @@ -24,6 +24,7 @@ #include #include #include +#include "config.h" /* Test that the `pam_malcontent.so` module can be loaded using dlopen() and * that it exports the appropriate symbols for PAM to be able to use it. */ @@ -37,6 +38,13 @@ test_pam_malcontent_dlopen (void) module_path = g_test_build_filename (G_TEST_BUILT, "..", "pam_malcontent.so", NULL); + /* Installed tests version. */ + if (!g_file_test (module_path, G_FILE_TEST_EXISTS)) + { + g_free (module_path); + module_path = g_build_filename (PAMLIBDIR, "pam_malcontent.so", NULL); + } + /* Check the module can be loaded. */ handle = dlopen (module_path, RTLD_NOW); g_assert_nonnull (handle);