Accepting request 986982 from home:MSirringhaus

wasi-libc needed for the wasm-wasi build-target

OBS-URL: https://build.opensuse.org/request/show/986982
OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/wasi-libc?expand=0&rev=1
This commit is contained in:
William Brown 2022-07-07 00:37:44 +00:00 committed by Git OBS Bridge
commit a8c036fdd6
11 changed files with 134 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

14
_service Normal file
View File

@ -0,0 +1,14 @@
<services>
<service name="obs_scm">
<param name="url">https://github.com/WebAssembly/wasi-libc</param>
<param name="scm">git</param>
<param name="versionprefix">0.1</param>
<param name="revision">main</param>
</service>
<service name="tar" mode="buildtime" />
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="buildtime" />
</services>

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb501337d1e48e9ac12550479ada8e49edb370abf99da76cacdbbd06a13d0cf9
size 5880845

View File

@ -0,0 +1,4 @@
name: wasi-libc
version: 0.1.1649882024.05cd0af
mtime: 1649882024
commit: 05cd0af0af4b5a191117d47a182adff1d6546b87

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8fbdcb828773e62894155c6656c629f6f0a1d85772a7441168dc32338aa98d8e
size 5880845

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cc2653e05f020c6851237ddb77ec23850819253ae2c40239be2407538de458d0
size 1086636

6
wasi-libc-rpmlintrc Normal file
View File

@ -0,0 +1,6 @@
# Those files ARE arch-independent, but named like they are not (*.a, etc.) so the script is wrong here
setBadness('arch-dependent-file-in-usr-share', 0)
# There are empty dummy-files in the sysroot
setBadness('lto-no-text-in-archive', 0)
setBadness('devel-file-in-non-devel-package', 0)

11
wasi-libc.changes Normal file
View File

@ -0,0 +1,11 @@
-------------------------------------------------------------------
Wed Apr 20 13:32:28 UTC 2022 - Martin Sirringhaus <martin.sirringhaus@suse.com>
- Add rpmlintrc to suppress errors for now
- Add workaround-broken-makefile.patch for cleaner build/install
separation
-------------------------------------------------------------------
Wed Apr 20 12:48:58 UTC 2022 - Martin Sirringhaus <martin.sirringhaus@suse.com>
- Initial commit

52
wasi-libc.spec Normal file
View File

@ -0,0 +1,52 @@
#
# spec file for package wasi-libc
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: wasi-libc
Version: 0.1.1649882024.05cd0af
Release: 0
Summary: WASI libc implementation for WebAssembly
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: MIT
URL: https://github.com/WebAssembly/wasi-libc
Source: %{name}-%{version}.tar.xz
Source1: wasi-libc-rpmlintrc
Patch1: workaround-broken-makefile.patch
BuildRequires: clang > 8
BuildRequires: llvm > 8
%description
%prep
%setup -q
%patch1 -p1
%build
export CC=clang
%make_build
%install
export CC=clang
# The makefile is stupid and compiles everything again if we do `make install`, so we
# do it only once
%make_install INSTALL_DIR="%{buildroot}/%{_datadir}/wasi-sysroot"
%files
%license LICENSE
%{_datadir}/wasi-sysroot/
%changelog

View File

@ -0,0 +1,14 @@
# Workaround as per https://github.com/WebAssembly/wasi-libc/issues/156
diff --git a/Makefile b/Makefile
index b9f3c00..cd044b0 100644
--- a/Makefile
+++ b/Makefile
@@ -565,7 +565,7 @@ check-symbols: startup_files libc
# 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)"