# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=perl-anyevent
pkgver=7.17
pkgrel=8
epoch=4
pkgdesc='The DBI of event loop programming'
arch=(any)
url="https://metacpan.org/release/AnyEvent"
license=('PerlArtistic' 'GPL')
depends=('perl')
checkdepends=('glib-perl' 'perl-async-interrupt' 'perl-ev' 'perl-net-ssleay')
optdepends=('perl-async-interrupt: for fast signal handling'
            'perl-ev: for the recommended EV event loop backend'
            'perl-guard: to speed up guards'
            'perl-json: send or receive JSON with AnyEvent::Handle'
            'perl-json-xs: send or receive JSON with AnyEvent::Handle'
            'perl-net-ssleay: TLS/SSL connections with AnyEvent::Handle')
options=('!emptydirs')
source=("https://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/AnyEvent-$pkgver.tar.gz")
sha512sums=('c553cce80fa14e2f91031c569d1c30acf470871ddd1c122fa3dd36cd1ba5b7002e7ba1dea4c950d889c7c661b81042dd97975e195a5325190ad644babff81e0a')

build() {
  cd AnyEvent-$pkgver
  PERL_CANARY_STABILITY_NOPROMPT=1 \
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd AnyEvent-$pkgver
  PERL_ANYEVENT_LOOP_TESTS=true make test
}

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