1 # Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
6 pkgdesc='Go compiler for small places. Microcontrollers, WebAssembly, and command-line tools. Based on LLVM.'
8 url='https://github.com/tinygo-org/tinygo'
11 # TODO: re-add these deps when switching back to system LLVM
12 #depends=(llvm-libs clang lld)
13 # TODO: add llvm + remove cmake/ninja/python from build deps
14 makedepends=(go git cmake ninja python)
15 # use git as we need to fetch submodules
16 source=(git+https://github.com/tinygo-org/tinygo#tag=v$pkgver
17 git+https://github.com/NordicSemiconductor/nrfx.git
18 git+https://github.com/ARM-software/CMSIS.git
19 git+https://github.com/avr-rust/avr-mcu.git
20 git+https://github.com/tinygo-org/cmsis-svd
21 git+https://github.com/CraneStation/wasi-libc
22 git+https://github.com/keith-packard/picolibc.git
23 git+https://github.com/tinygo-org/stm32-svd
24 git://git.musl-libc.org/musl
25 git+https://github.com/WebAssembly/binaryen.git
26 git+https://github.com/mingw-w64/mingw-w64.git
27 git+https://github.com/aykevl/macos-minimal-sdk.git
28 git+https://github.com/espressif/llvm-project#branch=xtensa_release_15.x
43 'a5352a32ed89120af415825fa5b73a0e7bb907fa6efaa63529ad721a53cf4844')
49 git config -f .gitmodules 'submodule.lib/nrfx.url' "$srcdir/nrfx"
50 git config -f .gitmodules 'submodule.lib/CMSIS.url' "$srcdir/CMSIS"
51 git config -f .gitmodules 'submodule.lib/avr.url' "$srcdir/avr-mcu"
52 git config -f .gitmodules 'submodule.lib/cmsis-svd.url' "$srcdir/cmsis-svd"
53 git config -f .gitmodules 'submodule.lib/wasi-libc.url' "$srcdir/wasi-libc"
54 git config -f .gitmodules 'submodule.lib/picolibc.url' "$srcdir/picolibc"
55 git config -f .gitmodules 'submodule.lib/stm32-svd.url' "$srcdir/stm32-svd"
56 git config -f .gitmodules 'submodule.lib/musl.url' "$srcdir/musl"
57 git config -f .gitmodules 'submodule.lib/binaryen.url' "$srcdir/binaryen"
58 git config -f .gitmodules 'submodule.lib/mingw-w64.url' "$srcdir/mingw-w64"
59 git config -f .gitmodules 'submodule.lib/macos-minimal-sdk.url' "$srcdir/macos-minimal-sdk"
62 # 'protocol.file.allow=always' is a workaround for https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html
63 git -c protocol.file.allow=always submodule update
65 ln -sf ../llvm-project
67 patch -p1 < ../llvm_build_j1.patch
78 # it reqreires a lot of dependencies. todo enable the tests
79 # make test tinygo-test smoketest
85 install -d "$pkgdir"/usr/bin "$pkgdir"/usr/lib/tinygo
86 mv build/release/tinygo/* "$pkgdir"/usr/lib/tinygo
87 ln -s /usr/lib/tinygo/bin/tinygo "$pkgdir"/usr/bin/tinygo