git: febcdcce6160 - main - devel/wasi-compiler-rt14: add new port

From: Stefan Eßer <se_at_FreeBSD.org>
Date: Fri, 15 Jul 2022 23:09:24 UTC
The branch main has been updated by se:

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

commit febcdcce6160c7203722afca2c226aeac531c1e6
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2022-07-15 23:06:41 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2022-07-15 23:06:41 +0000

    devel/wasi-compiler-rt14: add new port
    
    This port is a copy of devel/wasi-compiler-rt13 with the DISTVERSION
    changed to 14.0.6 and the distinfo file updated to match that version.
---
 devel/Makefile                     |  1 +
 devel/wasi-compiler-rt14/Makefile  | 59 ++++++++++++++++++++++++++++++++++++++
 devel/wasi-compiler-rt14/distinfo  |  3 ++
 devel/wasi-compiler-rt14/pkg-descr |  7 +++++
 4 files changed, 70 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 90750a0c477e..94183264a354 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -7267,6 +7267,7 @@
     SUBDIR += wandio
     SUBDIR += wasi-compiler-rt11
     SUBDIR += wasi-compiler-rt13
+    SUBDIR += wasi-compiler-rt14
     SUBDIR += wasi-libc
     SUBDIR += wasi-libcxx
     SUBDIR += wasm3
diff --git a/devel/wasi-compiler-rt14/Makefile b/devel/wasi-compiler-rt14/Makefile
new file mode 100644
index 000000000000..ac08e5e750d4
--- /dev/null
+++ b/devel/wasi-compiler-rt14/Makefile
@@ -0,0 +1,59 @@
+PORTNAME=	compiler-rt
+DISTVERSION=	14.0.6
+CATEGORIES=	devel lang
+MASTER_SITES=	https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \
+		https://${PRE_}releases.llvm.org/${LLVM_RELEASE}/${RCDIR}
+PKGNAMEPREFIX=	wasi-
+PKGNAMESUFFIX=	${LLVM_SUFFIX}
+DISTNAME=	llvm-project-${DISTVERSION}.src
+DISTFILES=	llvm-project-${DISTVERSION}.src${EXTRACT_SUFX}
+
+MAINTAINER=	greg@unrelenting.technology
+COMMENT=	Clang builtins library for WebAssembly System Interface
+
+LICENSE=	LLVM2
+LICENSE_FILE=	${WRKSRC}/llvm/LICENSE.TXT
+LICENSE_NAME=	Apache License 2.0 with LLVM Exceptions
+LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+LLVM_RELEASE=	${DISTVERSION:C/rc.*//}
+LLVM_SUFFIX=	${LLVM_RELEASE:C/\.[0-9]\.[0-9]$//}
+LLVM_PREFIX=	${PREFIX}/llvm${LLVM_SUFFIX}
+
+WASI_SYSROOT=	${LOCALBASE}/share/wasi-sysroot
+
+BUILD_DEPENDS=	${WASI_SYSROOT}/include/stdarg.h:devel/wasi-libc \
+		clang${LLVM_SUFFIX}:devel/llvm${LLVM_SUFFIX}
+
+USES=		cmake tar:xz
+NO_ARCH=	yes
+
+PLIST_FILES=	llvm${LLVM_SUFFIX}/lib/clang/${LLVM_RELEASE}/lib/wasi/libclang_rt.builtins-wasm32.a
+
+CC=		${LOCALBASE}/bin/clang${LLVM_SUFFIX}
+CXX=		${LOCALBASE}/bin/clang++${LLVM_SUFFIX}
+
+CMAKE_SOURCE_PATH=	${WRKSRC}/compiler-rt/lib/builtins
+CMAKE_INSTALL_PREFIX=	${LLVM_PREFIX}/lib/clang/${LLVM_RELEASE}
+CMAKE_ARGS=	-DCMAKE_C_COMPILER_WORKS=1 \
+		-DCMAKE_SYSROOT=${WASI_SYSROOT} \
+		-DLLVM_CONFIG_PATH=${LOCALBASE}/bin/llvm-config${LLVM_SUFFIX} \
+		-DCOMPILER_RT_OS_DIR=wasi \
+		-DCOMPILER_RT_BAREMETAL_BUILD=TRUE \
+		-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=wasm32-wasi \
+		-DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=TRUE \
+		-DCOMPILER_RT_HAS_FPIC_FLAG:BOOL=ON \
+		-DCOMPILER_RT_HAS_FPIE_FLAG:BOOL=ON \
+		-DCOMPILER_RT_HAS_FNO_BUILTIN_FLAG:BOOL=ON \
+		-DCOMPILER_RT_HAS_STD_C11_FLAG:BOOL=ON \
+		-DCOMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG:BOOL=ON \
+		-DCOMPILER_RT_HAS_FREESTANDING_FLAG:BOOL=ON \
+		-DCOMPILER_RT_HAS_XRAY_COMPILER_FLAG:BOOL=OFF \
+		-DCOMPILER_RT_HAS_ATOMIC_KEYWORD:BOOL=ON \
+		-DCOMPILER_RT_HAS_FLOAT16:BOOL=OFF \
+		-DCOMPILER_RT_HAS_ASM_LSE:BOOL=OFF
+
+post-build:
+	${LOCALBASE}/bin/llvm-ranlib${LLVM_SUFFIX} ${CONFIGURE_WRKSRC}/lib/wasi/*.a
+
+.include <bsd.port.mk>
diff --git a/devel/wasi-compiler-rt14/distinfo b/devel/wasi-compiler-rt14/distinfo
new file mode 100644
index 000000000000..7419e65832bf
--- /dev/null
+++ b/devel/wasi-compiler-rt14/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1657924837
+SHA256 (llvm-project-14.0.6.src.tar.xz) = 8b3cfd7bc695bd6cea0f37f53f0981f34f87496e79e2529874fd03a2f9dd3a8a
+SIZE (llvm-project-14.0.6.src.tar.xz) = 105618228
diff --git a/devel/wasi-compiler-rt14/pkg-descr b/devel/wasi-compiler-rt14/pkg-descr
new file mode 100644
index 000000000000..9f4dbd2d452c
--- /dev/null
+++ b/devel/wasi-compiler-rt14/pkg-descr
@@ -0,0 +1,7 @@
+The LLVM Project is a collection of modular and reusable compiler and
+toolchain technologies.
+
+This port includes Clang builtins for WASI
+(WebAssembly System Interface).
+
+WWW: http://llvm.org/