git: 57936dba89ea - main - lang/gcc11: Enable D lang compiler

From: Lorenzo Salvadore <salvadore_at_FreeBSD.org>
Date: Fri, 28 Oct 2022 14:56:09 UTC
The branch main has been updated by salvadore:

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

commit 57936dba89ea208e5dbc1bd2d7fda3d29a1838b3
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2022-10-27 21:03:38 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2022-10-28 14:55:48 +0000

    lang/gcc11: Enable D lang compiler
    
    Forward the part of commit f61fb49b2e76fd4f7a5b7a11510b5109206c19f2 that
    enables D lang compiler.
    
    PR:             266825
    Co-authored-by: Daniel Engberg <diizzy@FreeBSD.org>
---
 lang/gcc11/Makefile                                        |  5 +++--
 .../patch-libphobos_libdruntime_core_sys_freebsd_config.d  | 14 ++++++++++++++
 lang/gcc11/pkg-plist                                       |  3 +++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/lang/gcc11/Makefile b/lang/gcc11/Makefile
index e41d8ee8cdd9..50daf6cc11f2 100644
--- a/lang/gcc11/Makefile
+++ b/lang/gcc11/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	gcc
 PORTVERSION=	11.3.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	lang
 MASTER_SITES=	GCC
 PKGNAMESUFFIX=	${SUFFIX}
@@ -69,7 +69,7 @@ CONFIGURE_TARGET=	x86_64-portbld-${OPSYS:tl}${OSREL}
 CONFIGURE_ARGS+=	--with-abi=elfv2
 .endif
 
-LANGUAGES:=	c,c++,objc,fortran,jit
+LANGUAGES:=	c,c++,d,objc,fortran,jit
 TARGLIB=	${PREFIX}/lib/gcc${SUFFIX}
 TARGLIB32=	${PREFIX}/lib32	# The version information is added later
 LIBEXEC=	${PREFIX}/libexec/gcc${SUFFIX}
@@ -114,6 +114,7 @@ INFO=		gcc${SUFFIX}/cpp \
 		gcc${SUFFIX}/gcc \
 		gcc${SUFFIX}/gccinstall \
 		gcc${SUFFIX}/gccint \
+		gcc${SUFFIX}/gdc \
 		gcc${SUFFIX}/gfortran \
 		gcc${SUFFIX}/libgccjit \
 		gcc${SUFFIX}/libgomp
diff --git a/lang/gcc11/files/patch-libphobos_libdruntime_core_sys_freebsd_config.d b/lang/gcc11/files/patch-libphobos_libdruntime_core_sys_freebsd_config.d
new file mode 100644
index 000000000000..1c526cc8bb0b
--- /dev/null
+++ b/lang/gcc11/files/patch-libphobos_libdruntime_core_sys_freebsd_config.d
@@ -0,0 +1,14 @@
+--- libphobos/libdruntime/core/sys/freebsd/config.d.orig	2022-10-21 22:39:24 UTC
++++ libphobos/libdruntime/core/sys/freebsd/config.d
+@@ -13,8 +13,9 @@ public import core.sys.posix.config;
+ // __FreeBSD_version numbers are documented in the Porter's Handbook.
+ // NOTE: When adding newer versions of FreeBSD, verify all current versioned
+ // bindings are still compatible with the release.
+-     version (FreeBSD_13) enum __FreeBSD_version = 1300000;
+-else version (FreeBSD_12) enum __FreeBSD_version = 1202000;
++     version (FreeBSD_14) enum __FreeBSD_version = 1400000;
++else version (FreeBSD_13) enum __FreeBSD_version = 1301000;
++else version (FreeBSD_12) enum __FreeBSD_version = 1203000;
+ else version (FreeBSD_11) enum __FreeBSD_version = 1104000;
+ else version (FreeBSD_10) enum __FreeBSD_version = 1004000;
+ else version (FreeBSD_9)  enum __FreeBSD_version = 903000;
diff --git a/lang/gcc11/pkg-plist b/lang/gcc11/pkg-plist
index cada193c9907..86cafdfda739 100644
--- a/lang/gcc11/pkg-plist
+++ b/lang/gcc11/pkg-plist
@@ -5,6 +5,7 @@ bin/%%GNU_HOST%%-gcc-%%GCC_VERSION%%
 bin/%%GNU_HOST%%-gcc-ar%%SUFFIX%%
 bin/%%GNU_HOST%%-gcc-nm%%SUFFIX%%
 bin/%%GNU_HOST%%-gcc-ranlib%%SUFFIX%%
+bin/%%GNU_HOST%%-gdc%%SUFFIX%%
 bin/%%GNU_HOST%%-gfortran%%SUFFIX%%
 bin/c++%%SUFFIX%%
 bin/cpp%%SUFFIX%%
@@ -16,6 +17,7 @@ bin/gcc-ranlib%%SUFFIX%%
 bin/gcov%%SUFFIX%%
 bin/gcov-dump%%SUFFIX%%
 bin/gcov-tool%%SUFFIX%%
+bin/gdc%%SUFFIX%%
 bin/gfortran%%SUFFIX%%
 bin/lto-dump%%SUFFIX%%
 include/libgccjit++.h
@@ -26,6 +28,7 @@ man/man1/gcc%%SUFFIX%%.1.gz
 man/man1/gcov%%SUFFIX%%.1.gz
 man/man1/gcov-dump%%SUFFIX%%.1.gz
 man/man1/gcov-tool%%SUFFIX%%.1.gz
+man/man1/gdc%%SUFFIX%%.1.gz
 man/man1/gfortran%%SUFFIX%%.1.gz
 man/man1/lto-dump%%SUFFIX%%.1.gz
 share/gcc-%%GCC_VERSION%%/python/libstdcxx/__init__.py