archrelease: copy trunk to community-any
[arch-community.git] / arduino-builder / trunk / PKGBUILD
blob2880e252fa2ac143cee010634d0cbe05d10fbafa
1 # Maintainer: NicoHood <archlinux {cat} nicohood {dog} de>
2 # PGP ID: 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161
4 pkgname=arduino-builder
5 pkgver=1.6.1
6 pkgrel=2
7 pkgdesc="A command line tool for compiling Arduino sketches"
8 arch=('x86_64')
9 url="https://github.com/arduino/arduino-builder"
10 license=('GPL')
11 depends=('arduino-ctags')
12 makedepends=('go' 'git' 'unzip')
13 optdepends=('arduino-avr-core: AVR core with upstream avr-gcc and avrdude')
14 source=("${pkgname}-${pkgver}.tar.xz::https://github.com/arduino/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz"
15                 "${pkgname}-${pkgver}.tar.xz.asc::https://github.com/arduino/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz.asc")
16 sha512sums=('b6e8bf43ad343e98c3d71985dbbaefee27f51c5d31248f920d4880446a3e6b5f0ea0461f61e65b2e3205e4c0a06696390c401198b7b0e8fd16cdc874da4f451b'
17             'SKIP')
18 validpgpkeys=('326567C1C6B288DF32CB061A95FA6F43E21188C4') # Arduino Packages <support@arduino.cc>
20 build()
22         export CGO_CPPFLAGS="${CPPFLAGS}"
23         export CGO_CFLAGS="${CFLAGS}"
24         export CGO_CXXFLAGS="${CXXFLAGS}"
25         export CGO_LDFLAGS="${LDFLAGS}"
26         export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
28         cd "${srcdir}/${pkgname}-${pkgver}"
29         go build
31         # TODO Fix ctags test environment at build time
32         # https://github.com/arduino/arduino-builder/issues/202
35 #check()
37         # Test will download ~1GB of testfiles
38         #echo "Running check() for the first time might take a while as it downloads ~1GB of testfiles. Skip with --nocheck"
39         #cd "${srcdir}/${pkgname}-${pkgver}"
40         #go test -timeout 60m github.com/arduino/arduino-cli/...
43 package()
45         cd "${srcdir}/${pkgname}-${pkgver}"
47         # Install main tool
48         install -Dm755 "arduino-builder" "${pkgdir}/usr/bin/arduino-builder"
50         # Install platform.txt files
51         install -Dm644 -t "${pkgdir}/usr/share/arduino/hardware/" "${srcdir}"/${pkgname}-${pkgver}/hardware/*
53         # Fix platform.txt for arch arduino-ctags
54         echo 'tools.ctags.path=/usr/bin' > "${pkgdir}/usr/share/arduino/hardware/platform.txt"
55         echo 'tools.ctags.cmd.path={path}/arduino-ctags' >> "${pkgdir}/usr/share/arduino/hardware/platform.txt"
57         # Add documentation
58         install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" "${srcdir}/${pkgname}-${pkgver}/README.md"