pkgname=fcitx-libpinyin pkgver=0.5.3 _model=model.text.20161206.tar.gz pkgrel=1 pkgdesc="Fcitx Wrapper for libpinyin." arch=('x86_64') url="https://github.com/fcitx/fcitx-libpinyin" license=('GPL') depends=('fcitx' 'libpinyin' 'fcitx-qt5' 'qt5-webengine') makedepends=('cmake') source=("$pkgname-$pkgver.tar.gz::https://github.com/fcitx/fcitx-libpinyin/archive/$pkgver.tar.gz" "$pkgname-$_model::http://download.fcitx-im.org/data/$_model") sha256sums=('8e6ec15049c6f7d9cd49c8dab779318997d6646e9cbe7fafa26b0883cff3b358' '5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704') prepare() { mkdir build ln -s "$srcdir"/$pkgname-$_model fcitx-libpinyin-$pkgver/data/$_model sed -i 's/pinyin_guess_candidates(m_inst, pinyinOffset());/pinyin_guess_candidates(m_inst, pinyinOffset(), SORT_BY_PHRASE_LENGTH_AND_FREQUENCY);/' fcitx-libpinyin-$pkgver/src/eim.cpp } build() { cd build cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ../$pkgname-$pkgver make } package() { cd build make DESTDIR="$pkgdir" install }