From ca7bdcb2d766e34e77adf3e2bc0923314bdca7bd Mon Sep 17 00:00:00 2001 From: Sam James Date: Mon, 12 May 2025 00:50:27 +0100 Subject: [PATCH] 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 Signed-off-by: Sam James --- dev-libs/glib/glib-2.80.5-r1.ebuild | 12 ++++++++++++ dev-libs/glib/glib-2.82.5.ebuild | 12 ++++++++++++ dev-libs/glib/glib-2.84.0.ebuild | 12 ++++++++++++ dev-libs/glib/glib-2.84.1.ebuild | 12 ++++++++++++ 4 files changed, 48 insertions(+) diff --git a/dev-libs/glib/glib-2.80.5-r1.ebuild b/dev-libs/glib/glib-2.80.5-r1.ebuild index 29b3166bf27a5..a9a914f46ba85 100644 --- a/dev-libs/glib/glib-2.80.5-r1.ebuild +++ b/dev-libs/glib/glib-2.80.5-r1.ebuild @@ -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 } diff --git a/dev-libs/glib/glib-2.82.5.ebuild b/dev-libs/glib/glib-2.82.5.ebuild index 25e56d954a0a4..e27052e7d170f 100644 --- a/dev-libs/glib/glib-2.82.5.ebuild +++ b/dev-libs/glib/glib-2.82.5.ebuild @@ -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 } diff --git a/dev-libs/glib/glib-2.84.0.ebuild b/dev-libs/glib/glib-2.84.0.ebuild index 0324bbf012be0..940fdfbdeabed 100644 --- a/dev-libs/glib/glib-2.84.0.ebuild +++ b/dev-libs/glib/glib-2.84.0.ebuild @@ -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 } diff --git a/dev-libs/glib/glib-2.84.1.ebuild b/dev-libs/glib/glib-2.84.1.ebuild index 5584e992e9414..dd8cd776ccfbd 100644 --- a/dev-libs/glib/glib-2.84.1.ebuild +++ b/dev-libs/glib/glib-2.84.1.ebuild @@ -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 }