git: 60988c14d97a - main - cad/ghdl: Link to libgnat-12.so via rpath and do not require it via pkg

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Mon, 17 Mar 2025 18:10:44 UTC
The branch main has been updated by arrowd:

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

commit 60988c14d97ab2be6b13bb9d09274fe752e76848
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-03-17 18:09:25 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-03-17 18:10:38 +0000

    cad/ghdl: Link to libgnat-12.so via rpath and do not require it via pkg
    
    Reported by:    pkg-devel exp-run
---
 cad/ghdl/Makefile                |  2 ++
 cad/ghdl/files/patch-Makefile.in | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/cad/ghdl/Makefile b/cad/ghdl/Makefile
index abb1defb2bc5..cdbb15775212 100644
--- a/cad/ghdl/Makefile
+++ b/cad/ghdl/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	ghdl
 DISTVERSIONPREFIX=	v
 DISTVERSION=	5.0.1
+PORTREVISION=	1
 CATEGORIES=	cad
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -18,6 +19,7 @@ TEST_DEPENDS=	bash:shells/bash \
 USES=		ada:run gmake python:test shebangfix
 SHEBANG_FILES=	testsuite/testsuite.sh
 USE_LDCONFIG=	yes
+NO_SHLIB_REQUIRES_GLOB=	libgnat-12.so
 
 USE_GITHUB=	yes
 
diff --git a/cad/ghdl/files/patch-Makefile.in b/cad/ghdl/files/patch-Makefile.in
new file mode 100644
index 000000000000..846a95e7c625
--- /dev/null
+++ b/cad/ghdl/files/patch-Makefile.in
@@ -0,0 +1,13 @@
+Allow setting rpath to libgnat-12.so, because it isn't added to ldconfig directories.
+
+--- Makefile.in.orig	2025-03-01 16:49:42 UTC
++++ Makefile.in
+@@ -485,7 +485,7 @@ lib/$(libghdl_name): $(GRT_SRC_DEPS) $(LIBGHDL_GRT_OBJ
+ lib/$(libghdl_name): $(GRT_SRC_DEPS) $(LIBGHDL_GRT_OBJS) version.ads force
+ #	Use -g for gnatlink so that the binder file is not removed.  We need
+ #	it for libghdl.a
+-	$(GNATMAKE) -I- -aI. -D pic -z libghdl -o $@ -gnat12 $(GNATFLAGS) $(PIC_FLAGS) $(LIBGHDL_INCFLAGS) -bargs -shared -Llibghdl_ -largs -R -g -shared $(SHLIB_FLAGS) $(filter-out -static,$(LDFLAGS)) $(LIBGHDL_GRT_OBJS)
++	$(GNATMAKE) -I- -aI. -D pic -z libghdl -o $@ -gnat12 $(GNATFLAGS) $(PIC_FLAGS) $(LIBGHDL_INCFLAGS) -bargs -shared -Llibghdl_ -largs -g -shared $(SHLIB_FLAGS) $(filter-out -static,$(LDFLAGS)) $(LIBGHDL_GRT_OBJS)
+ #       On windows, gnatmake (via Osint.Executable_Name) always appends .exe
+ #       Adjust.  (Other solution: use gnatmake for compilation and binding,
+ #       then use gnatlink directly for linking).