void-packages/srcpkgs/glib/patches/0001-Relocate-the-repository-directory-for-native-builds.patch
oreo639 d12aff729e glib: update to 2.80.0.
This merges part of gobject-introspection tools, but not all of it.
Unfortunately this creates a cyclic dependency between glib and gi.
This is supposed to be temporary.

https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
2024-04-17 20:25:16 -07:00

34 lines
1.3 KiB
Diff

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));
}