PKGBUILD 1.03 KB
Newer Older
Xuetian Weng's avatar
Xuetian Weng committed
1
pkgname=fcitx-libpinyin
Jeff Huang's avatar
Jeff Huang committed
2 3
pkgver=0.5.1
_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 7
arch=('x86_64')
url="https://fcitx-im.org/wiki/Fcitx"
Xuetian Weng's avatar
Xuetian Weng committed
8
license=('GPL')
Jeff Huang's avatar
Jeff Huang committed
9 10 11 12 13 14
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=('aff1d66760fc624bc1610fdd205d683de38430724c7ced7b83f231a881a54a16'
            '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
}