mirror of
https://github.com/beard7n/bsdports.git
synced 2026-04-10 02:21:15 +02:00
add tinygo
This commit is contained in:
78
_alpha/tinygo/Makefile
Normal file
78
_alpha/tinygo/Makefile
Normal file
@@ -0,0 +1,78 @@
|
||||
# $FreeBSD: head/devel/tinygo/Makefile 522781 2020-01-12 12:39:16Z dmgk $
|
||||
|
||||
PORTNAME= tinygo
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 0.11.0
|
||||
CATEGORIES= devel
|
||||
|
||||
# https://github.com/tinygo-org/tinygo/pull/810
|
||||
PATCH_SITES= https://github.com/dmgk/tinygo/commit/
|
||||
PATCHFILES= 88c85403cc01650ca8a2b9a69ee8c68231ec0e54.patch:-p1
|
||||
|
||||
MAINTAINER= dmgk@FreeBSD.org
|
||||
COMMENT= Go compiler for small places
|
||||
|
||||
#BUILD_DEPENDS= cmake:devel/cmake \
|
||||
# ninja:devel/ninja
|
||||
#TEST_DEPENDS= qemu-system-arm:emulators/qemu
|
||||
|
||||
USES= gmake go:modules,run
|
||||
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= tinygo-org
|
||||
GH_TUPLE= \
|
||||
blakesmith:ar:8bd4349a67f2:blakesmith_ar/vendor/github.com/blakesmith/ar \
|
||||
creack:goselect:v0.1.0:creack_goselect/vendor/github.com/creack/goselect \
|
||||
golang:sys:b09406accb47:golang_sys/vendor/golang.org/x/sys \
|
||||
golang:tools:8dcc6e70cdef:golang_tools/vendor/golang.org/x/tools \
|
||||
google:shlex:c34317bd91bf:google_shlex/vendor/github.com/google/shlex \
|
||||
marcinbor85:gohex:7a43cd876e46:marcinbor85_gohex/vendor/github.com/marcinbor85/gohex \
|
||||
bugst:go-serial:5f7892a7bb45:bugst_go_serial/vendor/go.bug.st/serial.v1 \
|
||||
tinygo-org:go-llvm:b2db3df3f257:tinygo_go_llvm/vendor/tinygo.org/x/go-llvm
|
||||
|
||||
# Device files and runtime are distributed as submodules
|
||||
GH_TUPLE+= NordicSemiconductor:nrfx:3ab39a9d457b:nrfx/lib/nrfx \
|
||||
ARM-software:CMSIS:9fe411cef1ce:cmsis/lib/CMSIS \
|
||||
avr-rust:avr-mcu:6624554c02b2:avr/lib/avr \
|
||||
tinygo-org:cmsis-svd:7d9b4167010f:cmsis_svd/lib/cmsis-svd \
|
||||
llvm-mirror:compiler-rt:5bc79797e1f9:compiler_rt/lib/compiler-rt
|
||||
|
||||
# Bundled LLVM
|
||||
GH_TUPLE+= llvm:llvm-project:llvmorg-9.0.1:llvm/llvm-project
|
||||
|
||||
#OPTIONS_DEFINE= AVR QEMU
|
||||
#AVR_DESC= AVR based processors support
|
||||
#QEMU_DESC= Install emulators/qemu for Cortex-M targets
|
||||
|
||||
#AVR_RUN_DEPENDS= avr-gcc:devel/avr-gcc \
|
||||
# ${LOCALBASE}/avr/include/stdint.h:devel/avr-libc \
|
||||
# avrdude:devel/avrdude
|
||||
#AVR_VARS_OFF= AVR=0
|
||||
#QEMU_RUN_DEPENDS= qemu-system-arm:emulators/qemu
|
||||
|
||||
do-build:
|
||||
cd ${WRKSRC} && unset CDPATH && ${GMAKE} llvm-build
|
||||
cd ${WRKSRC} && ${SETENV} \
|
||||
GO=${GO_CMD} \
|
||||
GOCACHE=${WRKDIR}/.gocache \
|
||||
PATH=${WRKSRC}/llvm-build/bin:$$PATH \
|
||||
${GMAKE} release
|
||||
|
||||
do-install:
|
||||
${MKDIR} ${STAGEDIR}${PREFIX}/tinygo
|
||||
cd ${WRKSRC}/build/release/tinygo && \
|
||||
${MKDIR} ${STAGEDIR}${PREFIX}/tinygo/bin && \
|
||||
${INSTALL_PROGRAM} bin/tinygo ${STAGEDIR}${PREFIX}/tinygo/bin && \
|
||||
${COPYTREE_SHARE} "lib pkg src targets" ${STAGEDIR}${PREFIX}/tinygo
|
||||
${RLN} ${STAGEDIR}${PREFIX}/tinygo/bin/tinygo ${STAGEDIR}${PREFIX}/bin
|
||||
|
||||
do-test:
|
||||
cd ${WRKSRC} && ${SETENV} \
|
||||
AVR=${AVR} \
|
||||
GOCACHE=${WRKDIR}/.gocache \
|
||||
PATH=${WRKSRC}/llvm-build/bin:$$PATH \
|
||||
RISCV=0 \
|
||||
TINYGO=${WRKSRC}/build/tinygo \
|
||||
${GMAKE} test smoketest
|
||||
|
||||
.include <bsd.port.mk>
|
||||
33
_alpha/tinygo/distinfo
Normal file
33
_alpha/tinygo/distinfo
Normal file
@@ -0,0 +1,33 @@
|
||||
TIMESTAMP = 1577324027
|
||||
SHA256 (tinygo-org-tinygo-v0.11.0_GH0.tar.gz) = eac283a91b8aa523cf3b4ef1ab3be3a7ad473dcb332fd882d41fd21c8bf70971
|
||||
SIZE (tinygo-org-tinygo-v0.11.0_GH0.tar.gz) = 387019
|
||||
SHA256 (blakesmith-ar-8bd4349a67f2_GH0.tar.gz) = 51d0ca71a5f31d283eb43142fadd036c9df909ebe5e5d7af031f6b9b91c65a67
|
||||
SIZE (blakesmith-ar-8bd4349a67f2_GH0.tar.gz) = 4057
|
||||
SHA256 (creack-goselect-v0.1.0_GH0.tar.gz) = c10d49debe2b53289764364ec15f4f03c17a115073543e3e229e7695cd9c3203
|
||||
SIZE (creack-goselect-v0.1.0_GH0.tar.gz) = 7323
|
||||
SHA256 (golang-sys-b09406accb47_GH0.tar.gz) = 732651ee709d3443e992f716796c5dac7cbc29a345a8ffe3fb80f505c93503d2
|
||||
SIZE (golang-sys-b09406accb47_GH0.tar.gz) = 1496780
|
||||
SHA256 (golang-tools-8dcc6e70cdef_GH0.tar.gz) = b4958921549986911e7317d16804a38d4e12310ac0be98e1a0ef82ff52986a34
|
||||
SIZE (golang-tools-8dcc6e70cdef_GH0.tar.gz) = 2643178
|
||||
SHA256 (google-shlex-c34317bd91bf_GH0.tar.gz) = fefaae49749c42aaaf9864fc0a04326a8cc263a42ebfb18b907419b9cfc9f4f1
|
||||
SIZE (google-shlex-c34317bd91bf_GH0.tar.gz) = 7234
|
||||
SHA256 (marcinbor85-gohex-7a43cd876e46_GH0.tar.gz) = 572e1b63365e00dd46e993448ed49ad3a84ac038fb2423c5279a712b33d87fbd
|
||||
SIZE (marcinbor85-gohex-7a43cd876e46_GH0.tar.gz) = 7341
|
||||
SHA256 (bugst-go-serial-5f7892a7bb45_GH0.tar.gz) = b4d99066bc23feb953461772460c96959c5f956039f7e2894a19a220018bf954
|
||||
SIZE (bugst-go-serial-5f7892a7bb45_GH0.tar.gz) = 23047
|
||||
SHA256 (tinygo-org-go-llvm-b2db3df3f257_GH0.tar.gz) = c06bf9031454129ec2635408d50d60331675fbadaad94f4eef08a3ea98787940
|
||||
SIZE (tinygo-org-go-llvm-b2db3df3f257_GH0.tar.gz) = 31255
|
||||
SHA256 (NordicSemiconductor-nrfx-3ab39a9d457b_GH0.tar.gz) = 516dbe156dcf3080d5b9df628ffe95fb6b4430973e0151eeb2fc66bd40070b24
|
||||
SIZE (NordicSemiconductor-nrfx-3ab39a9d457b_GH0.tar.gz) = 943309
|
||||
SHA256 (ARM-software-CMSIS-9fe411cef1ce_GH0.tar.gz) = cf743b2a8a50919c864946c8843d5fc7ed4be36ac15b8a07a1bdf9562efcc6c4
|
||||
SIZE (ARM-software-CMSIS-9fe411cef1ce_GH0.tar.gz) = 97355967
|
||||
SHA256 (avr-rust-avr-mcu-6624554c02b2_GH0.tar.gz) = 6a879dad1c9e33ad1f55d3e2dd20dc797195e32c78963680d639e75bf2eb3171
|
||||
SIZE (avr-rust-avr-mcu-6624554c02b2_GH0.tar.gz) = 3480381
|
||||
SHA256 (tinygo-org-cmsis-svd-7d9b4167010f_GH0.tar.gz) = 9572c8a869a0bd53c7a372e33d4f600313fee48a9e8ebfacabd7a6343d26e64f
|
||||
SIZE (tinygo-org-cmsis-svd-7d9b4167010f_GH0.tar.gz) = 50797376
|
||||
SHA256 (llvm-mirror-compiler-rt-5bc79797e1f9_GH0.tar.gz) = b978a63ffdcc8e25aa668c6b3d45f5fd1fb21852301db1aa797ac2aa5f8586b8
|
||||
SIZE (llvm-mirror-compiler-rt-5bc79797e1f9_GH0.tar.gz) = 3269533
|
||||
SHA256 (llvm-llvm-project-llvmorg-9.0.1_GH0.tar.gz) = be7b034641a5fda51ffca7f5d840b1a768737779f75f7c4fd18fe2d37820289a
|
||||
SIZE (llvm-llvm-project-llvmorg-9.0.1_GH0.tar.gz) = 113193320
|
||||
SHA256 (88c85403cc01650ca8a2b9a69ee8c68231ec0e54.patch) = 41a1ab95d0e7383495c8628c69e365bbf78e903569da160727ede28f0fbc8c77
|
||||
SIZE (88c85403cc01650ca8a2b9a69ee8c68231ec0e54.patch) = 4783
|
||||
45
_alpha/tinygo/files/patch-Makefile
Normal file
45
_alpha/tinygo/files/patch-Makefile
Normal file
@@ -0,0 +1,45 @@
|
||||
--- Makefile.orig 2020-01-12 12:25:35 UTC
|
||||
+++ Makefile
|
||||
@@ -18,7 +18,7 @@ MD5SUM = md5sum
|
||||
TINYGO ?= tinygo
|
||||
|
||||
# Use CCACHE for LLVM if possible
|
||||
-ifneq (, $(shell which ccache))
|
||||
+ifneq (, $(CCACHE_DIR))
|
||||
LLVM_OPTION += '-DLLVM_CCACHE_BUILD=ON'
|
||||
endif
|
||||
|
||||
@@ -99,13 +99,13 @@ fmt-check:
|
||||
gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive gen-device-stm32
|
||||
|
||||
gen-device-avr:
|
||||
- $(GO) build -o ./build/gen-device-avr ./tools/gen-device-avr/
|
||||
+ $(GO) build -mod=vendor -o ./build/gen-device-avr ./tools/gen-device-avr/
|
||||
./build/gen-device-avr lib/avr/packs/atmega src/device/avr/
|
||||
./build/gen-device-avr lib/avr/packs/tiny src/device/avr/
|
||||
@GO111MODULE=off $(GO) fmt ./src/device/avr
|
||||
|
||||
build/gen-device-svd: ./tools/gen-device-svd/*.go
|
||||
- $(GO) build -o $@ ./tools/gen-device-svd/
|
||||
+ $(GO) build -mod=vendor -o $@ ./tools/gen-device-svd/
|
||||
|
||||
gen-device-nrf: build/gen-device-svd
|
||||
./build/gen-device-svd -source=https://github.com/NordicSemiconductor/nrfx/tree/master/mdk lib/nrfx/mdk/ src/device/nrf/
|
||||
@@ -142,10 +142,10 @@ $(LLVM_BUILDDIR): $(LLVM_BUILDDIR)/build.ninja
|
||||
# Build the Go compiler.
|
||||
tinygo:
|
||||
@if [ ! -f "$(LLVM_BUILDDIR)/bin/llvm-config" ]; then echo "Fetch and build LLVM first by running:"; echo " make llvm-source"; echo " make $(LLVM_BUILDDIR)"; exit 1; fi
|
||||
- CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) build -o build/tinygo$(EXE) -tags byollvm .
|
||||
+ CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) build -o build/tinygo$(EXE) -tags byollvm -mod=vendor .
|
||||
|
||||
test:
|
||||
- CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) test -v -tags byollvm ./cgo ./compileopts ./interp ./transform .
|
||||
+ CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) test -v -tags byollvm -mod=vendor ./cgo ./compileopts ./interp ./transform .
|
||||
|
||||
tinygo-test:
|
||||
cd tests/tinygotest && tinygo test
|
||||
@@ -280,4 +280,3 @@ release: tinygo gen-device
|
||||
./build/tinygo build-builtins -target=armv6m-none-eabi -o build/release/tinygo/pkg/armv6m-none-eabi/compiler-rt.a
|
||||
./build/tinygo build-builtins -target=armv7m-none-eabi -o build/release/tinygo/pkg/armv7m-none-eabi/compiler-rt.a
|
||||
./build/tinygo build-builtins -target=armv7em-none-eabi -o build/release/tinygo/pkg/armv7em-none-eabi/compiler-rt.a
|
||||
- tar -czf build/release.tar.gz -C build/release tinygo
|
||||
7
_alpha/tinygo/pkg-descr
Normal file
7
_alpha/tinygo/pkg-descr
Normal file
@@ -0,0 +1,7 @@
|
||||
TinyGo is a project to bring the Go programming language to microcontrollers
|
||||
and modern web browsers by creating a new compiler based on LLVM. You can
|
||||
compile and run TinyGo programs on several different microcontroller boards
|
||||
such as the BBC micro:bit and the Arduino Uno. TinyGo can also be used to
|
||||
produce WebAssembly (WASM) code which is very compact in size.
|
||||
|
||||
WWW: https://tinygo.org/
|
||||
1987
_alpha/tinygo/pkg-plist
Normal file
1987
_alpha/tinygo/pkg-plist
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user