diff options
-rw-r--r-- | girepository/girparser.c | 14 | ||||
-rw-r--r-- | meson.build | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c index f50ddb97..2b7c4ede 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -345,6 +345,20 @@ locate_gir (GIrParser *parser, return path; g_free (path); + path = g_build_filename (GOBJECT_INTROSPECTION_DATADIR, GIR_SUFFIX, girname, NULL); + g_debug ("Trying %s from DATADIR", path); + if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) + return path; + g_free (path); + +#ifdef G_OS_UNIX + path = g_build_filename ("/usr/share", GIR_SUFFIX, girname, NULL); + g_debug ("Trying %s", path); + if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) + return path; + g_free (path); +#endif + g_debug ("Did not find %s", girname); return NULL; } diff --git a/meson.build b/meson.build index 1bde17bb..512b9492 100644 --- a/meson.build +++ b/meson.build @@ -97,6 +97,7 @@ else gir_dir_pc_prefix = join_paths('${prefix}', gir_dir_prefix) endif girdir = join_paths(get_option('prefix'), gir_dir_prefix, 'gir-1.0') +config.set_quoted('GOBJECT_INTROSPECTION_DATADIR', join_paths(get_option('prefix'), get_option('datadir'))) config.set_quoted('GIR_DIR', girdir) config.set_quoted('GOBJECT_INTROSPECTION_LIBDIR', join_paths(get_option('prefix'), get_option('libdir'))) |