From 697fd56f382f3a5a4db1db7c7ee6e8d471ec8b97 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 25 Mar 2020 18:53:28 +0100 Subject: [PATCH 1/3] build: Remove schema generation We do not have any GSettings schemas. --- build-aux/meson_post_install.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build-aux/meson_post_install.py b/build-aux/meson_post_install.py index bfdbebe..8cd5ad8 100644 --- a/build-aux/meson_post_install.py +++ b/build-aux/meson_post_install.py @@ -5,12 +5,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]) From 0d60138e0a6e8d31cc875c2315812f1cb998f8b7 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 25 Mar 2020 19:13:00 +0100 Subject: [PATCH 2/3] build: Only update post-install caches when they exist When building without UI, there are no icon or desktop files so there is no need to run the commands to refresh the caches. It would be even nicer to move the postinstall script to the malcontent-control subdirectory but it really applies to the installation output of the whole project, not just the malcontent-control part. --- build-aux/meson_post_install.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build-aux/meson_post_install.py b/build-aux/meson_post_install.py index 8cd5ad8..aefcadf 100644 --- a/build-aux/meson_post_install.py +++ b/build-aux/meson_post_install.py @@ -7,10 +7,12 @@ import subprocess install_prefix = os.environ['MESON_INSTALL_PREFIX'] if not os.environ.get('DESTDIR'): - 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]) From 38c1170bdab38c02945942dcc3492dceb84757e4 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 26 Mar 2020 02:56:33 +0100 Subject: [PATCH 3/3] tests: Respect pamlibdir in installed tests The build allows configuring pam module installation path but then it did not respect it in installed tests. --- meson.build | 1 + pam/tests/pam_malcontent.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/meson.build b/meson.build index b70ec5d..be9c365 100644 --- a/meson.build +++ b/meson.build @@ -49,6 +49,7 @@ libglib_testing_dep = dependency( 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);