# Maintainer: Peter Budai <peterbudai at hotmail dot com>

_realname=Text-CharWidth
pkgname=perl-${_realname}
pkgver=0.04
pkgrel=12
pkgdesc="Text::CharWidth - Get number of occupied columns of a string on terminal"
arch=('i686' 'x86_64')
url="https://metacpan.org/dist/Text-CharWidth/"
msys2_references=(
  "purl: pkg:cpan/KUBOTA/Text-CharWidth"
)
groups=("perl-modules")
license=('GPL' 'PerlArtistic')
depends=("perl" "libxcrypt")
makedepends=("perl-devel" "libxcrypt-devel" 'make' 'gcc')
options=('!emptydirs')
source=(https://www.cpan.org/authors/id/K/KU/KUBOTA/${_realname}-${pkgver}.tar.gz)
sha256sums=('abded5f4fdd9338e89fd2f1d8271c44989dae5bf50aece41b6179d8e230704f8')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
}

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

  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install DESTDIR=${pkgdir}
}
