# Maintainer: @naveen521kk on Github, Naveen M K <naveen521kk@gmail.com>

_perlname=Encode-compat
_realname="${_perlname,,}"
pkgbase=mingw-w64-perl-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-perl-${_realname}")
pkgver=0.07
pkgrel=3
pkgdesc="Encode::compat - Encode.pm emulation layer (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
license=('GPL' 'PerlArtistic')
url="https://metacpan.org/release/Encode-compat"
groups=("${MINGW_PACKAGE_PREFIX}-perl-modules")
depends=("${MINGW_PACKAGE_PREFIX}-perl")
options=('!emptydirs')
makedepends=("${MINGW_PACKAGE_PREFIX}-python")
source=(
  "https://www.cpan.org/authors/id/A/AU/AUTRIJUS/${_perlname}-${pkgver}.tar.gz"
  "patchmakefile.py"
)
sha512sums=('0722f27933bbceaba9750c655c06bb23cdbf6e5e54160d85ee2e9ae26405e87721a7cd382c3a467d78123827433802fc0f0ee32f269f0fecb667a3194c0565a5'
            'd7ec5ba4a3d75f674f4028e8a53bc4177ab71a379bc63affebf910e1d5a0e491b6642318218b55ddc4d90e0125d61e4b97626782af57d44522bcb5543fb21cb2')

build() {
  cd "$srcdir/${_perlname}-${pkgver}"
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL
  export pkgdir=$pkgdir
  python $srcdir/patchmakefile.py
  mingw32-make
}

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