# $Id: PKGBUILD 342107 2018-06-09 06:12:20Z arojas $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Trương Xuân Tính <xuantinh at gmail dot com>

pkgname=ibus-unikey
pkgver=0.6.1
pkgrel=5
pkgdesc='IBus module for Vietnamese Keyboard'
arch=('x86_64')
license=('GPL')
url='https://code.google.com/archive/p/ibus-unikey/'
depends=('ibus')
makedepends=('intltool')
source=("https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/ibus-unikey/${pkgname}-${pkgver}.tar.gz"
        ibus-unikey-gcc6.patch)
md5sums=('3bae6df0d4609a8c438c246030b9a61e'
         'f44aa534c46438a26e3c4ad7434f3a4c')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../ibus-unikey-gcc6.patch # Fix build with GCC 6 (Gentoo)
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure \
    --prefix=/usr \
    --libexecdir=/usr/lib/ibus

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
}
