# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+aur@gmail.com>

pkgname=perl-gd
pkgver=2.83
pkgrel=2
pkgdesc="Interface to Gd Graphics Library"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://search.cpan.org/dist/GD"
license=('GPL-1.0-or-later' 'Artistic-2.0')
depends=('perl' 'gd')
makedepends=('perl-extutils-pkgconfig' 'perl-file-which')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/R/RU/RURBAN/GD-$pkgver.tar.gz)
sha512sums=('65080a18ff675b7997a4425dcd9c8171e7d4cd5d53f499541caa7a0d85399ecffa04cae742ffcf8a0f2102a446ea46ecac45293fe14637b6d8a56d589c8c95cf')

build() {
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL="--skipdeps" \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='"$pkgdir"'" \
    PERL_MB_OPT="--installdirs vendor --destdir '"$pkgdir"'" \
    MODULEBUILDRC=/dev/null

  cd  "$srcdir"/GD-$pkgver
  perl Makefile.PL
  make
}

package() {
  cd  "$srcdir"/GD-$pkgver
  make install
}
