git: bcdb7925cac7 - main - lang/ldc: Update to 1.35.0 and switch to using binary bootstrap.

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Tue, 14 Nov 2023 12:10:28 UTC
The branch main has been updated by arrowd:

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

commit bcdb7925cac781f8447e343a285ea5ce59bb3d51
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2023-10-21 18:49:44 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2023-11-14 12:08:42 +0000

    lang/ldc: Update to 1.35.0 and switch to using binary bootstrap.
    
    PR:             274635
    Approved by:    acm (maintainer timeout)
---
 lang/ldc/Makefile                                  | 41 ++++++++--------------
 lang/ldc/distinfo                                  |  8 +++--
 ...-runtime_druntime_src_core_sys_freebsd_config.d | 16 +++++----
 lang/ldc/pkg-plist                                 | 22 +++++++-----
 4 files changed, 43 insertions(+), 44 deletions(-)

diff --git a/lang/ldc/Makefile b/lang/ldc/Makefile
index 38358da368ae..d849a451eefe 100644
--- a/lang/ldc/Makefile
+++ b/lang/ldc/Makefile
@@ -1,9 +1,10 @@
 PORTNAME=	ldc
-PORTVERSION=	1.32.0
-PORTREVISION=	1
+PORTVERSION=	1.35.0
 DISTVERSIONSUFFIX=	-src
 CATEGORIES=	lang
 MASTER_SITES=	https://github.com/ldc-developers/${PORTNAME}/releases/download/v${DISTVERSION}/
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX} \
+		ldc2-${PORTVERSION}-freebsd-x86_64.tar.xz
 
 MAINTAINER=	acm@FreeBSD.org
 COMMENT=	LLVM-based D compiler
@@ -11,19 +12,13 @@ WWW=		https://wiki.dlang.org/LDC
 
 LICENSE=	BSD3CLAUSE
 
-BROKEN_armv6=	fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf?
-BROKEN_armv7=	fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf?
-BROKEN_i386=	function core.bitop.bsf (uint v) is not callable using argument types (ulong)
-BROKEN_riscv64=	fails to compile: unable to get target for 'riscv64-portbld-freebsd13.0', see -version and -mtriple.
-BROKEN_FreeBSD_14=	fails to compile: cannot open stdin: No such file or directory
+ONLY_FOR_ARCHS=	amd64
+ONLY_FOR_ARCHS_REASON=	The bootstrap compiler is provided only for x86_64
 
-BUILD_DEPENDS=	gdmd>0:devel/gdmd
-RUN_DEPENDS=	llvm${_LLVM_VER}>0:devel/llvm${_LLVM_VER}
 LIB_DEPENDS=	libconfig.so:devel/libconfig \
-		libgphobos.so:lang/gcc${_GCC_VER} \
-		libLLVM-${_LLVM_VER}.so:devel/llvm${_LLVM_VER}
+		libgphobos.so:lang/gcc${_GCC_VER}
 
-USES=		ninja cmake:insource pkgconfig
+USES=		llvm:lib,run ninja cmake:insource pkgconfig
 
 #USE_GITHUB=	yes
 #GH_ACCOUNT=	ldc-developers
@@ -31,27 +26,19 @@ USES=		ninja cmake:insource pkgconfig
 
 USE_LDCONFIG=	yes
 
-CC=		${LOCALBASE}/bin/clang${_LLVM_VER}
-CXX=		${LOCALBASE}/bin/clang++${_LLVM_VER}
-LLVM_CONFIG=	${LOCALBASE}/bin/llvm-config${_LLVM_VER}
-
 _GCC_VER=	11
-_LLVM_VER=	15
-
-.include <bsd.port.pre.mk>
 
-.if ${ARCH} == "aarch64" || ${ARCH} == "amd64"
-CFLAGS+=		-fPIC
-.endif
+CFLAGS+=	-fPIC
 
 CMAKE_ARGS+=	-DLDC_INSTALL_PREFIX="${PREFIX}" \
-		-DD_COMPILER="${PREFIX}/bin/gdmd" \
-		-DCMAKE_C_COMPILER="${CC}" \
-		-DCMAKE_CXX_COMPILER="${CXX}" \
-		-DLLVM_CONFIG=${LLVM_CONFIG} \
+		-DD_COMPILER="${WRKDIR}/ldc2-${PORTVERSION}-freebsd-x86_64/bin/ldmd2" \
+		-DLLVM_CONFIG=${LOCALBASE}/bin/${LLVM_CONFIG} \
 		-DBUILD_SHARED_LIBS="BOTH" \
 		-DBUILD_LTO_LIBS=ON
 
+post-patch:
+	cd ${WRKDIR}/ldc2-${PORTVERSION}-freebsd-x86_64/import && ${PATCH} -p3 < ${PATCHDIR}/patch-runtime_druntime_src_core_sys_freebsd_config.d
+
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldc-build-runtime
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldc-profdata
@@ -59,4 +46,4 @@ post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldc2
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldmd2
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/lang/ldc/distinfo b/lang/ldc/distinfo
index 6fdcb7e11f28..fa4d383fd740 100644
--- a/lang/ldc/distinfo
+++ b/lang/ldc/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1679824044
-SHA256 (ldc-1.32.0-src.tar.gz) = c4ee0bf91b416dd5641353d9b267b6a48600c499c782beb112d2e460e329beac
-SIZE (ldc-1.32.0-src.tar.gz) = 8112549
+TIMESTAMP = 1697911474
+SHA256 (ldc-1.35.0-src.tar.gz) = 6e296993706c76c093e609139aa0b3f8704355fa0f3756f6758d78d44226dfa0
+SIZE (ldc-1.35.0-src.tar.gz) = 8241960
+SHA256 (ldc2-1.35.0-freebsd-x86_64.tar.xz) = fdfd34380eba7a28dc2c3855e5582b56d67e90e2d5a649b682219a92445a8434
+SIZE (ldc2-1.35.0-freebsd-x86_64.tar.xz) = 18701992
diff --git a/lang/ldc/files/patch-runtime_druntime_src_core_sys_freebsd_config.d b/lang/ldc/files/patch-runtime_druntime_src_core_sys_freebsd_config.d
index 9ecea32eed5f..9568b56292e6 100644
--- a/lang/ldc/files/patch-runtime_druntime_src_core_sys_freebsd_config.d
+++ b/lang/ldc/files/patch-runtime_druntime_src_core_sys_freebsd_config.d
@@ -1,12 +1,16 @@
---- runtime/druntime/src/core/sys/freebsd/config.d.orig	2022-07-20 17:05:31 UTC
+--- runtime/druntime/src/core/sys/freebsd/config.d.orig	2023-10-15 11:24:58 UTC
 +++ runtime/druntime/src/core/sys/freebsd/config.d
-@@ -14,7 +14,8 @@ public import core.sys.posix.config;
+@@ -14,9 +14,10 @@ public import core.sys.posix.config;
  // 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;
-+     version (FreeBSD_14) enum __FreeBSD_version = 1400000;
-+else 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;
++     version (FreeBSD_15) enum __FreeBSD_version = 1500000;
++else version (FreeBSD_14) enum __FreeBSD_version = 1400000;
++else version (FreeBSD_13) enum __FreeBSD_version = 1302000;
++else version (FreeBSD_12) enum __FreeBSD_version = 1204000;
  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/ldc/pkg-plist b/lang/ldc/pkg-plist
index d6a8863a52e4..54bfc08c7cca 100644
--- a/lang/ldc/pkg-plist
+++ b/lang/ldc/pkg-plist
@@ -1,3 +1,4 @@
+bin/ldc-build-plugin
 bin/ldc-build-runtime
 bin/ldc-profdata
 bin/ldc-prune-cache
@@ -14,6 +15,7 @@ include/d/core/checkedint.d
 include/d/core/cpuid.d
 include/d/core/demangle.d
 include/d/core/exception.d
+include/d/core/factory.d
 include/d/core/gc/config.d
 include/d/core/gc/gcinterface.d
 include/d/core/gc/registry.d
@@ -201,6 +203,8 @@ include/d/core/sys/linux/execinfo.d
 include/d/core/sys/linux/fcntl.d
 include/d/core/sys/linux/fs.d
 include/d/core/sys/linux/ifaddrs.d
+include/d/core/sys/linux/input.d
+include/d/core/sys/linux/input_event_codes.d
 include/d/core/sys/linux/io_uring.d
 include/d/core/sys/linux/link.d
 include/d/core/sys/linux/netinet/in_.d
@@ -225,6 +229,7 @@ include/d/core/sys/linux/termios.d
 include/d/core/sys/linux/time.d
 include/d/core/sys/linux/timerfd.d
 include/d/core/sys/linux/tipc.d
+include/d/core/sys/linux/uinput.d
 include/d/core/sys/linux/unistd.d
 include/d/core/sys/netbsd/dlfcn.d
 include/d/core/sys/netbsd/err.d
@@ -516,6 +521,7 @@ include/d/etc/c/odbc/sqlucode.d
 include/d/etc/c/sqlite3.d
 include/d/etc/c/zlib.d
 include/d/etc/linux/memoryerror.d
+include/d/etc/valgrind/valgrind.d
 include/d/importc.h
 include/d/ldc/asan.d
 include/d/ldc/attributes.d
@@ -704,22 +710,22 @@ include/d/std/zip.d
 include/d/std/zlib.d
 lib/ldc_rt.dso.o
 lib/libdruntime-ldc-debug-shared.so
-lib/libdruntime-ldc-debug-shared.so.102
-lib/libdruntime-ldc-debug-shared.so.102.2
+lib/libdruntime-ldc-debug-shared.so.105
+lib/libdruntime-ldc-debug-shared.so.105.2
 lib/libdruntime-ldc-debug.a
 lib/libdruntime-ldc-lto.a
 lib/libdruntime-ldc-shared.so
-lib/libdruntime-ldc-shared.so.102
-lib/libdruntime-ldc-shared.so.102.2
+lib/libdruntime-ldc-shared.so.105
+lib/libdruntime-ldc-shared.so.105.2
 lib/libdruntime-ldc.a
 lib/libphobos2-ldc-debug-shared.so
-lib/libphobos2-ldc-debug-shared.so.102
-lib/libphobos2-ldc-debug-shared.so.102.2
+lib/libphobos2-ldc-debug-shared.so.105
+lib/libphobos2-ldc-debug-shared.so.105.2
 lib/libphobos2-ldc-debug.a
 lib/libphobos2-ldc-lto.a
 lib/libphobos2-ldc-shared.so
-lib/libphobos2-ldc-shared.so.102
-lib/libphobos2-ldc-shared.so.102.2
+lib/libphobos2-ldc-shared.so.105
+lib/libphobos2-ldc-shared.so.105.2
 lib/libphobos2-ldc.a
 @dir include/d/etc/c/zlib/doc
 @dir include/d/etc/c/zlib/test