# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=cairo-perl
pkgver=1.109
pkgrel=5.1
pkgdesc="Perl wrappers for cairo"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('LGPL')
url="http://gtk2-perl.sourceforge.net/"
options=('!emptydirs')
depends=('cairo' 'perl')
makedepends=('perl-extutils-depends' 'perl-extutils-pkgconfig')
source=(https://downloads.sourceforge.net/sourceforge/gtk2-perl/Cairo-${pkgver}.tar.gz
        Cairo-1.107-fatal-exit.patch
        Cairo-1.109.0-c99.patch)
sha512sums=('b80841bff480acf95f69659cba02ca17c79b67a2dc5c9b9302efb15bbd79bd4bc2f1801c001c220723da11081e86a08a83e07ecc8866810ebf9406e1f6fa1c53'
            '3ff858177e63842d48b9faa1e186fef49907e67aab9b07e5e162df95a82890013965e4c958e106651292826fcc541c2a3c09f61000d6ebd6f0fb3a13feae7fac'
            '8ed038604771fdb409d3a72f07084a6310eff64f4295dfffcdaf3724e588521f4562a6149a169c17d9bedbe1ff5ec40744733224c47108a3b74124d64101ec3a')

prepare() {
  cd Cairo-$pkgver
  patch -Np1 -i ${srcdir}/Cairo-1.107-fatal-exit.patch
  patch -Np1 -i ${srcdir}/Cairo-1.109.0-c99.patch
}

build() {
  cd Cairo-$pkgver
  
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd Cairo-$pkgver
  make test
}

package() {
  cd Cairo-$pkgver
  make DESTDIR="${pkgdir}" install
}
