The package rpms/tinygo.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/tinygo.git/commit/?id=6e6ed23b9b9....
Change:
+ExcludeArch: %{ix86} armv7hl ppc64le s390x
Thanks.
Full change:
============
commit d40e6a24019a7713dbd1ab363c660742b90e7ac1
Author: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
Date: Sun Jul 14 04:42:24 2019 -0400
Reduce to older Go macros.
diff --git a/tinygo.spec b/tinygo.spec
index 1d45f4d..6619fba 100644
--- a/tinygo.spec
+++ b/tinygo.spec
@@ -23,10 +23,6 @@ Version: 0.6.0
Go compiler for small places. Microcontrollers, WebAssembly, and command-line
tools. Based on LLVM.}
-#global godocs CHANGELOG.md BUILDING.md CONTRIBUTING.md README.md
-#global golicenses LICENSE LICENSE.TXT
-#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}
-
Name: tinygo
Release: 1%{?dist}
Summary: Go compiler for small places
@@ -80,11 +76,9 @@ Recommends: qemu-system-arm-core
%description
%{common_description}
-#gopkg
-
%prep
-%goprep
+%forgesetup
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
@@ -117,19 +111,19 @@ ln -s /usr/lib64/clang/%{clang_version}/include lib/clang/include
%build
-%gobuild -o %{gobuilddir}/bin/tinygo %{goipath}
+%gobuildroot
+%gobuild -o _bin/tinygo %{goipath}
GO111MODULE=off make gen-device
for target in armv6m-none-eabi armv7m-none-eabi armv7em-none-eabi; do
TINYGOROOT=$PWD \
- %{gobuilddir}/bin/tinygo \
+ _bin/tinygo \
build-builtins -target=$target -o ${target}-compiler-rt.a
done
%install
-#gopkginstall
install -vdm 0755 %{buildroot}%{_bindir}
-install -vpm 0755 %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
+install -vpm 0755 _bin/* %{buildroot}%{_bindir}/
install -vdm 0755 %{buildroot}%{tinygoroot}
install -vdm 0755 %{buildroot}%{tinygoroot}/lib
@@ -161,7 +155,7 @@ export GOPATH=%{buildroot}%{tinygoroot}
# Fedora LLVM doesn't support AVR yet, so don't run full suite.
#
https://bugzilla.redhat.com/show_bug.cgi?id=1718492
PATH=%{buildroot}%{_bindir}:$PATH make smoketest-no-avr
-%gocheck -v
+%gochecks
%endif
@@ -176,7 +170,6 @@ PATH=%{buildroot}%{_bindir}:$PATH make smoketest-no-avr
%license %{tinygoroot}/lib/nrfx/LICENSE
%doc %{tinygoroot}/lib/nrfx/README.md
-#gopkgfiles
%changelog
commit 6e6ed23b9b9b935dd3819733b288574b2b191dfb
Author: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
Date: Sun Jul 14 00:31:46 2019 -0400
Disable some unsupported architectures.
diff --git a/tinygo.spec b/tinygo.spec
index 1860256..1d45f4d 100644
--- a/tinygo.spec
+++ b/tinygo.spec
@@ -54,6 +54,9 @@ Patch0003: 0003-Skip-ARM-Linux-tests.patch
# We can't include STM32 .svd files because of their weird license.
Patch0004: 0004-Skip-STM32-tests.patch
+# Not supported upstream yet.
+ExcludeArch: %{ix86} armv7hl ppc64le s390x
+
BuildRequires: clang-devel = %{clang_version}
BuildRequires:
golang(github.com/blakesmith/ar)
BuildRequires:
golang(github.com/marcinbor85/gohex)
commit b34ba92bba95db29ae67c504286f16f38ffa6418
Author: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
Date: Sat Jul 13 04:11:31 2019 -0400
Initial import (#1720563).
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6e8e11d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+/avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz
+/cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz
+/cmsis_svd-b6f0a65ac37760f52d6ade23dd3205424d6c91fa-clean.tar.xz
+/compiler-rt-8.0.0.src.tar.xz
+/nrfx-3ab39a9d457bfe627473ed0e03a7f1161d9e4f27.tar.gz
+/tinygo-0.6.0.tar.gz
diff --git a/0001-Use-system-path-for-TINYGOROOT-default.patch
b/0001-Use-system-path-for-TINYGOROOT-default.patch
new file mode 100644
index 0000000..f164ab2
--- /dev/null
+++ b/0001-Use-system-path-for-TINYGOROOT-default.patch
@@ -0,0 +1,41 @@
+From 812286161dae5d09d4c2e1e30d334abbe67dac6c Mon Sep 17 00:00:00 2001
+From: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
+Date: Fri, 7 Jun 2019 20:53:54 -0400
+Subject: [PATCH 1/4] Use system path for TINYGOROOT default.
+
+Signed-off-by: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
+---
+ target.go | 17 ++---------------
+ 1 file changed, 2 insertions(+), 15 deletions(-)
+
+diff --git a/target.go b/target.go
+index c389b65..c03edfb 100644
+--- a/target.go
++++ b/target.go
+@@ -258,21 +258,8 @@ func sourceDir() string {
+ return root
+ }
+
+- // Find root from executable path.
+- path, err := os.Executable()
+- if err != nil {
+- // Very unlikely. Bail out if it happens.
+- panic("could not get executable path: " + err.Error())
+- }
+- root = filepath.Dir(filepath.Dir(path))
+- if isSourceDir(root) {
+- return root
+- }
+-
+- // Fallback: use the original directory from where it was built
+- //
https://stackoverflow.com/a/32163888/559350
+- _, path, _, _ = runtime.Caller(0)
+- root = filepath.Dir(path)
++ // Use system directory
++ root = "/usr/share/tinygo"
+ if isSourceDir(root) {
+ return root
+ }
+--
+2.21.0
+
diff --git a/0002-Use-Fedora-command-names.patch b/0002-Use-Fedora-command-names.patch
new file mode 100644
index 0000000..5f8c75d
--- /dev/null
+++ b/0002-Use-Fedora-command-names.patch
@@ -0,0 +1,53 @@
+From 686aa54166a04d9f88b7e7c2443136421059739a Mon Sep 17 00:00:00 2001
+From: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
+Date: Fri, 7 Jun 2019 20:55:25 -0400
+Subject: [PATCH 2/4] Use Fedora command names.
+
+Signed-off-by: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
+---
+ main_test.go | 2 +-
+ target.go | 8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/main_test.go b/main_test.go
+index fa85a82..f0d403c 100644
+--- a/main_test.go
++++ b/main_test.go
+@@ -70,7 +70,7 @@ func TestCompiler(t *testing.T) {
+ continue // TODO: improve CGo
+ }
+ t.Run(path, func(t *testing.T) {
+- runTest(path, tmpdir, "arm--linux-gnueabihf", t)
++ runTest(path, tmpdir, "arm--linux-none", t)
+ })
+ }
+
+diff --git a/target.go b/target.go
+index c03edfb..ae6d507 100644
+--- a/target.go
++++ b/target.go
+@@ -164,7 +164,7 @@ func LoadTarget(target string) (*TargetSpec, error) {
+ }
+ target = llvmarch + "--" + llvmos
+ if goarch == "arm" {
+- target += "-gnueabihf"
++ target += "-none"
+ }
+ return defaultTarget(goos, goarch, target)
+ }
+@@ -229,9 +229,9 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error)
{
+ if goarch != runtime.GOARCH {
+ // Some educated guesses as to how to invoke helper programs.
+ if goarch == "arm" && goos == "linux" {
+- spec.Linker = "arm-linux-gnueabihf-gcc"
+- spec.GDB = "arm-linux-gnueabihf-gdb"
+- spec.Emulator = []string{"qemu-arm", "-L",
"/usr/arm-linux-gnueabihf"}
++ spec.Linker = "arm-linux-gnu-gcc"
++ spec.GDB = "arm-linux-gnu-gdb"
++ spec.Emulator = []string{"qemu-arm", "-L",
"/usr/arm-linux-none"}
+ }
+ if goarch == "arm64" && goos == "linux" {
+ spec.Linker = "aarch64-linux-gnu-gcc"
+--
+2.21.0
+
diff --git a/0003-Skip-ARM-Linux-tests.patch b/0003-Skip-ARM-Linux-tests.patch
new file mode 100644
index 0000000..3c87bfe
--- /dev/null
+++ b/0003-Skip-ARM-Linux-tests.patch
@@ -0,0 +1,39 @@
+From c949e0e97fcb8716a7848bee3ef4c97123ac78ea Mon Sep 17 00:00:00 2001
+From: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
+Date: Wed, 12 Jun 2019 04:28:55 -0400
+Subject: [PATCH 3/4] Skip ARM Linux tests.
+
+We don't have the C library to do this.
+
+Signed-off-by: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
+---
+ main_test.go | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/main_test.go b/main_test.go
+index f0d403c..0f28752 100644
+--- a/main_test.go
++++ b/main_test.go
+@@ -66,6 +66,9 @@ func TestCompiler(t *testing.T) {
+ if runtime.GOOS == "linux" {
+ t.Log("running tests for linux/arm...")
+ for _, path := range matches {
++ if true {
++ continue
++ }
+ if path == filepath.Join("testdata",
"cgo")+string(filepath.Separator) {
+ continue // TODO: improve CGo
+ }
+@@ -76,6 +79,9 @@ func TestCompiler(t *testing.T) {
+
+ t.Log("running tests for linux/arm64...")
+ for _, path := range matches {
++ if true {
++ continue
++ }
+ if path == filepath.Join("testdata",
"cgo")+string(filepath.Separator) {
+ continue // TODO: improve CGo
+ }
+--
+2.21.0
+
diff --git a/0004-Skip-STM32-tests.patch b/0004-Skip-STM32-tests.patch
new file mode 100644
index 0000000..61ef708
--- /dev/null
+++ b/0004-Skip-STM32-tests.patch
@@ -0,0 +1,45 @@
+From 2d57ab4c61330aad4b7b8e8adc7a4587a02cc36d Mon Sep 17 00:00:00 2001
+From: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
+Date: Thu, 13 Jun 2019 02:50:40 -0400
+Subject: [PATCH 4/4] Skip STM32 tests.
+
+We can't ship the STM32 .svd files due to their odd license.
+
+Signed-off-by: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
+---
+ Makefile | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index aec8458..1347550 100644
+--- a/Makefile
++++ b/Makefile
+@@ -38,7 +38,7 @@ fmt:
+ fmt-check:
+ @unformatted=$$(gofmt -l $(FMT_PATHS)); [ -z "$$unformatted" ] &&
exit 0; echo "Unformatted:"; for fn in $$unformatted; do echo "
$$fn"; done; exit 1
+
+-gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-stm32
++gen-device: gen-device-avr gen-device-nrf gen-device-sam
+
+ gen-device-avr:
+ ./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/
+@@ -108,7 +108,6 @@ smoketest-no-avr:
+ tinygo build -size short -o test.elf -target=microbit examples/echo
+ tinygo build -size short -o test.elf -target=nrf52840-mdk examples/blinky1
+ tinygo build -size short -o test.elf -target=pca10031 examples/blinky1
+- tinygo build -size short -o test.elf -target=bluepill examples/blinky1
+ tinygo build -size short -o test.elf -target=reelboard examples/blinky1
+ tinygo build -size short -o test.elf -target=reelboard examples/blinky2
+ tinygo build -size short -o test.elf -target=pca10056 examples/blinky1
+@@ -117,8 +116,6 @@ smoketest-no-avr:
+ tinygo build -size short -o test.elf -target=feather-m0 examples/blinky1
+ tinygo build -size short -o test.elf -target=trinket-m0 examples/blinky1
+ tinygo build -size short -o test.elf -target=circuitplay-express examples/blinky1
+- tinygo build -size short -o test.elf -target=stm32f4disco examples/blinky1
+- tinygo build -size short -o test.elf -target=stm32f4disco examples/blinky2
+ tinygo build -size short -o test.elf -target=circuitplay-express examples/i2s
+ tinygo build -o wasm.wasm -target=wasm examples/wasm/export
+ tinygo build -o wasm.wasm -target=wasm examples/wasm/main
+--
+2.21.0
+
diff --git a/clean_tarballs.sh b/clean_tarballs.sh
new file mode 100755
index 0000000..734a239
--- /dev/null
+++ b/clean_tarballs.sh
@@ -0,0 +1,24 @@
+#!/bin/bash -xe
+
+CMSIS_VERSION=9fe411cef1cef5de58e5957b89760759de44e393
+CMSIS_SVD_VERSION=b6f0a65ac37760f52d6ade23dd3205424d6c91fa
+
+# The license for this tarball is complicated, but the headers are under a
+# simple BSD license, so we only package them.
+wget
https://github.com/ARM-software/CMSIS/archive/${CMSIS_VERSION}/cmsis-${CM...
+tar xf cmsis-${CMSIS_VERSION}.tar.gz
+tar cJf cmsis-${CMSIS_VERSION}-clean.tar.xz \
+ CMSIS-${CMSIS_VERSION}/README.md \
+ CMSIS-${CMSIS_VERSION}/CMSIS/Include/
+rm -r CMSIS-${CMSIS_VERSION}/
+
+# This is basically a "collection of random stuff" from various vendors, under
+# various licenses. Some licenses are non-free and some are actively hostile,
+# but we only need a rather small portion under a good license.
+wget
https://github.com/posborne/cmsis-svd/archive/${CMSIS_SVD_VERSION}/cmsis_...
+tar xf cmsis_svd-${CMSIS_SVD_VERSION}.tar.gz
+tar cJf cmsis_svd-${CMSIS_SVD_VERSION}-clean.tar.xz \
+ cmsis-svd-${CMSIS_SVD_VERSION}/data/Atmel/ \
+ # This has a weird license, so we cannot include it.
+ # cmsis-svd-${CMSIS_SVD_VERSION}/data/STMicro/
+rm -r cmsis_svd-${CMSIS_SVD_VERSION}/
diff --git a/sources b/sources
new file mode 100644
index 0000000..5758352
--- /dev/null
+++ b/sources
@@ -0,0 +1,6 @@
+SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) =
1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29
+SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) =
f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9
+SHA512 (cmsis_svd-b6f0a65ac37760f52d6ade23dd3205424d6c91fa-clean.tar.xz) =
95b44b09a7d59423757d9c4fbede6c7e50c5ee45908706f675dc19e21784ec4ba241e611de9d9a3bb734b4f8c6d0a6c6d7ba61c15e6b7ba6dc3b490dcb9edc79
+SHA512 (compiler-rt-8.0.0.src.tar.xz) =
fe9f69fe2269fa3d560ae97fdacd462f855fb0b7a5f647f5b8595206ff7febca6496725adc953de411a827c761e2b3ca11a2149f25707d6c62af0722b68ba913
+SHA512 (nrfx-3ab39a9d457bfe627473ed0e03a7f1161d9e4f27.tar.gz) =
95b5293c9b707aeb4d8ad13643619c053ba0fa9423053a12f9a65b0ed8febc2aab87cd832e6ac73e9673987b7cb73f85cce68cb85ce4ca5bd607afee1098f9e9
+SHA512 (tinygo-0.6.0.tar.gz) =
7334f8cf630db03a5554829f0f12caaeec9ece3c95a2ea6a53bd079c1b30abe15b8bbf06604ca3141ab48ce4613f2a83d2887eb733288a88b3c008d1258b8325
diff --git a/tinygo.spec b/tinygo.spec
new file mode 100644
index 0000000..1860256
--- /dev/null
+++ b/tinygo.spec
@@ -0,0 +1,181 @@
+# Generated by go2rpm
+%bcond_without check
+
+%global __brp_strip_static_archive %{nil}
+
+#
https://github.com/tinygo-org/tinygo
+%global goipath
github.com/tinygo-org/tinygo
+Version: 0.6.0
+
+%global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393
+%global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228
+%global clang_version 8.0.0
+%global cmsis_svd_commit b6f0a65ac37760f52d6ade23dd3205424d6c91fa
+%global compiler_rt_version 8.0.0
+%global nrfx_commit 3ab39a9d457bfe627473ed0e03a7f1161d9e4f27
+
+# To match regular Go's /usr/share/gocode
+%global tinygoroot %{_prefix}/share/tinygo
+
+%gometa
+
+%global common_description %{expand:
+Go compiler for small places. Microcontrollers, WebAssembly, and command-line
+tools. Based on LLVM.}
+
+#global godocs CHANGELOG.md BUILDING.md CONTRIBUTING.md README.md
+#global golicenses LICENSE LICENSE.TXT
+#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}
+
+Name: tinygo
+Release: 1%{?dist}
+Summary: Go compiler for small places
+
+# Main files: BSD
+# CMSIS: BSD (subsetted)
+# avr-mcu: ASL 2.0 (packs) and MIT (Rust code, unused by this package)
+# cmsis-svd: ASL 2.0 (subsetted)
+# compiler-rt: NCSA or MIT
+# nrfx: BSD and ASL 2.0
+License: BSD and MIT and (NCSA or MIT) and ASL 2.0
+URL: %{gourl}
+Source0: %{gosource}
+Source1: clean_tarballs.sh
+Source2: cmsis-%{CMSIS_commit}-clean.tar.xz
+Source3:
https://github.com/avr-rust/avr-mcu/archive/%{avr_commit}/avr-%{avr_commi...
+Source4: cmsis_svd-%{cmsis_svd_commit}-clean.tar.xz
+Source5:
https://releases.llvm.org/%{compiler_rt_version}/compiler-rt-%{compiler_r...
+Source6:
https://github.com/NordicSemiconductor/nrfx/archive/%{nrfx_commit}/nrfx-%...
+# Fedora-specific.
+Patch0001: 0001-Use-system-path-for-TINYGOROOT-default.patch
+Patch0002: 0002-Use-Fedora-command-names.patch
+# We don't have ARM glibc to build these.
+Patch0003: 0003-Skip-ARM-Linux-tests.patch
+# We can't include STM32 .svd files because of their weird license.
+Patch0004: 0004-Skip-STM32-tests.patch
+
+BuildRequires: clang-devel = %{clang_version}
+BuildRequires:
golang(github.com/blakesmith/ar)
+BuildRequires:
golang(github.com/marcinbor85/gohex)
+BuildRequires:
golang(golang.org/x/tools/go/ast/astutil)
+BuildRequires:
golang(golang.org/x/tools/go/ssa)
+BuildRequires:
golang(tinygo.org/x/go-llvm)
+
+# We don't have glibc for arm, so skip these.
+#BuildRequires: gcc-arm-linux-gnu
+#BuildRequires: gcc-aarch64-linux-gnu
+BuildRequires: lld
+BuildRequires: nodejs
+BuildRequires: qemu-system-arm-core
+
+Requires: clang-libs%{?isa} = %{clang_version}
+Requires: golang
+Requires: lld
+Recommends: clang
+Recommends: qemu-system-arm-core
+
+%description
+%{common_description}
+
+#gopkg
+
+
+%prep
+%goprep
+%patch0001 -p1
+%patch0002 -p1
+%patch0003 -p1
+%patch0004 -p1
+
+tar -C lib -xf %{SOURCE2}
+rmdir lib/CMSIS
+mv lib/CMSIS-%{CMSIS_commit} lib/CMSIS
+
+tar -C lib -xf %{SOURCE3}
+rmdir lib/avr
+mv lib/avr-mcu-%{avr_commit} lib/avr
+
+tar -C lib -xf %{SOURCE4}
+rmdir lib/cmsis-svd
+mv lib/cmsis-svd-%{cmsis_svd_commit} lib/cmsis-svd
+
+tar -C lib -xf %{SOURCE5}
+rmdir lib/compiler-rt
+mv lib/compiler-rt-%{compiler_rt_version}.src lib/compiler-rt
+
+tar -C lib -xf %{SOURCE6}
+rmdir lib/nrfx
+mv lib/nrfx-%{nrfx_commit} lib/nrfx
+rm lib/nrfx/.gitignore
+chmod -x lib/nrfx/doc/generate_html_doc.sh
+
+mkdir lib/clang
+ln -s /usr/lib64/clang/%{clang_version}/include lib/clang/include
+
+
+%build
+%gobuild -o %{gobuilddir}/bin/tinygo %{goipath}
+GO111MODULE=off make gen-device
+for target in armv6m-none-eabi armv7m-none-eabi armv7em-none-eabi; do
+ TINYGOROOT=$PWD \
+ %{gobuilddir}/bin/tinygo \
+ build-builtins -target=$target -o ${target}-compiler-rt.a
+done
+
+
+%install
+#gopkginstall
+install -vdm 0755 %{buildroot}%{_bindir}
+install -vpm 0755 %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
+
+install -vdm 0755 %{buildroot}%{tinygoroot}
+install -vdm 0755 %{buildroot}%{tinygoroot}/lib
+install -vdm 0755 %{buildroot}%{tinygoroot}/lib/CMSIS
+install -vpm 0644 lib/CMSIS/README.md %{buildroot}%{tinygoroot}/lib/CMSIS/
+install -vdm 0755 %{buildroot}%{tinygoroot}/lib/CMSIS/CMSIS/Include
+install -vpm 0644 lib/CMSIS/CMSIS/Include/*
%{buildroot}%{tinygoroot}/lib/CMSIS/CMSIS/Include/
+install -vdm 0755 %{buildroot}%{tinygoroot}/lib/clang
+cp -pP lib/clang/include %{buildroot}%{tinygoroot}/lib/clang/
+install -vdm 0755 %{buildroot}%{tinygoroot}/lib/compiler-rt
+install -vpm 0644 lib/compiler-rt/README.txt %{buildroot}%{tinygoroot}/lib/compiler-rt/
+install -vpm 0644 lib/compiler-rt/LICENSE.TXT %{buildroot}%{tinygoroot}/lib/compiler-rt/
+install -vdm 0755 %{buildroot}%{tinygoroot}/lib/compiler-rt/lib
+cp -rp lib/compiler-rt/lib/builtins %{buildroot}%{tinygoroot}/lib/compiler-rt/lib/
+cp -rp lib/nrfx %{buildroot}%{tinygoroot}/lib/
+install -vdm 0755 %{buildroot}%{tinygoroot}/pkg
+for target in armv6m-none-eabi armv7m-none-eabi armv7em-none-eabi; do
+ install -vdm 0755 %{buildroot}%{tinygoroot}/pkg/${target}
+ install -vpm 0644 ${target}-compiler-rt.a
%{buildroot}%{tinygoroot}/pkg/${target}/compiler-rt.a
+done
+cp -rp src %{buildroot}%{tinygoroot}/
+cp -rp targets %{buildroot}%{tinygoroot}/
+
+
+%if %{with check}
+%check
+export TINYGOROOT=%{buildroot}%{tinygoroot}
+export GOPATH=%{buildroot}%{tinygoroot}
+# Fedora LLVM doesn't support AVR yet, so don't run full suite.
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1718492
+PATH=%{buildroot}%{_bindir}:$PATH make smoketest-no-avr
+%gocheck -v
+%endif
+
+
+%files
+%doc README.md CHANGELOG.md CONTRIBUTING.md
+%license LICENSE
+%{_bindir}/tinygo
+%{tinygoroot}
+%doc %{tinygoroot}/lib/CMSIS/README.md
+%license %{tinygoroot}/lib/compiler-rt/LICENSE.TXT
+%doc %{tinygoroot}/lib/compiler-rt/README.txt
+%license %{tinygoroot}/lib/nrfx/LICENSE
+%doc %{tinygoroot}/lib/nrfx/README.md
+
+#gopkgfiles
+
+
+%changelog
+* Tue Jun 11 01:26:10 EDT 2019 Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
- 0.6.0-1
+- Initial package