# Maintainer (arch): Felix Yan <felixonmars@archlinux.org>
# Contributor: csslayer <wengxt AT gmail com>
# Maintainer: Parabola Hackers <dev@lists.parabola.nu>


# parabola changes and rationale:
# - replace webengine dependency with webkit
#   use '-DENABLE_BROWSER=OFF' instead, if we ever need to drop 'qt5-webkit'


# FTBS armv7h: because qt5-webit FTBS
# FTBS i686: Could not find a configuration file for package "Fcitx5Core" that is compatible with requested version "5.1.6".


pkgname=fcitx5-chinese-addons
pkgver=5.1.3
pkgrel=1
pkgrel=1.parabola1
pkgdesc="Addons related to Chinese, including IME previous bundled inside fcitx4"
arch=('x86_64')
arch+=('armv7h' 'i686')
url="https://github.com/fcitx/fcitx5-chinese-addons"
license=('GPL')
conflicts=('fcitx')
depends=('curl' 'fcitx5-qt' 'libime' 'opencc' 'qt5-webengine')
depends=( ${depends[*]/qt5-webengine/qt5-webkit} )
makedepends=('boost' 'extra-cmake-modules' 'fcitx5-lua' 'fmt' 'ninja')
optdepends=('fcitx5-lua: Lua and imeapi support from pinyin')
source=("https://download.fcitx-im.org/fcitx5/$pkgname/$pkgname-${pkgver}_dict.tar.xz"{,.sig})
sha512sums=('4ea52ec45af70b552d8d4af3ed077662d6d839d3984bc41858b4710fe5b1dc169c63e223770f5400718c1c18aa745e77305f242409fa1cc523cee8475eb2e9ff'
            'SKIP')
validpgpkeys=('2CC8A0609AD2A479C65B6D5C8E8B898CBF2412F9') # Weng Xuetian <wengxt@gmail.com>

build() {
  cd $pkgname-$pkgver

  cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib -DUSE_WEBKIT=ON .
  ninja
}

check() {
  cd $pkgname-$pkgver
  ninja test
}

package() {
  cd $pkgname-$pkgver
  DESTDIR="$pkgdir" ninja install
}
