diff --git a/lang/ldc/Makefile b/lang/ldc/Makefile index f650d494ad93..03245d5b85ae 100644 --- a/lang/ldc/Makefile +++ b/lang/ldc/Makefile @@ -1,40 +1,43 @@ PORTNAME= ldc PORTVERSION= 1.41.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 WWW= https://wiki.dlang.org/LDC LICENSE= BSD3CLAUSE ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= The bootstrap compiler is provided only for x86_64 BUILD_DEPENDS= ${LOCALBASE}/llvm19/lib/libLLVM-19.so:devel/llvm19 # required for bootstrap LIB_DEPENDS= libconfig.so:devel/libconfig USES= llvm:lib,run,min=15,max=20 ninja cmake:insource pkgconfig USE_LDCONFIG= yes CFLAGS+= -fPIC CMAKE_ARGS+= -DLDC_INSTALL_PREFIX="${PREFIX}" \ -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}; patch < ${.CURDIR}/files/extra-patch-ldc2-1.41.0-freebsd-x86_64-import-core-sys-freebsd-config.d + post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldc-build-runtime ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldc-profdata ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldc-prune-cache ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldc2 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ldmd2 .include diff --git a/lang/ldc/files/extra-patch-ldc2-1.41.0-freebsd-x86_64-import-core-sys-freebsd-config.d b/lang/ldc/files/extra-patch-ldc2-1.41.0-freebsd-x86_64-import-core-sys-freebsd-config.d new file mode 100644 index 000000000000..1a8de7a3d4a7 --- /dev/null +++ b/lang/ldc/files/extra-patch-ldc2-1.41.0-freebsd-x86_64-import-core-sys-freebsd-config.d @@ -0,0 +1,12 @@ +--- ldc2-1.41.0-freebsd-x86_64/import/core/sys/freebsd/config.d.orig 2025-06-07 02:43:09 UTC ++++ ldc2-1.41.0-freebsd-x86_64/import/core/sys/freebsd/config.d +@@ -14,7 +14,8 @@ + // NOTE: When adding newer versions of FreeBSD, verify all current versioned + // bindings are still compatible with the release. + +- version (FreeBSD_15) enum __FreeBSD_version = 1500000; ++ version (FreeBSD_16) enum __FreeBSD_version = 1600000; ++else 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;