commit: 152eb23d9de60e5466a0759d38913ea9e06e13cf
parent 3180b4c4863b4f200e5ec466044b7aacb70cf034
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 5 Dec 2024 07:16:35 +0100
sys-libs/wasi-libc: new package, add 24
Diffstat:
3 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/sys-libs/wasi-libc/Manifest b/sys-libs/wasi-libc/Manifest
@@ -0,0 +1 @@
+DIST wasi-libc-wasi-sdk-24.tar.gz 1411497 BLAKE2B 0a6e55eb337de26884d7c642001b56198a06ca29f9cf107f98c241552af47b2f4a9d3c1a083746d7fc7247c208ff8d2092cf4553112529f8ad442550286265ab SHA512 ab9322dbcd0bb151ba3f5a8b722e04d39ea5d7632d0322257c3b67e4193d0de1b0820dd4db84923e7967f24189d02dd242693ea95ad184a309eec4d27df8ba21
diff --git a/sys-libs/wasi-libc/files/wasi-libc-24-no-double-build.patch b/sys-libs/wasi-libc/files/wasi-libc-24-no-double-build.patch
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -547,7 +547,7 @@
+ # This ignores whitespace because on Windows the output has CRLF line endings.
+ diff -wur "$(CURDIR)/expected/$(MULTIARCH_TRIPLE)" "$(SYSROOT_SHARE)"
+
+-install: finish
++install:
+ mkdir -p "$(INSTALL_DIR)"
+ cp -r "$(SYSROOT)/lib" "$(SYSROOT)/share" "$(SYSROOT)/include" "$(INSTALL_DIR)"
+
diff --git a/sys-libs/wasi-libc/wasi-libc-24.ebuild b/sys-libs/wasi-libc/wasi-libc-24.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2024 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+MY_P="wasi-libc-wasi-sdk-${PV}"
+
+DESCRIPTION="WASI libc implementation for WebAssembly"
+HOMEPAGE="https://github.com/WebAssembly/wasi-libc"
+SRC_URI="https://github.com/WebAssembly/wasi-libc/archive/refs/tags/wasi-sdk-${PV}.tar.gz -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}/"
+LICENSE="Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT CC0-1.0 BSD-2 MIT BSD"
+SLOT="0"
+
+KEYWORDS="~amd64"
+
+DEPEND="
+ sys-devel/clang
+ sys-devel/llvm
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/wasi-libc-24-no-double-build.patch"
+)
+
+src_prepare() {
+ default
+ rm libc-bottom-half/sources/wasip2_component_type.o || die
+}
+
+src_configure() {
+ tc-export CC NM AR
+
+ tc-is-clang || die "Compiler isn't clang"
+}
+
+src_compile() {
+ # gentoo defines SYSROOT
+ emake SYSROOT="${S}/sysroot/"
+}
+
+src_install() {
+ emake SYSROOT="${S}/sysroot/" INSTALL_DIR="${ED}/usr/share/wasi-sysroot" install
+}