summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 20e5a1c3e04d4f06bebe2091901f48c95e42ae86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Maintainer: noodlefighter <noodlefighter#gmail.com>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: GONG Chen <chen dot sst at gmail dot com>
# Contributor: 網軍總司令

_pkgname=librime
pkgname=$_pkgname-sbxlm-git
pkgver=9.5.12.r4.g8b089401
_octagramcommit=f92e083052b9983ee3cbddcda5ed60bb3c068e24
_luacommit=d45a41af2f9d731e3c1516a191cc3160e3cb8377
pkgrel=1
epoch=2
pkgdesc="Rime input method engine (声笔系列码 GIT version)"
arch=('x86_64')
url="https://github.com/sbxlmdsl/librime"
license=('GPL3')
depends=('boost-libs' 'capnproto' 'opencc' 'yaml-cpp' 'leveldb' 'librime-data' 'lua' 'google-glog' 'marisa')
makedepends=('cmake' 'boost' 'git' 'gtest' 'ninja')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("git+https://github.com/sbxlmdsl/librime.git"
        "https://github.com/lotem/librime-octagram/archive/$_octagramcommit/librime-octagram-$_octagramcommit.tar.gz"
        "https://github.com/hchunhui/librime-lua/archive/$_luacommit/librime-lua-$_luacommit.tar.gz")
sha512sums=('SKIP'
            '737d1c58982d2f79a6e8b2548eefa1dddc036dd6e6d5436e7d6b4f3adfa2e9d8e45b29a13c1b8207a93cb77f3b5dbd9d18436f44d4e8040eb95b962de582b386'
            '2a3d3b49d53066fe96dd008e8064718082225e6bf185574a25b8e98175d9936abcfa1fdc56e48f9c72a2deb46f8157d6132fd119ff8e0a3d52fbe9e2ea21386c')

prepare() {
  cd $_pkgname
  cd plugins
  ln -sf "$srcdir"/librime-octagram-$_octagramcommit librime-octagram
  ln -sf "$srcdir"/librime-lua-$_luacommit librime-lua
}

pkgver() {
  cd $_pkgname
  git describe --long --tags | sed 's/^rime-//;s/_/./;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $_pkgname
  export CXXFLAGS="$CXXFLAGS -DNDEBUG"
  cmake . -GNinja -Bbuild -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_MERGED_PLUGINS=Off -DENABLE_EXTERNAL_PLUGINS=On
  cmake --build build
}

check() {
  cd $_pkgname/build
  ninja test
}

package() {
  cd $_pkgname/build
  DESTDIR="$pkgdir" ninja install
}