void-packages/srcpkgs/glib/patches/0001-Relocate-the-repositor...

35 lines
1.3 KiB
Diff
Raw Normal View History

Allow us to specify the typelib sysroot in wrapper scripts for cross compiling.
--- a/girepository/girepository.c
+++ b/girepository/girepository.c
@@ -154,6 +154,7 @@ gi_repository_init (GIRepository *reposi
const char *libdir;
char *typelib_dir;
const char *type_lib_path_env;
+ const char *type_lib_sysroot_env;
/* This variable is intended to take precedence over both:
* - the default search path;
@@ -161,6 +162,9 @@ gi_repository_init (GIRepository *reposi
*/
type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
+ /* Void Linux addition for cross compiling, since we use cross sysroots */
+ type_lib_sysroot_env = g_getenv ("GI_TYPELIB_SYSROOT");
+
if (type_lib_path_env)
{
char **custom_dirs;
@@ -176,7 +180,10 @@ gi_repository_init (GIRepository *reposi
libdir = GOBJECT_INTROSPECTION_LIBDIR;
- typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
+ if (type_lib_sysroot_env)
+ typelib_dir = g_build_filename (type_lib_sysroot_env, libdir, "girepository-1.0", NULL);
+ else
+ typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
g_ptr_array_add (repository->typelib_search_path, g_steal_pointer (&typelib_dir));
}