# Maintainer: Andreas Radke <andyrtr@archlinux.org> 
# Contributor: Pan Lanlan <abbypan@gmail.com>

pkgname=leancrypto
pkgver=1.6.0
pkgrel=1
pkgdesc="Lean cryptographic library usable for bare-metal environments"
arch=('x86_64' 'aarch64')
license=('GPL-2.0-or-later'
         'LicenseRef-BSDvariant'
         'LicenseRef-leancrypto')
url="https://leancrypto.org"
depends=('glibc')
makedepends=('meson')
source=("$pkgname-$pkgver.tar.gz::https://github.com/smuellerDD/leancrypto/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('b5057cfb990108c4a9f21832f1f35f3d98115012d1628e00650558e6b49e8285')

build() {
  arch-meson $pkgname-$pkgver build

  # Print config
  meson configure build

  meson compile -C build
}

check() {
  # may take pretty long
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"

  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" $pkgname-$pkgver/LICENSE{,.bsd,.gplv2}
}

