Compare commits
10 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af7210d4df | ||
|
|
7466f18e04 | ||
|
|
0976ef17a7 | ||
|
|
a13f77fe54 | ||
|
|
6398141dc3 | ||
|
|
afb8a60cc7 | ||
|
|
e27e385162 | ||
|
|
9574d0d409 | ||
|
|
9e5f094cdb | ||
|
|
d40e6a2401 |
10 changed files with 166 additions and 133 deletions
15
.gitignore
vendored
15
.gitignore
vendored
|
|
@ -1,9 +1,12 @@
|
|||
/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
|
||||
/avr-*.tar.gz
|
||||
/cmsis-*.tar.gz
|
||||
/cmsis-*-clean.tar.xz
|
||||
/cmsis_svd-*.tar.gz
|
||||
/cmsis_svd-*-clean.tar.xz
|
||||
/compiler-rt-*.src.tar.xz
|
||||
/nrfx-*.tar.gz
|
||||
/tinygo-0.6.0.tar.gz
|
||||
/tinygo-0.7.0.tar.gz
|
||||
/cmsis_svd-5910f3d115a53ead55c8158da24a8fa8bda1eb50-clean.tar.xz
|
||||
/tinygo-0.7.1.tar.gz
|
||||
/tinygo-0.8.0.tar.gz
|
||||
/tinygo-0.9.0.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From ed1e9c66e17e2cf3bc2d21f04208f07a259ffc32 Mon Sep 17 00:00:00 2001
|
||||
From 2b6fe327a7a57a6a0c7740d81591ae0fa207b94d Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Fri, 7 Jun 2019 20:55:25 -0400
|
||||
Subject: [PATCH 2/4] Use Fedora command names.
|
||||
Subject: [PATCH 1/4] Use Fedora command names.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
|
|
@ -10,10 +10,10 @@ Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
|||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/main_test.go b/main_test.go
|
||||
index fa85a82..f0d403c 100644
|
||||
index f0a574b..c65c463 100644
|
||||
--- a/main_test.go
|
||||
+++ b/main_test.go
|
||||
@@ -70,7 +70,7 @@ func TestCompiler(t *testing.T) {
|
||||
@@ -72,7 +72,7 @@ func TestCompiler(t *testing.T) {
|
||||
continue // TODO: improve CGo
|
||||
}
|
||||
t.Run(path, func(t *testing.T) {
|
||||
|
|
@ -23,10 +23,10 @@ index fa85a82..f0d403c 100644
|
|||
}
|
||||
|
||||
diff --git a/target.go b/target.go
|
||||
index fc4589b..6c29ce8 100644
|
||||
index 655b5f2..e0c5e21 100644
|
||||
--- a/target.go
|
||||
+++ b/target.go
|
||||
@@ -173,7 +173,7 @@ func LoadTarget(target string) (*TargetSpec, error) {
|
||||
@@ -195,7 +195,7 @@ func LoadTarget(target string) (*TargetSpec, error) {
|
||||
}
|
||||
target = llvmarch + "--" + llvmos
|
||||
if goarch == "arm" {
|
||||
|
|
@ -35,7 +35,7 @@ index fc4589b..6c29ce8 100644
|
|||
}
|
||||
return defaultTarget(goos, goarch, target)
|
||||
}
|
||||
@@ -238,9 +238,9 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
|
||||
@@ -261,9 +261,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" {
|
||||
|
|
@ -49,5 +49,5 @@ index fc4589b..6c29ce8 100644
|
|||
if goarch == "arm64" && goos == "linux" {
|
||||
spec.Linker = "aarch64-linux-gnu-gcc"
|
||||
--
|
||||
2.21.0
|
||||
2.21.1
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From 76d5a1c269245c410458702997c72d64e53afdb3 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@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@gmail.com>
|
||||
---
|
||||
target.go | 17 ++---------------
|
||||
1 file changed, 2 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/target.go b/target.go
|
||||
index 679fa19..fc4589b 100644
|
||||
--- a/target.go
|
||||
+++ b/target.go
|
||||
@@ -267,21 +267,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
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
From 8e26941216ff2213ab396ba2bdfe06a370a77553 Mon Sep 17 00:00:00 2001
|
||||
From 4aef9745a245596f8f8781481f2d734318999074 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Wed, 12 Jun 2019 04:28:55 -0400
|
||||
Subject: [PATCH 3/4] Skip ARM Linux tests.
|
||||
Subject: [PATCH 2/4] Skip ARM Linux tests.
|
||||
|
||||
We don't have the C library to do this.
|
||||
|
||||
|
|
@ -11,10 +11,10 @@ Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
|||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/main_test.go b/main_test.go
|
||||
index f0d403c..0f28752 100644
|
||||
index c65c463..46bdbd1 100644
|
||||
--- a/main_test.go
|
||||
+++ b/main_test.go
|
||||
@@ -66,6 +66,9 @@ func TestCompiler(t *testing.T) {
|
||||
@@ -68,6 +68,9 @@ func TestCompiler(t *testing.T) {
|
||||
if runtime.GOOS == "linux" {
|
||||
t.Log("running tests for linux/arm...")
|
||||
for _, path := range matches {
|
||||
|
|
@ -24,7 +24,7 @@ index f0d403c..0f28752 100644
|
|||
if path == filepath.Join("testdata", "cgo")+string(filepath.Separator) {
|
||||
continue // TODO: improve CGo
|
||||
}
|
||||
@@ -76,6 +79,9 @@ func TestCompiler(t *testing.T) {
|
||||
@@ -78,6 +81,9 @@ func TestCompiler(t *testing.T) {
|
||||
|
||||
t.Log("running tests for linux/arm64...")
|
||||
for _, path := range matches {
|
||||
|
|
@ -35,5 +35,5 @@ index f0d403c..0f28752 100644
|
|||
continue // TODO: improve CGo
|
||||
}
|
||||
--
|
||||
2.21.0
|
||||
2.21.1
|
||||
|
||||
56
0003-Skip-STM32-tests.patch
Normal file
56
0003-Skip-STM32-tests.patch
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
From 6f7b79ef714cd974cf2a6758e4307fa2b45eb26b Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Thu, 13 Jun 2019 02:50:40 -0400
|
||||
Subject: [PATCH 3/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@gmail.com>
|
||||
---
|
||||
Makefile | 10 +---------
|
||||
1 file changed, 1 insertion(+), 9 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 7fc00df..73391f9 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -94,7 +94,7 @@ 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-sifive gen-device-stm32
|
||||
+gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive
|
||||
|
||||
gen-device-avr:
|
||||
$(PYTHON) ./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/
|
||||
@@ -181,8 +181,6 @@ smoketest:
|
||||
@$(MD5SUM) test.hex
|
||||
$(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1
|
||||
@$(MD5SUM) test.hex
|
||||
- $(TINYGO) build -size short -o test.hex -target=bluepill examples/blinky1
|
||||
- @$(MD5SUM) test.hex
|
||||
$(TINYGO) build -size short -o test.hex -target=reelboard examples/blinky1
|
||||
@$(MD5SUM) test.hex
|
||||
$(TINYGO) build -size short -o test.hex -target=reelboard examples/blinky2
|
||||
@@ -199,18 +197,12 @@ smoketest:
|
||||
@$(MD5SUM) test.hex
|
||||
$(TINYGO) build -size short -o test.hex -target=circuitplay-express examples/blinky1
|
||||
@$(MD5SUM) test.hex
|
||||
- $(TINYGO) build -size short -o test.hex -target=stm32f4disco examples/blinky1
|
||||
- @$(MD5SUM) test.hex
|
||||
- $(TINYGO) build -size short -o test.hex -target=stm32f4disco examples/blinky2
|
||||
- @$(MD5SUM) test.hex
|
||||
$(TINYGO) build -size short -o test.hex -target=circuitplay-express examples/i2s
|
||||
@$(MD5SUM) test.hex
|
||||
$(TINYGO) build -size short -o test.gba -target=gameboy-advance examples/gba-display
|
||||
@$(MD5SUM) test.gba
|
||||
$(TINYGO) build -size short -o test.hex -target=itsybitsy-m4 examples/blinky1
|
||||
@$(MD5SUM) test.hex
|
||||
- $(TINYGO) build -size short -o test.hex -target=nucleo-f103rb examples/blinky1
|
||||
- @$(MD5SUM) test.hex
|
||||
ifneq ($(AVR), 0)
|
||||
$(TINYGO) build -size short -o test.hex -target=arduino examples/blinky1
|
||||
@$(MD5SUM) test.hex
|
||||
--
|
||||
2.21.1
|
||||
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
From a49998a25be22a56f0f668b77b8994dc4d5987aa Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@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@gmail.com>
|
||||
---
|
||||
Makefile | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 239a2df..c8ece47 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -41,7 +41,7 @@ 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-sifive gen-device-stm32
|
||||
+gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive
|
||||
|
||||
gen-device-avr:
|
||||
./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/
|
||||
@@ -112,7 +112,6 @@ smoketest:
|
||||
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
|
||||
@@ -121,8 +120,6 @@ smoketest:
|
||||
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
|
||||
ifneq ($(AVR), 0)
|
||||
tinygo build -size short -o test.elf -target=arduino examples/blinky1
|
||||
--
|
||||
2.21.0
|
||||
|
||||
56
0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch
Normal file
56
0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
From 74f009b22143b731af1d4262e82e902ad9c5c2a0 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Mon, 10 Feb 2020 17:23:25 -0500
|
||||
Subject: [PATCH 4/4] Use go mod expected path for go.bug.st/serial.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
go.mod | 2 +-
|
||||
go.sum | 4 ++--
|
||||
main.go | 2 +-
|
||||
3 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/go.mod b/go.mod
|
||||
index 64668f6..cf33dd7 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -6,7 +6,7 @@ require (
|
||||
github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2
|
||||
github.com/creack/goselect v0.1.0 // indirect
|
||||
github.com/marcinbor85/gohex v0.0.0-20180128172054-7a43cd876e46
|
||||
- go.bug.st/serial.v1 v0.0.0-20180827123349-5f7892a7bb45
|
||||
+ go.bug.st/serial v0.0.0-20180827123349-5f7892a7bb45
|
||||
golang.org/x/sys v0.0.0-20191010194322-b09406accb47 // indirect
|
||||
golang.org/x/tools v0.0.0-20190227180812-8dcc6e70cdef
|
||||
tinygo.org/x/go-llvm v0.0.0-20190818154551-95bc4ffe1add
|
||||
diff --git a/go.sum b/go.sum
|
||||
index 341c3e5..0aaf2cd 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -5,8 +5,8 @@ github.com/creack/goselect v0.1.0/go.mod h1:gHrIcH/9UZDn2qgeTUeW5K9eZsVYCH6/60J/
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/marcinbor85/gohex v0.0.0-20180128172054-7a43cd876e46 h1:wXG2bA8fO7Vv7lLk2PihFMTqmbT173Tje39oKzQ50Mo=
|
||||
github.com/marcinbor85/gohex v0.0.0-20180128172054-7a43cd876e46/go.mod h1:Pb6XcsXyropB9LNHhnqaknG/vEwYztLkQzVCHv8sQ3M=
|
||||
-go.bug.st/serial.v1 v0.0.0-20180827123349-5f7892a7bb45 h1:mACY1anK6HNCZtm/DK2Rf2ZPHggVqeB0+7rY9Gl6wyI=
|
||||
-go.bug.st/serial.v1 v0.0.0-20180827123349-5f7892a7bb45/go.mod h1:dRSl/CVCTf56CkXgJMDOdSwNfo2g1orOGE/gBGdvjZw=
|
||||
+go.bug.st/serial v0.0.0-20180827123349-5f7892a7bb45 h1:mACY1anK6HNCZtm/DK2Rf2ZPHggVqeB0+7rY9Gl6wyI=
|
||||
+go.bug.st/serial v0.0.0-20180827123349-5f7892a7bb45/go.mod h1:dRSl/CVCTf56CkXgJMDOdSwNfo2g1orOGE/gBGdvjZw=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
diff --git a/main.go b/main.go
|
||||
index b35f63b..571959c 100644
|
||||
--- a/main.go
|
||||
+++ b/main.go
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"github.com/tinygo-org/tinygo/interp"
|
||||
"github.com/tinygo-org/tinygo/loader"
|
||||
|
||||
- serial "go.bug.st/serial.v1"
|
||||
+ "go.bug.st/serial"
|
||||
)
|
||||
|
||||
// commandError is an error type to wrap os/exec.Command errors. This provides
|
||||
--
|
||||
2.21.1
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
CMSIS_VERSION=9fe411cef1cef5de58e5957b89760759de44e393
|
||||
CMSIS_SVD_VERSION=5910f3d115a53ead55c8158da24a8fa8bda1eb50
|
||||
CMSIS_SVD_VERSION=7d9b4167010feed9e59ac45e56519180295b3813
|
||||
|
||||
if [ -e "cmsis-${CMSIS_VERSION}-clean.tar.xz" ]; then
|
||||
echo "Not downloading cmsis-${CMSIS_VERSION}-clean.tar.xz again!"
|
||||
|
|
|
|||
4
sources
4
sources
|
|
@ -1,6 +1,6 @@
|
|||
SHA512 (tinygo-0.7.1.tar.gz) = f97b0c3a6bd65bbc8c1ec41a8452fa88e0c6c4b8bbe3216ea25b8014d035a90847c5d1f219b9be9c5476a463e5a5da53128a8254498126ac1f6239959d95bace
|
||||
SHA512 (tinygo-0.9.0.tar.gz) = 864e7ab0ddf98d77e6b88da6412bed606cde55c3fa82607f79bcb75270d7449980ab6d8f7137c0617122b09bcde81baf96cdc662717033a1c8e78800dc99ce09
|
||||
SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29
|
||||
SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9
|
||||
SHA512 (cmsis_svd-5910f3d115a53ead55c8158da24a8fa8bda1eb50-clean.tar.xz) = 7187cade0e78bbd6e65a8f38109aa95783e71cc3fad445fc51ac8fca796845b8ad4b9b84335ef3aa725b9abb0c3ed72c768c0f7da5ecc7b14a505a328b625b47
|
||||
SHA512 (cmsis_svd-7d9b4167010feed9e59ac45e56519180295b3813-clean.tar.xz) = 013a5991a0fc170bd86e8c3cafe41b722061d9c631a51ecca762e00ea61ab2d14cb794a78a4ff8f449b10e32c8e746b07782da66f64599c7e6c8b17475f00428
|
||||
SHA512 (compiler-rt-8.0.0.src.tar.xz) = fe9f69fe2269fa3d560ae97fdacd462f855fb0b7a5f647f5b8595206ff7febca6496725adc953de411a827c761e2b3ca11a2149f25707d6c62af0722b68ba913
|
||||
SHA512 (nrfx-3ab39a9d457bfe627473ed0e03a7f1161d9e4f27.tar.gz) = 95b5293c9b707aeb4d8ad13643619c053ba0fa9423053a12f9a65b0ed8febc2aab87cd832e6ac73e9673987b7cb73f85cce68cb85ce4ca5bd607afee1098f9e9
|
||||
|
|
|
|||
52
tinygo.spec
52
tinygo.spec
|
|
@ -5,17 +5,18 @@
|
|||
|
||||
# https://github.com/tinygo-org/tinygo
|
||||
%global goipath github.com/tinygo-org/tinygo
|
||||
Version: 0.7.1
|
||||
Version: 0.9.0
|
||||
|
||||
%global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393
|
||||
%global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228
|
||||
%global clang_version 8.0.0
|
||||
%global cmsis_svd_commit 5910f3d115a53ead55c8158da24a8fa8bda1eb50
|
||||
%global cmsis_svd_commit 7d9b4167010feed9e59ac45e56519180295b3813
|
||||
%global compiler_rt_version 8.0.0
|
||||
%global nrfx_commit 3ab39a9d457bfe627473ed0e03a7f1161d9e4f27
|
||||
|
||||
# To match regular Go's /usr/share/gocode
|
||||
%global tinygoroot %{_prefix}/share/tinygo
|
||||
# No longer matching regular Go's /usr/share/gocode because it also provides
|
||||
# pre-compiled binaries, and symlinks to arch-specific clang headers.
|
||||
%global tinygoroot %{_libdir}/tinygo
|
||||
|
||||
%gometa
|
||||
|
||||
|
|
@ -23,10 +24,6 @@ Version: 0.7.1
|
|||
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
|
||||
|
|
@ -47,19 +44,21 @@ Source4: cmsis_svd-%{cmsis_svd_commit}-clean.tar.xz
|
|||
Source5: https://releases.llvm.org/%{compiler_rt_version}/compiler-rt-%{compiler_rt_version}.src.tar.xz
|
||||
Source6: https://github.com/NordicSemiconductor/nrfx/archive/%{nrfx_commit}/nrfx-%{nrfx_commit}.tar.gz
|
||||
# Fedora-specific.
|
||||
Patch0001: 0001-Use-system-path-for-TINYGOROOT-default.patch
|
||||
Patch0002: 0002-Use-Fedora-command-names.patch
|
||||
Patch0001: 0001-Use-Fedora-command-names.patch
|
||||
# We don't have ARM glibc to build these.
|
||||
Patch0003: 0003-Skip-ARM-Linux-tests.patch
|
||||
Patch0002: 0002-Skip-ARM-Linux-tests.patch
|
||||
# We can't include STM32 .svd files because of their weird license.
|
||||
Patch0004: 0004-Skip-STM32-tests.patch
|
||||
Patch0003: 0003-Skip-STM32-tests.patch
|
||||
# Fix import path.
|
||||
Patch0004: 0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch
|
||||
|
||||
# Not supported upstream yet.
|
||||
ExcludeArch: %{ix86} armv7hl ppc64le s390x
|
||||
ExcludeArch: armv7hl ppc64le s390x
|
||||
|
||||
BuildRequires: clang-devel = %{clang_version}
|
||||
BuildRequires: golang(github.com/blakesmith/ar)
|
||||
BuildRequires: golang(github.com/marcinbor85/gohex)
|
||||
BuildRequires: golang(go.bug.st/serial)
|
||||
BuildRequires: golang(golang.org/x/tools/go/ast/astutil)
|
||||
BuildRequires: golang(golang.org/x/tools/go/ssa)
|
||||
BuildRequires: golang(tinygo.org/x/go-llvm)
|
||||
|
|
@ -80,11 +79,9 @@ Recommends: qemu-system-arm-core
|
|||
%description
|
||||
%{common_description}
|
||||
|
||||
#gopkg
|
||||
|
||||
|
||||
%prep
|
||||
%goprep
|
||||
%forgesetup
|
||||
%patch0001 -p1
|
||||
%patch0002 -p1
|
||||
%patch0003 -p1
|
||||
|
|
@ -113,23 +110,24 @@ 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
|
||||
ln -s %{_libdir}/clang/%{clang_version}/include lib/clang/include
|
||||
|
||||
|
||||
%build
|
||||
%gobuild -o %{gobuilddir}/bin/tinygo %{goipath}
|
||||
GO111MODULE=off %make_build gen-device
|
||||
export LDFLAGS="-X github.com/tinygo-org/tinygo/goenv.TINYGOROOT=%{tinygoroot} "
|
||||
%gobuildroot
|
||||
%gobuild -o _bin/tinygo %{goipath}
|
||||
GO111MODULE=off %make_build gen-device PYTHON=%{__python3}
|
||||
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
|
||||
|
|
@ -162,7 +160,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 AVR=0 RISCV=0
|
||||
%gocheck -v -d tests/tinygotest
|
||||
%gochecks -d tests/tinygotest
|
||||
%endif
|
||||
|
||||
|
||||
|
|
@ -177,10 +175,16 @@ PATH=%{buildroot}%{_bindir}:$PATH make smoketest AVR=0 RISCV=0
|
|||
%license %{tinygoroot}/lib/nrfx/LICENSE
|
||||
%doc %{tinygoroot}/lib/nrfx/README.md
|
||||
|
||||
#gopkgfiles
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Feb 10 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.9.0-1
|
||||
- Update to latest version
|
||||
|
||||
* Tue Sep 24 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.8.0-1
|
||||
- Update to latest version
|
||||
- Enable x86 build
|
||||
|
||||
* Sun Aug 04 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.7.1-1
|
||||
- Update to latest version
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue