logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://anongit.hacktivis.me/git/overlay.git/

wasi-libc-24.ebuild (1026B)


  1. # Copyright 2024 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit toolchain-funcs
  5. MY_P="wasi-libc-wasi-sdk-${PV}"
  6. DESCRIPTION="WASI libc implementation for WebAssembly"
  7. HOMEPAGE="https://github.com/WebAssembly/wasi-libc"
  8. SRC_URI="https://github.com/WebAssembly/wasi-libc/archive/refs/tags/wasi-sdk-${PV}.tar.gz -> ${MY_P}.tar.gz"
  9. S="${WORKDIR}/${MY_P}/"
  10. LICENSE="Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT CC0-1.0 BSD-2 MIT BSD"
  11. SLOT="0"
  12. KEYWORDS="~amd64"
  13. DEPEND="
  14. sys-devel/clang
  15. sys-devel/llvm
  16. "
  17. RDEPEND="${DEPEND}"
  18. PATCHES=(
  19. "${FILESDIR}/wasi-libc-24-no-double-build.patch"
  20. )
  21. src_prepare() {
  22. default
  23. rm libc-bottom-half/sources/wasip2_component_type.o || die
  24. }
  25. src_configure() {
  26. tc-export CC NM AR
  27. tc-is-clang || die "Compiler isn't clang"
  28. }
  29. src_compile() {
  30. # gentoo defines SYSROOT
  31. emake SYSROOT="${S}/sysroot/"
  32. }
  33. src_install() {
  34. emake SYSROOT="${S}/sysroot/" INSTALL_DIR="${ED}/usr/share/wasi-sysroot" install
  35. }