git: bdef65773efa - main - lang/gnat12: force rpath

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Mon, 26 Dec 2022 10:03:39 UTC
The branch main has been updated by thierry:

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

commit bdef65773efa68423025d01e6b024c5387e29fb8
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-12-23 09:47:35 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-12-26 10:03:36 +0000

    lang/gnat12: force rpath
    
    When lang/gcc12 is also installed, the programs installed by gnat12 might
    load libraries of gcc12. This could become problematic if these two ports
    get different versions.
    
    Modification inspired by lang/gcc6-aux/files/diff-core.
---
 lang/gnat12/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lang/gnat12/Makefile b/lang/gnat12/Makefile
index 7f0dd7389a05..ace641064c31 100644
--- a/lang/gnat12/Makefile
+++ b/lang/gnat12/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	gnat12
 PORTVERSION=	12.2.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	lang
 MASTER_SITES=	${MASTER_SITE_GCC}:gcc	\
 		LOCAL/thierry:gnat
@@ -108,6 +108,8 @@ PLIST_SUB+=	64BITS=""
 .endif
 
 pre-configure:
+	${FIND} ${WRKSRC}/gcc/config -name "*freebsd.h" | ${XARGS}	\
+		${REINPLACE_CMD} -e 's|!static:[[:blank:]]|!static: --hash-style=gnu -rpath ${PREFIX}/gnat${GCCVER}/lib |'
 	${ECHO} "-=> GNAT ${OS_LABEL4VERS}" > ${REVFILE}
 	${ECHO} "release" > ${PHASEFILE}