Merge branch 'wip/jtojnar/meson-cleanups' into 'master'

Various meson cleanups

See merge request pwithnall/malcontent!50
This commit is contained in:
Philip Withnall 2020-04-28 13:00:25 +00:00
commit 785c5d25cc
3 changed files with 15 additions and 8 deletions

View File

@ -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])

View File

@ -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',

View File

@ -24,6 +24,7 @@
#include <glib.h>
#include <locale.h>
#include <stdlib.h>
#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);