# Maintainer: Connor Behan <connor.behan@gmail.com>

pkgname=pidgin-talkfilters
pkgver=2.7.0
pkgrel=5
pkgdesc="Implements GNU talkfilters in pidgin chats"
arch=('x86_64')
url="https://bitbucket.org/rekkanoryo/purple-plugin-pack"
license=('GPL')
depends=('libpurple' 'talkfilters')
makedepends=('intltool' 'gettext' 'python' 'pidgin')
source=(https://bitbucket.org/rekkanoryo/purple-plugin-pack/downloads/purple-plugin-pack-$pkgver.tar.bz2 python3.patch)
sha256sums=('2bbcf5e778a33968ba7f2864d2a6cb526a8984be3e4151642a583eee8eafb03c'
            '842292c95e61fb5a45b30eaed490d29ee67f725b46301e3590feafeb10014980')

build() {
  cd "$srcdir"/purple-plugin-pack-$pkgver

  patch -Np1 -i ../python3.patch
  sed -i -e 's|GETTEXT_PACKAGE=plugin_pack|GETTEXT_PACKAGE=pidgin_talkfilters|'\
    configure.ac
  autoreconf -vfi
  PYTHON=/usr/bin/python \
    ./configure --prefix=/usr --with-plugins=talkfilters

  make
}

package() {
  cd "$srcdir"/purple-plugin-pack-$pkgver

  make DESTDIR="$pkgdir" install
}
