# Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>

_realname=ansifilter
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=2.22
pkgrel=1
pkgdesc="remove or convert ANSI codes to another format (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://gitlab.com/saalen/ansifilter"
license=('spdx:GPL-3.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
source=("https://gitlab.com/saalen/ansifilter/-/archive/${pkgver}/${_realname}-${pkgver}.tar.bz2")
sha256sums=('ccff41ca740b813bf9103868b5000f4243d32a75304ea929a214c49b943ecc93')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make all
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="${pkgdir}" PREFIX="/$MINGW_PREFIX" install
  rm "${pkgdir}/$MINGW_PREFIX/share/doc/ansifilter/COPYING" \
     "${pkgdir}/$MINGW_PREFIX/share/doc/ansifilter/INSTALL"
}
