|
|
421b6c4 |
# Generated by go2rpm 1
|
|
|
b34ba92 |
%bcond_without check
|
|
|
b34ba92 |
|
|
|
275cbe0 |
%global __brp_strip_lto %{nil}
|
|
|
b34ba92 |
%global __brp_strip_static_archive %{nil}
|
|
|
b34ba92 |
|
|
|
b34ba92 |
# https://github.com/tinygo-org/tinygo
|
|
|
b34ba92 |
%global goipath github.com/tinygo-org/tinygo
|
|
|
fa5e9eb |
Version: 0.30.0
|
|
|
b34ba92 |
|
|
|
b34ba92 |
%global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393
|
|
|
b34ba92 |
%global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228
|
|
|
000c237 |
%global clang_llvm_version 17
|
|
|
4ce2174 |
%global cmsis_svd_commit df75ff974c76a911fc2815e29807f5ecaae06fc2
|
|
|
000c237 |
%global compiler_rt_version %{clang_llvm_version}.0.1
|
|
|
b22e370 |
%global macos_minsdk_commit ebb736fda2bec7cea38dcda807518b835a539525
|
|
|
35a3896 |
%global musl_version 1.2.3
|
|
|
bf7dd9c |
%global nrfx_commit d779b49fc59c7a165e7da1d7cd7d57b28a059f16
|
|
|
35a3896 |
%global picolibc_commit b92edfda8ac6853772d87cadaeeeaa21b78609b6
|
|
|
5756d01 |
%global wasi_libc_commit 30094b6ed05f19cee102115215863d185f2db4f0
|
|
|
35a3896 |
%global mingw64_commit 8526cb618269440a94810b94b77f8bd48c5c3396
|
|
|
b34ba92 |
|
|
|
dfd84e5 |
# No longer matching regular Go's /usr/share/gocode because it also provides
|
|
|
dfd84e5 |
# pre-compiled binaries, and symlinks to arch-specific clang headers.
|
|
|
dfd84e5 |
%global tinygoroot %{_libdir}/tinygo
|
|
|
b34ba92 |
|
|
|
b34ba92 |
%gometa
|
|
|
b34ba92 |
|
|
|
b34ba92 |
%global common_description %{expand:
|
|
|
b34ba92 |
Go compiler for small places. Microcontrollers, WebAssembly, and command-line
|
|
|
b34ba92 |
tools. Based on LLVM.}
|
|
|
b34ba92 |
|
|
|
b34ba92 |
#global godocs CHANGELOG.md BUILDING.md CONTRIBUTING.md README.md
|
|
|
b34ba92 |
#global golicenses LICENSE LICENSE.TXT
|
|
|
b34ba92 |
#global gosupfiles lib/CMSIS/CMSIS/Include/*.h lib/compiler-rt/lib/builtins/*/*.S lib/nrfx/mdk/*.{ld,S} src/examples/wasm/*/*.js targets/*.{js,json,ld,S}
|
|
|
b34ba92 |
|
|
|
b34ba92 |
Name: tinygo
|
|
|
dfb60b5 |
Release: %autorelease
|
|
|
b34ba92 |
Summary: Go compiler for small places
|
|
|
b34ba92 |
|
|
|
b34ba92 |
# Main files: BSD
|
|
|
b34ba92 |
# CMSIS: BSD (subsetted)
|
|
|
b34ba92 |
# avr-mcu: ASL 2.0 (packs) and MIT (Rust code, unused by this package)
|
|
|
bd124d1 |
# cmsis-svd: ASL 2.0 and BSD and ISC and MIT (subsetted)
|
|
|
b34ba92 |
# compiler-rt: NCSA or MIT
|
|
|
b22e370 |
# macos-minimal-sdk: APSL 2.0 and BSD and ISC and Public Domain
|
|
|
33d138a |
# musl: MIT
|
|
|
b34ba92 |
# nrfx: BSD and ASL 2.0
|
|
|
f7d3f8d |
# picolibc: BSD and ISC and MIT and GPLv2 (testing code only, unused by this package)
|
|
|
5e83ee0 |
# wasi-libc: BSD and CC0 and ISC and MIT and Public Domain
|
|
|
b22e370 |
License: BSD and APSL 2.0 and ASL 2.0 and CC0 and ISC and MIT and (NCSA or MIT) and Public Domain
|
|
|
b34ba92 |
URL: %{gourl}
|
|
|
b34ba92 |
Source0: %{gosource}
|
|
|
b34ba92 |
Source1: clean_tarballs.sh
|
|
|
b34ba92 |
Source2: cmsis-%{CMSIS_commit}-clean.tar.xz
|
|
|
b34ba92 |
Source3: https://github.com/avr-rust/avr-mcu/archive/%{avr_commit}/avr-%{avr_commit}.tar.gz
|
|
|
b34ba92 |
Source4: cmsis_svd-%{cmsis_svd_commit}-clean.tar.xz
|
|
|
b22e370 |
Source50: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}/compiler-rt-%{compiler_rt_version}.src.tar.xz
|
|
|
b22e370 |
Source51: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}/compiler-rt-%{compiler_rt_version}.src.tar.xz.sig
|
|
|
b002480 |
Source52: https://src.fedoraproject.org/rpms/compiler-rt/raw/f8e98d51f0c3fdbaa9ce5d99816930e4fcbe504b/f/release-keys.asc#/compiler-rt-release-keys.asc
|
|
|
33d138a |
Source60: https://musl.libc.org/releases/musl-%{musl_version}.tar.gz
|
|
|
33d138a |
Source61: https://musl.libc.org/releases/musl-%{musl_version}.tar.gz.asc
|
|
|
33d138a |
Source62: https://musl.libc.org/musl.pub
|
|
|
b22e370 |
Source7: https://github.com/aykevl/macos-minimal-sdk/archive/%{macos_minsdk_commit}/macos-minimal-sdk-%{macos_minsdk_commit}.tar.gz
|
|
|
b22e370 |
Source8: https://github.com/NordicSemiconductor/nrfx/archive/%{nrfx_commit}/nrfx-%{nrfx_commit}.tar.gz
|
|
|
b22e370 |
Source9: https://github.com/keith-packard/picolibc/archive/%{picolibc_commit}/picolibc-%{picolibc_commit}.tar.gz
|
|
|
b22e370 |
Source10: https://github.com/WebAssembly/wasi-libc/archive/%{wasi_libc_commit}/wasi-libc-%{wasi_libc_commit}.tar.gz
|
|
|
35a3896 |
Source11: https://github.com/mingw-w64/mingw-w64/archive/%{mingw64_commit}/mingw64-%{mingw64_commit}.tar.gz
|
|
|
b854f98 |
# We don't have wasmtime to run these.
|
|
|
b22e370 |
Patch0001: 0001-Skip-WASI-tests.patch
|
|
|
6cc5380 |
# Unbundling things
|
|
|
35a3896 |
# Patch0002: 0002-Use-system-mingw64-headers-and-crt.patch
|
|
|
6cc5380 |
# Skip testing some things where qemu is broken:
|
|
|
6cc5380 |
# https://gitlab.com/qemu-project/qemu/-/issues/447
|
|
|
6cc5380 |
# https://gitlab.com/qemu-project/qemu/-/issues/690
|
|
|
35a3896 |
Patch0002: 0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch
|
|
|
ab77f34 |
# Add Fedora specific dnf instructions
|
|
|
35a3896 |
Patch0003: 0003-Suggest-optional-packages-to-install-if-missing.patch
|
|
|
b22e370 |
|
|
|
000c237 |
# Support LLVM 17.
|
|
|
000c237 |
# https://github.com/tinygo-org/tinygo/pull/3923
|
|
|
000c237 |
Patch0004: 0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch
|
|
|
000c237 |
# https://github.com/tinygo-org/tinygo/pull/3918
|
|
|
000c237 |
Patch0005: 0005-all-use-the-new-LLVM-pass-manager.patch
|
|
|
000c237 |
# https://github.com/tinygo-org/tinygo/pull/3913
|
|
|
000c237 |
Patch0006: 0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch
|
|
|
000c237 |
Patch0007: 0007-all-add-initial-LLVM-17-support.patch
|
|
|
000c237 |
|
|
|
6e6ed23 |
# Not supported upstream yet.
|
|
|
b2c23a4 |
ExcludeArch: ppc64le s390x
|
|
|
d515a92 |
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
|
|
|
d515a92 |
ExcludeArch: %{ix86}
|
|
|
6e6ed23 |
|
|
|
52b73ed |
BuildRequires: (clang-devel >= %{clang_llvm_version} with clang-devel < %{lua: print(tonumber(rpm.expand('%{clang_llvm_version}')) + 1)})
|
|
|
33d138a |
BuildRequires: golang(github.com/aykevl/go-wasm)
|
|
|
b34ba92 |
BuildRequires: golang(github.com/blakesmith/ar)
|
|
|
118877d |
BuildRequires: chromium
|
|
|
41a0389 |
BuildRequires: golang(github.com/chromedp/chromedp) >= 0.7.6
|
|
|
eeea62b |
BuildRequires: golang(github.com/chromedp/cdproto/cdp)
|
|
|
41a0389 |
BuildRequires: golang(github.com/gofrs/flock) >= 0.8.1
|
|
|
1dad7a6 |
BuildRequires: golang(github.com/google/shlex)
|
|
|
9b32d8b |
BuildRequires: golang(github.com/inhies/go-bytesize)
|
|
|
b34ba92 |
BuildRequires: golang(github.com/marcinbor85/gohex)
|
|
|
bf7dd9c |
BuildRequires: golang(github.com/mattn/go-colorable) >= 0.1.8
|
|
|
9b32d8b |
BuildRequires: golang(github.com/mattn/go-tty) >= 0.0.4
|
|
|
8180175 |
BuildRequires: golang(github.com/sigurn/crc16)
|
|
|
4d6d12d |
BuildRequires: golang(go.bug.st/serial) >= 1.6.0
|
|
|
b34ba92 |
BuildRequires: golang(golang.org/x/tools/go/ast/astutil)
|
|
|
1539b44 |
BuildRequires: golang(golang.org/x/tools/go/ssa) >= 0.11
|
|
|
41a0389 |
BuildRequires: golang(gopkg.in/yaml.v2) >= 2.4.0
|
|
|
b34ba92 |
BuildRequires: golang(tinygo.org/x/go-llvm)
|
|
|
41a0389 |
BuildRequires: golang-tests
|
|
|
52b73ed |
BuildRequires: llvm-devel(major) = %{clang_llvm_version}
|
|
|
52b73ed |
BuildRequires: make
|
|
|
b34ba92 |
|
|
|
33d138a |
BuildRequires: binaryen >= 102
|
|
|
b34ba92 |
# We don't have glibc for arm, so skip these.
|
|
|
b34ba92 |
#BuildRequires: gcc-arm-linux-gnu
|
|
|
b34ba92 |
#BuildRequires: gcc-aarch64-linux-gnu
|
|
|
b34ba92 |
BuildRequires: lld
|
|
|
35a3896 |
# BuildRequires: mingw64-crt
|
|
|
35a3896 |
# BuildRequires: mingw64-headers
|
|
|
b34ba92 |
BuildRequires: nodejs
|
|
|
b34ba92 |
BuildRequires: qemu-system-arm-core
|
|
|
33d138a |
BuildRequires: qemu-system-riscv-core
|
|
|
33d138a |
BuildRequires: qemu-user
|
|
|
33d138a |
|
|
|
33d138a |
# For GPG signature verification
|
|
|
33d138a |
BuildRequires: gnupg2
|
|
|
b34ba92 |
|
|
|
41a0389 |
Requires: clang
|
|
|
b34ba92 |
Requires: golang
|
|
|
b34ba92 |
Requires: lld
|
|
|
bd124d1 |
# Add this when LLVM supports ESP natively.
|
|
|
bd124d1 |
# Recommends: esptool
|
|
|
35a3896 |
# Recommends: mingw64-crt
|
|
|
35a3896 |
# Recommends: mingw64-headers
|
|
|
b34ba92 |
Recommends: qemu-system-arm-core
|
|
|
33d138a |
Recommends: qemu-system-riscv-core
|
|
|
33d138a |
Recommends: qemu-user
|
|
|
b34ba92 |
|
|
|
b12ac02 |
# Make note of bundled libc's
|
|
|
b12ac02 |
Provides: bundled(compiler-rt) = %{compiler_rt_version}
|
|
|
b12ac02 |
Provides: bundled(musl) = %{musl_version}
|
|
|
b12ac02 |
Provides: bundled(picolibc) = %{picolibc_commit}
|
|
|
b12ac02 |
Provides: bundled(wasi-libc) = %{wasi_libc_commit}
|
|
|
b12ac02 |
|
|
|
b34ba92 |
%description
|
|
|
b34ba92 |
%{common_description}
|
|
|
b34ba92 |
|
|
|
b34ba92 |
#gopkg
|
|
|
b34ba92 |
|
|
|
b34ba92 |
|
|
|
b34ba92 |
%prep
|
|
|
b34ba92 |
%goprep
|
|
|
33d138a |
%autopatch -p1
|
|
|
b34ba92 |
|
|
|
b34ba92 |
tar -C lib -xf %{SOURCE2}
|
|
|
b34ba92 |
rmdir lib/CMSIS
|
|
|
b34ba92 |
mv lib/CMSIS-%{CMSIS_commit} lib/CMSIS
|
|
|
b34ba92 |
|
|
|
b34ba92 |
tar -C lib -xf %{SOURCE3}
|
|
|
b34ba92 |
rmdir lib/avr
|
|
|
b34ba92 |
mv lib/avr-mcu-%{avr_commit} lib/avr
|
|
|
b34ba92 |
|
|
|
b34ba92 |
tar -C lib -xf %{SOURCE4}
|
|
|
b34ba92 |
rmdir lib/cmsis-svd
|
|
|
b34ba92 |
mv lib/cmsis-svd-%{cmsis_svd_commit} lib/cmsis-svd
|
|
|
b34ba92 |
|
|
|
b22e370 |
# Verify *before* actually unpacking!
|
|
|
b22e370 |
%{gpgverify} --keyring='%{SOURCE52}' --signature='%{SOURCE51}' --data='%{SOURCE50}'
|
|
|
b22e370 |
tar -C lib -xf %{SOURCE50}
|
|
|
b22e370 |
mv lib/compiler-rt-%{compiler_rt_version}.src/lib/builtins lib/compiler-rt-builtins
|
|
|
b22e370 |
mv lib/compiler-rt-%{compiler_rt_version}.src/README.txt lib/compiler-rt-builtins/
|
|
|
b22e370 |
mv lib/compiler-rt-%{compiler_rt_version}.src/LICENSE.TXT lib/compiler-rt-builtins/
|
|
|
b34ba92 |
|
|
|
33d138a |
# Verify *before* actually unpacking!
|
|
|
33d138a |
%{gpgverify} --keyring='%{SOURCE62}' --signature='%{SOURCE61}' --data='%{SOURCE60}'
|
|
|
33d138a |
tar -C lib -xf %{SOURCE60}
|
|
|
33d138a |
rmdir lib/musl
|
|
|
33d138a |
mv lib/musl-%{musl_version} lib/musl
|
|
|
33d138a |
|
|
|
33d138a |
tar -C lib -xf %{SOURCE7}
|
|
|
b22e370 |
rmdir lib/macos-minimal-sdk
|
|
|
b22e370 |
mv lib/macos-minimal-sdk-%{macos_minsdk_commit} lib/macos-minimal-sdk
|
|
|
b22e370 |
|
|
|
b22e370 |
tar -C lib -xf %{SOURCE8}
|
|
|
b34ba92 |
rmdir lib/nrfx
|
|
|
b34ba92 |
mv lib/nrfx-%{nrfx_commit} lib/nrfx
|
|
|
b34ba92 |
rm lib/nrfx/.gitignore
|
|
|
b34ba92 |
chmod -x lib/nrfx/doc/generate_html_doc.sh
|
|
|
b34ba92 |
|
|
|
b22e370 |
tar -C lib -xf %{SOURCE9}
|
|
|
f7d3f8d |
rmdir lib/picolibc
|
|
|
f7d3f8d |
mv lib/picolibc-%{picolibc_commit} lib/picolibc
|
|
|
f7d3f8d |
|
|
|
b22e370 |
tar -C lib -xf %{SOURCE10}
|
|
|
5e83ee0 |
rmdir lib/wasi-libc
|
|
|
5e83ee0 |
mv lib/wasi-libc-%{wasi_libc_commit} lib/wasi-libc
|
|
|
5e83ee0 |
|
|
|
35a3896 |
tar -C lib -xf %{SOURCE11}
|
|
|
35a3896 |
rmdir lib/mingw-w64
|
|
|
35a3896 |
mv lib/mingw-w64-%{mingw64_commit} lib/mingw-w64
|
|
|
35a3896 |
|
|
|
b34ba92 |
%build
|
|
|
52b73ed |
# Use only GOBUILDTAGS when https://pagure.io/go-rpm-macros/pull-request/34 is
|
|
|
52b73ed |
# merged and released.
|
|
|
52b73ed |
export BUILDTAGS="llvm%{clang_llvm_version}" LDFLAGS="-X github.com/tinygo-org/tinygo/goenv.TINYGOROOT=%{tinygoroot} "
|
|
|
b34ba92 |
%gobuild -o %{gobuilddir}/bin/tinygo %{goipath}
|
|
|
bf7dd9c |
GO111MODULE=off %make_build gen-device STM32=0
|
|
|
41a0389 |
for target in thumbv6m-unknown-unknown-eabi-cortex-m0 thumbv6m-unknown-unknown-eabi-cortex-m0plus thumbv7em-unknown-unknown-eabi-cortex-m4; do
|
|
|
33d138a |
mkdir -p ${target}
|
|
|
f7d3f8d |
for libc in compiler-rt picolibc; do
|
|
|
f7d3f8d |
TINYGOROOT=$PWD \
|
|
|
f7d3f8d |
%{gobuilddir}/bin/tinygo \
|
|
|
41a0389 |
build-library -target=${target#*eabi-} -o ${target}/${libc} ${libc}
|
|
|
e3dd63f |
chmod -R a+rX ${target}/${libc}
|
|
|
f7d3f8d |
done
|
|
|
b34ba92 |
done
|
|
|
52b73ed |
%make_build wasi-libc CLANG=clang-%{clang_llvm_version} LLVM_AR=llvm-ar LLVM_NM=llvm-nm
|
|
|
b34ba92 |
|
|
|
b34ba92 |
|
|
|
b34ba92 |
%install
|
|
|
b34ba92 |
#gopkginstall
|
|
|
b34ba92 |
install -vdm 0755 %{buildroot}%{_bindir}
|
|
|
b34ba92 |
install -vpm 0755 %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
|
|
|
b34ba92 |
|
|
|
b34ba92 |
install -vdm 0755 %{buildroot}%{tinygoroot}
|
|
|
b34ba92 |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib
|
|
|
b34ba92 |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/CMSIS
|
|
|
b34ba92 |
install -vpm 0644 lib/CMSIS/README.md %{buildroot}%{tinygoroot}/lib/CMSIS/
|
|
|
b34ba92 |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/CMSIS/CMSIS/Include
|
|
|
b34ba92 |
install -vpm 0644 lib/CMSIS/CMSIS/Include/* %{buildroot}%{tinygoroot}/lib/CMSIS/CMSIS/Include/
|
|
|
b22e370 |
cp -rp lib/compiler-rt-builtins %{buildroot}%{tinygoroot}/lib
|
|
|
b22e370 |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/macos-minimal-sdk
|
|
|
b22e370 |
cp -rp lib/macos-minimal-sdk/* %{buildroot}%{tinygoroot}/lib/macos-minimal-sdk
|
|
|
35a3896 |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common
|
|
|
35a3896 |
cp -rp lib/mingw-w64/mingw-w64-crt/def-include %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt
|
|
|
35a3896 |
cp -rp lib/mingw-w64/mingw-w64-crt/lib-common/api-ms-win-crt-* %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common
|
|
|
35a3896 |
cp -rp lib/mingw-w64/mingw-w64-crt/lib-common/kernel32.def.in %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common
|
|
|
35a3896 |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-headers/defaults
|
|
|
35a3896 |
cp -rp lib/mingw-w64/mingw-w64-headers/crt/ %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-headers
|
|
|
35a3896 |
cp -rp lib/mingw-w64/mingw-w64-headers/defaults/include %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-headers/defaults
|
|
|
33d138a |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/musl
|
|
|
33d138a |
cp -rp lib/musl/COPYRIGHT %{buildroot}%{tinygoroot}/lib/musl
|
|
|
33d138a |
cp -rp lib/musl/include %{buildroot}%{tinygoroot}/lib/musl
|
|
|
33d138a |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/musl/arch
|
|
|
33d138a |
cp -rp lib/musl/arch/aarch64 %{buildroot}%{tinygoroot}/lib/musl/arch
|
|
|
33d138a |
cp -rp lib/musl/arch/arm %{buildroot}%{tinygoroot}/lib/musl/arch
|
|
|
33d138a |
cp -rp lib/musl/arch/generic %{buildroot}%{tinygoroot}/lib/musl/arch
|
|
|
33d138a |
cp -rp lib/musl/arch/i386 %{buildroot}%{tinygoroot}/lib/musl/arch
|
|
|
33d138a |
cp -rp lib/musl/arch/x86_64 %{buildroot}%{tinygoroot}/lib/musl/arch
|
|
|
33d138a |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/musl/crt
|
|
|
33d138a |
cp -rp lib/musl/crt/crt1.c %{buildroot}%{tinygoroot}/lib/musl/crt
|
|
|
33d138a |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/env %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/errno %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/exit %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/include %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/internal %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
544baed |
cp -rp lib/musl/src/legacy %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/malloc %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/mman %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
9b32d8b |
cp -rp lib/musl/src/math %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/signal %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/stdio %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/string %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/thread %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/time %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
33d138a |
cp -rp lib/musl/src/unistd %{buildroot}%{tinygoroot}/lib/musl/src
|
|
|
b34ba92 |
cp -rp lib/nrfx %{buildroot}%{tinygoroot}/lib/
|
|
|
5e83ee0 |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc
|
|
|
5e83ee0 |
cp -rp lib/wasi-libc/sysroot %{buildroot}%{tinygoroot}/lib/wasi-libc/
|
|
|
f7d3f8d |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc
|
|
|
f7d3f8d |
cp -rp lib/picolibc/newlib/libc/ctype %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc
|
|
|
e3dd63f |
chmod -x %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc/ctype/{mkcaseconv,mkcategories,mkunidata}
|
|
|
f7d3f8d |
cp -rp lib/picolibc/newlib/libc/include %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc
|
|
|
f7d3f8d |
cp -rp lib/picolibc/newlib/libc/locale %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc
|
|
|
f7d3f8d |
cp -rp lib/picolibc/newlib/libc/string %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc
|
|
|
e3dd63f |
chmod -x %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc/string/{mkunidata,mkwide,mkwidthA,uniset}
|
|
|
f7d3f8d |
cp -rp lib/picolibc/newlib/libc/tinystdio %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc
|
|
|
e3dd63f |
chmod -x %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc/tinystdio/make-dtoa-data
|
|
|
33d138a |
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libm
|
|
|
33d138a |
cp -rp lib/picolibc/newlib/libm/common %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libm
|
|
|
9b32d8b |
cp -rp lib/picolibc/newlib/libm/math %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libm
|
|
|
33d138a |
cp -rp lib/picolibc-stdio.c %{buildroot}%{tinygoroot}/lib
|
|
|
b34ba92 |
install -vdm 0755 %{buildroot}%{tinygoroot}/pkg
|
|
|
41a0389 |
for target in thumbv6m-unknown-unknown-eabi-cortex-m0 thumbv6m-unknown-unknown-eabi-cortex-m0plus thumbv7em-unknown-unknown-eabi-cortex-m4; do
|
|
|
33d138a |
install -vdm 0755 %{buildroot}%{tinygoroot}/pkg/${target}
|
|
|
f7d3f8d |
for libc in compiler-rt picolibc; do
|
|
|
33d138a |
cp -rp ${target}/${libc} %{buildroot}%{tinygoroot}/pkg/${target}/
|
|
|
f7d3f8d |
done
|
|
|
b34ba92 |
done
|
|
|
b34ba92 |
cp -rp src %{buildroot}%{tinygoroot}/
|
|
|
5986fe1 |
rm %{buildroot}%{tinygoroot}/src/examples/wasm/.gitignore
|
|
|
b34ba92 |
cp -rp targets %{buildroot}%{tinygoroot}/
|
|
|
b34ba92 |
|
|
|
b34ba92 |
|
|
|
b34ba92 |
%if %{with check}
|
|
|
33d138a |
%global gotestflags %gocompilerflags -v -tags="llvm%{clang_llvm_version}"
|
|
|
b34ba92 |
%check
|
|
|
b34ba92 |
export TINYGOROOT=%{buildroot}%{tinygoroot}
|
|
|
eeea62b |
export GOPATH=%{buildroot}%{tinygoroot}:%{gopath}
|
|
|
eeea62b |
export PATH=%{buildroot}%{_bindir}:$PATH
|
|
|
eeea62b |
export GO111MODULE=off
|
|
|
33d138a |
export XDG_CACHE_HOME="${PWD}/$(mktemp -d tinygo.XXXXXX)"
|
|
|
174a446 |
%gocheck -v -t src -t tests
|
|
|
5756d01 |
( cd _build/src/%{goipath} && GOPATH=%{currentgosourcedir}/_build:$GOPATH make smoketest STM32=0 XTENSA=0 )
|
|
|
b2c23a4 |
%ifnarch aarch64
|
|
|
eeea62b |
make wasmtest
|
|
|
b34ba92 |
%endif
|
|
|
544baed |
make tinygo-test
|
|
|
41a0389 |
%endif
|
|
|
b34ba92 |
|
|
|
b34ba92 |
|
|
|
b34ba92 |
%files
|
|
|
b34ba92 |
%doc README.md CHANGELOG.md CONTRIBUTING.md
|
|
|
b34ba92 |
%license LICENSE
|
|
|
b34ba92 |
%{_bindir}/tinygo
|
|
|
b34ba92 |
%{tinygoroot}
|
|
|
b34ba92 |
%doc %{tinygoroot}/lib/CMSIS/README.md
|
|
|
b22e370 |
%license %{tinygoroot}/lib/compiler-rt-builtins/LICENSE.TXT
|
|
|
b22e370 |
%doc %{tinygoroot}/lib/compiler-rt-builtins/README.txt
|
|
|
b34ba92 |
%license %{tinygoroot}/lib/nrfx/LICENSE
|
|
|
b34ba92 |
%doc %{tinygoroot}/lib/nrfx/README.md
|
|
|
33d138a |
%license %{tinygoroot}/lib/musl/COPYRIGHT
|
|
|
b34ba92 |
|
|
|
b34ba92 |
#gopkgfiles
|
|
|
b34ba92 |
|
|
|
b34ba92 |
|
|
|
b34ba92 |
%changelog
|
|
|
dfb60b5 |
%autochangelog
|