# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=tio
pkgver=3.7
pkgrel=1
pkgdesc="A simple TTY terminal I/O application"
arch=('i686' 'x86_64')
url="https://tio.github.io/"
msys2_repository_url="https://github.com/tio/tio"
msys2_references=(
  "anitya: 20587"
)
license=('spdx:GPL-2.0-or-later')
depends=('libinih' 'lua' 'glib2')
makedepends=('gcc' 'pkgconf' 'python' 'meson' 'ninja' 'libinih-devel' 'glib2-devel')
source=(https://github.com/tio/tio/releases/download/v${pkgver}/tio-${pkgver}.tar.xz{,.asc})
sha256sums=('dbaef5dc6849229ce4eb474d4de77a7302cd2b0657731a8df86a44dd359e6afb'
            'SKIP')
validpgpkeys=('101BAC1C15B216DBE07A3EEA2BDB4A0944FA00B1') # Martin Lund <martin.lund@keep-it-simple.com>

build() {
  mkdir "${srcdir}"/build && cd "${srcdir}"/build

  /usr/bin/meson \
    --wrap-mode=nodownload \
    --auto-features=enabled \
    --buildtype=plain \
    --prefix=/usr \
    "../tio-${pkgver}"

  /usr/bin/meson compile
}

package() {
  /usr/bin/meson install -C build --destdir "${pkgdir}"
  install -Dm644 tio-${pkgver}/LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
