dev-libs/glib: workaround Portage bug with binpkgs

With binpkgs, we seem to sometimes get a new dev-libs/gobject-introspection-1.82
installed which needs >=dev-libs/glib-2.82, but without the new glib. We
then try to build glib, we see that we have a gobject-introspection installed
that is new enough via `has_version` (=> we don't try to bootstrap it), then
when trying to use it via `pkg-config`, it falls off because we don't have
the glib that it needs.

This is obviously a Portage bug in not ensuring that gobject-introspection's
dependencies are satisifed before merging its binpkg, but let's workaround
it here: check thoroughly if the available gobject-introspection is usable. If
it ain't, just bootstrap as if it weren't installed.

(Just closing the bug given we don't have a testcase, not much point
in keeping it open and potentially confusing people. It only happens
sometimes and requires some bad luck, unfortunately. If it were always
the case w/ binpkgs, it'd be far easier to debug.)

Closes: https://bugs.gentoo.org/951487
Thanks-to: Artemis Everfree <artemis@artemis.sh>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2025-05-12 00:55:51 +01:00
parent a1e1e4b736
commit ca7bdcb2d7
4 changed files with 48 additions and 0 deletions
+12
View File
@@ -242,6 +242,18 @@ multilib_src_configure() {
return 0
fi
# Do we somehow have a dev-libs/gobject-introspection installed
# with an unsatisfied dependency? (bug #951487)
if ! $(tc-getPKG_CONFIG) --cflags gobject-introspection-1.0 &> /dev/null ; then
return 0
fi
# Make sure has_version didn't lie to us while at it as well,
# given bug #951487.
if ! $(tc-getPKG_CONFIG) --atleast-version=${INTROSPECTION__PV} gobject-introspection-1.0 &> /dev/null ; then
return 0
fi
return 1
}
+12
View File
@@ -230,6 +230,18 @@ multilib_src_configure() {
return 0
fi
# Do we somehow have a dev-libs/gobject-introspection installed
# with an unsatisfied dependency? (bug #951487)
if ! $(tc-getPKG_CONFIG) --cflags gobject-introspection-1.0 &> /dev/null ; then
return 0
fi
# Make sure has_version didn't lie to us while at it as well,
# given bug #951487.
if ! $(tc-getPKG_CONFIG) --atleast-version=${INTROSPECTION__PV} gobject-introspection-1.0 &> /dev/null ; then
return 0
fi
return 1
}
+12
View File
@@ -234,6 +234,18 @@ multilib_src_configure() {
return 0
fi
# Do we somehow have a dev-libs/gobject-introspection installed
# with an unsatisfied dependency? (bug #951487)
if ! $(tc-getPKG_CONFIG) --cflags gobject-introspection-1.0 &> /dev/null ; then
return 0
fi
# Make sure has_version didn't lie to us while at it as well,
# given bug #951487.
if ! $(tc-getPKG_CONFIG) --atleast-version=${INTROSPECTION__PV} gobject-introspection-1.0 &> /dev/null ; then
return 0
fi
return 1
}
+12
View File
@@ -235,6 +235,18 @@ multilib_src_configure() {
return 0
fi
# Do we somehow have a dev-libs/gobject-introspection installed
# with an unsatisfied dependency? (bug #951487)
if ! $(tc-getPKG_CONFIG) --cflags gobject-introspection-1.0 &> /dev/null ; then
return 0
fi
# Make sure has_version didn't lie to us while at it as well,
# given bug #951487.
if ! $(tc-getPKG_CONFIG) --atleast-version=${INTROSPECTION__PV} gobject-introspection-1.0 &> /dev/null ; then
return 0
fi
return 1
}