# Maintainer: Deomid Ryabkov <https://github.com/rojer>
# Contributor: Daniel Pereira <https://github.com/kriansa>

pkgname=mos
pkgver=2.19.0
pkgrel=1
pkgdesc="Mongoose-OS build tool (release)"
url="https://mongoose-os.com/docs/mongoose-os/quickstart/setup.md"
arch=(x86_64)
license=(Apache)
depends=(libftdi libusb)
makedepends=(
  gcc
  go
  git
  make
  pkgconf
  python3
  libftdi
  libftdi-compat
)
conflicts=(mos-latest)
source=("https://github.com/mongoose-os/mos/archive/${pkgver}.tar.gz")
sha256sums=(0798ad17803e1c18afdce35f3ee29ac8b5bcdf8f902bd72d20b2568da6af76b9)

build() {
  cd "$pkgname-$pkgver" || exit 1
  make mos
}

package() {
  cd "$pkgname-$pkgver" || exit 1

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -D mos "$pkgdir/usr/bin/mos"
}
