
_realname=reflex
pkgname=${_realname}
pkgver=20241231
pkgrel=1
pkgdesc="A variant of the flex fast lexical scanner"
arch=('i686' 'x86_64')
url="https://invisible-island.net/reflex"
license=('BSD')
makedepends=('autotools' 'gcc')

source=("${_realname}-${pkgver}.tar.gz::https://github.com/ThomasDickey/${_realname}-snapshots/archive/t${pkgver}.tar.gz")
sha256sums=('e33e17e4dcc41bb3bc60d56dabdbd80341bd3a04531ad7b65ae5c1568aa48b82')


prepare() {
  pushd "${_realname}-snapshots-t${pkgver}"
  autoreconf -vfi
  popd
}

build() {
  mkdir -p build-${pkgver}-${MSYSTEM_CHOST}
  pushd build-${pkgver}-${MSYSTEM_CHOST}
  ../${_realname}-snapshots-t${pkgver}/configure -C
  make
  popd
}

check() {
  make -C build-${pkgver}-${MSYSTEM_CHOST} bigcheck
}

package() {
  make -C build-${pkgver}-${MSYSTEM_CHOST} DESTDIR=${pkgdir} install
  install -Dv -t "${pkgdir}/usr/share/licenses/${pkgname}" \
    "${_realname}-snapshots-t${pkgver}/package/debian/copyright"
}
