PKGBUILD 1.04 KB
Newer Older
Xuetian Weng's avatar
Xuetian Weng committed
1
pkgname=fcitx-libpinyin
Jeff Huang's avatar
Jeff Huang committed
2
pkgver=0.5.3
Jeff Huang's avatar
Jeff Huang committed
3
_model=model.text.20161206.tar.gz
Jeff Huang's avatar
Jeff Huang committed
4
pkgrel=1
Xuetian Weng's avatar
Xuetian Weng committed
5
pkgdesc="Fcitx Wrapper for libpinyin."
gnastyle's avatar
gnastyle committed
6
arch=('x86_64')
Jeff Huang's avatar
Jeff Huang committed
7
url="https://github.com/fcitx/fcitx-libpinyin"
Xuetian Weng's avatar
Xuetian Weng committed
8
license=('GPL')
Jeff Huang's avatar
Jeff Huang committed
9 10 11 12
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")
Jeff Huang's avatar
Jeff Huang committed
13
sha256sums=('8e6ec15049c6f7d9cd49c8dab779318997d6646e9cbe7fafa26b0883cff3b358'
Jeff Huang's avatar
Jeff Huang committed
14
            '5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704')
Xuetian Weng's avatar
Xuetian Weng committed
15

Jeff Huang's avatar
Jeff Huang committed
16 17 18 19 20 21 22 23 24 25 26 27
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
Xuetian Weng's avatar
Xuetian Weng committed
28 29
}

Jeff Huang's avatar
Jeff Huang committed
30 31 32
package() {
  cd build
  make DESTDIR="$pkgdir" install
Xuetian Weng's avatar
Xuetian Weng committed
33
}