diff --git a/README.md b/README.md index b1b30e2..68f71eb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # wasi-libc +wasi-libc is a libc for WebAssembly programs built on top of WASI system calls. It provides a wide array of POSIX-compatible C APIs, including support for standard I/O, file I/O, filesystem manipulation, memory management, time, string, environment variables, program startup, and many other APIs. + diff --git a/wasi-libc.spec b/wasi-libc.spec new file mode 100644 index 0000000..a55b2f4 --- /dev/null +++ b/wasi-libc.spec @@ -0,0 +1,65 @@ +Name: wasi-libc +Version: 0+20240828git.1b19fc6 +Release: 1mamba +Summary: WASI libc implementation for WebAssembly +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://github.com/WebAssembly/wasi-libc +Source: https://github.com/WebAssembly/wasi-libc.git/main@1b19fc6/wasi-libc-%{version}.tar.bz2 +License: Apache License 2.0, MIT +## AUTOBUILDREQ-BEGIN +## AUTOBUILDREQ-END + +%description +wasi-libc is a libc for WebAssembly programs built on top of WASI system calls. It provides a wide array of POSIX-compatible C APIs, including support for standard I/O, file I/O, filesystem manipulation, memory management, time, string, environment variables, program startup, and many other APIs. + +%package -n lib%{name}-devel +Group: Development/Libraries +Summary: WASI libc implementation for WebAssembly + +%description -n lib%{name}-devel +wasi-libc is a libc for WebAssembly programs built on top of WASI system calls. It provides a wide array of POSIX-compatible C APIs, including support for standard I/O, file I/O, filesystem manipulation, memory management, time, string, environment variables, program startup, and many other APIs. +This package contains libraries and header files for developing applications that use %{name}. + +#% debug_package + +%prep +%setup -q + +%build +make_options=( + WASM_CC=/usr/bin/clang + WASM_AR=/usr/bin/llvm-ar + WASM_NM=/usr/bin/llvm-nm +) + +%make ${make_options[@]} TARGET_TRIPLE=wasm32-wasi +%make ${make_options[@]} TARGET_TRIPLE=wasm32-wasip1 +%make ${make_options[@]} TARGET_TRIPLE=wasm32-wasip1-threads THREAD_MODEL=posix +%make ${make_options[@]} TARGET_TRIPLE=wasm32-wasip2 WASI_SNAPSHOT=p2 + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +install -dm755 %{buildroot}%{_datadir} +cp -dr --preserve=mode,timestamp sysroot %{buildroot}%{_datadir}/wasi-sysroot + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files -n lib%{name}-devel +%defattr(-,root,root) +%dir %{_datadir}/wasi-sysroot +%dir %{_datadir}/wasi-sysroot/include +%{_datadir}/wasi-sysroot/include/* +%dir %{_datadir}/wasi-sysroot/lib +%{_datadir}/wasi-sysroot/lib/* +%dir %{_datadir}/wasi-sysroot/share +%{_datadir}/wasi-sysroot/share/* +%doc LICENSE README.md + +%changelog +* Sat Sep 14 2024 Silvan Calarco 0+20240828git.1b19fc6-1mamba +- package created using the webbuild interface