git: a40703d2966e - main - devel/json-fortran: Fix building with Flang

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Wed, 01 Oct 2025 18:45:48 UTC
The branch main has been updated by arrowd:

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

commit a40703d2966ecb6edb35498375c87d388ff487cf
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-10-01 18:45:29 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-10-01 18:45:42 +0000

    devel/json-fortran: Fix building with Flang
---
 devel/json-fortran/Makefile  | 11 ++++++++++-
 devel/json-fortran/pkg-plist |  8 ++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/devel/json-fortran/Makefile b/devel/json-fortran/Makefile
index c013f28d0338..773b0f98e4b1 100644
--- a/devel/json-fortran/Makefile
+++ b/devel/json-fortran/Makefile
@@ -21,4 +21,13 @@ CMAKE_OFF=	JSONFORTRAN_ENABLE_TESTS
 CMAKE_TESTING_ON=	JSONFORTRAN_ENABLE_TESTS ENABLE_TESTS
 CMAKE_TESTING_TARGET=	check
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${FORTRAN_DEFAULT} == flang
+PLIST_SUB+=	LIBSUFFIX=llvmflang
+TESTING_UNSAFE=	https://github.com/llvm/llvm-project/issues/161568
+.else
+PLIST_SUB+=	LIBSUFFIX=gnu
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/devel/json-fortran/pkg-plist b/devel/json-fortran/pkg-plist
index ad776f591767..655e8273c350 100644
--- a/devel/json-fortran/pkg-plist
+++ b/devel/json-fortran/pkg-plist
@@ -4,10 +4,10 @@ include/json_module.mod
 include/json_parameters.mod
 include/json_string_utilities.mod
 include/json_value_module.mod
-lib/cmake/jsonfortran-gnu-9.0.2/jsonfortran-gnu-config-version.cmake
-lib/cmake/jsonfortran-gnu-9.0.2/jsonfortran-gnu-config.cmake
-lib/cmake/jsonfortran-gnu-9.0.2/jsonfortran-gnu-targets-%%CMAKE_BUILD_TYPE%%.cmake
-lib/cmake/jsonfortran-gnu-9.0.2/jsonfortran-gnu-targets.cmake
+lib/cmake/jsonfortran-%%LIBSUFFIX%%-9.0.2/jsonfortran-%%LIBSUFFIX%%-config-version.cmake
+lib/cmake/jsonfortran-%%LIBSUFFIX%%-9.0.2/jsonfortran-%%LIBSUFFIX%%-config.cmake
+lib/cmake/jsonfortran-%%LIBSUFFIX%%-9.0.2/jsonfortran-%%LIBSUFFIX%%-targets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/jsonfortran-%%LIBSUFFIX%%-9.0.2/jsonfortran-%%LIBSUFFIX%%-targets.cmake
 lib/libjsonfortran.a
 lib/libjsonfortran.so
 lib/libjsonfortran.so.9.0