git: 464ad90a6b30 - main - devel/glib20: Override PREFIX for the @bootstrap flavor

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Fri, 04 Apr 2025 19:15:12 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=464ad90a6b30cf06ce90bbdceadcb5875b7b2b2c

commit 464ad90a6b30cf06ce90bbdceadcb5875b7b2b2c
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-04-04 08:13:38 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-04-04 19:11:59 +0000

    devel/glib20: Override PREFIX for the @bootstrap flavor
    
    This allows to break the install-time conflict between glib and glib-bootstrap
    
    PR:             285863
---
 devel/glib20/Makefile                | 11 +++++------
 devel/gobject-introspection/Makefile | 15 +++++++++++++--
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/devel/glib20/Makefile b/devel/glib20/Makefile
index 55811895ddab..74c94d95816b 100644
--- a/devel/glib20/Makefile
+++ b/devel/glib20/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	glib
 DISTVERSION=	2.82.4
+PORTREVISION=	1
 PORTEPOCH=	2
 CATEGORIES=	devel
 MASTER_SITES=	GNOME
@@ -26,19 +27,19 @@ FLAVORS=	default bootstrap
 FLAVOR?=	${FLAVORS:[1]}
 FLAVORS_SUB=	yes
 
-default_CONFLICTS_INSTALL=	glib-bootstrap
 default_BUILD_DEPENDS=	g-ir-scanner:devel/gobject-introspection@bootstrap
+default_USES=		trigger
 
 bootstrap_PKGNAMESUFFIX=	-bootstrap
-bootstrap_CONFLICTS_INSTALL=	glib
 
 # iconv:wchar_t - our iconv in base doesn't support utf-8 -> wchar_t (boooo)
 # (wchar_t is used by glibmm, rawtherapee triggered this)
 USES=		compiler:c11 cpe gettext gnome iconv:wchar_t localbase:ldflags \
-		meson perl5 pkgconfig python tar:xz trigger
+		meson perl5 pkgconfig python tar:xz ${${FLAVOR}_USES}
 USE_LDCONFIG=	yes
 USE_PERL5=	build
 USE_PYTHON=	py3kplist
+TRIGGERS=	gio-modules glib-schemas
 MESON_ARGS=	-Db_lundef=false \
 		-Ddefault_library=both \
 		-Dinstalled_tests=false \
@@ -76,13 +77,11 @@ TEST_MESON_TRUE=	tests
 MESON_ARGS+=	-Ddtrace=disabled
 
 .if ${FLAVOR:U} == bootstrap
-TRIGGERS=
 MESON_ARGS+=	-Dintrospection=disabled -Ddocumentation=false -Dman-pages=disabled
 OPTIONS_DEFINE=
+PREFIX=		${LOCALBASE}/glib-bootstrap
 PLIST_SUB+=	PORTDOCS='@comment ' NLS='@comment ' MANPAGES='@comment '
-PLIST_FILES+=	'@dir share/pkg/triggers'
 .else
-TRIGGERS=	gio-modules glib-schemas
 MESON_ARGS+=	-Dintrospection=enabled
 .endif
 
diff --git a/devel/gobject-introspection/Makefile b/devel/gobject-introspection/Makefile
index b6ed766281fe..efd8d48a869b 100644
--- a/devel/gobject-introspection/Makefile
+++ b/devel/gobject-introspection/Makefile
@@ -23,10 +23,11 @@ default_LIB_DEPENDS=	libglib-2.0.so:devel/glib20
 default_CONFLICTS_INSTALL=	gobject-introspection-bootstrap
 
 bootstrap_PKGNAMESUFFIX=	-bootstrap
-bootstrap_LIB_DEPENDS=	libglib-2.0.so:devel/glib20@bootstrap
+bootstrap_BUILD_DEPENDS=	${LOCALBASE}/glib-bootstrap/lib/libglib-2.0.so:devel/glib20@bootstrap
+bootstrap_RUN_DEPENDS=		${LOCALBASE}/glib-bootstrap/lib/libglib-2.0.so:devel/glib20@bootstrap
 bootstrap_CONFLICTS_INSTALL=	gobject-introspection
 
-USES=		bison gettext localbase meson pkgconfig python tar:xz
+USES=		bison gettext localbase:ldflags meson pkgconfig python tar:xz
 USE_LDCONFIG=	yes
 MESON_ARGS=	-Ddoctool=disabled \
 		-Dpython=${PYTHON_CMD}
@@ -37,6 +38,11 @@ OPTIONS_DEFINE=	TEST
 TEST_MESON_ENABLED=	cairo
 TEST_LIB_DEPENDS=	libcairo.so:graphics/cairo
 
+.if ${FLAVOR:U} == bootstrap
+MESON_ARGS+=	-Dcairo=disabled
+OPTIONS_DEFINE=
+.endif
+
 .include <bsd.port.pre.mk>
 
 .if ${PYTHON_REL} >= 31200
@@ -44,6 +50,11 @@ BUILD_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLA
 RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR}
 .endif
 
+.if ${FLAVOR:U} == bootstrap
+post-extract:
+	${LN} -s ${LOCALBASE}/glib-bootstrap/libdata/pkgconfig ${PKGCONFIG_LINKDIR}
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' ${WRKSRC}/tools/meson.build