summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e660ef06a27718a3c4a7a6403595707849186098 (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: Chih-Hsuan Yen <yan12125@gmail.com>
# Contributor: Yushin Huang <hyslion AT gmail.com>

_pkgname=libchewing
pkgname=libchewing-git
pkgver=0.7.0.r3.ga7deabe
pkgrel=1
epoch=1
pkgdesc='Intelligent Chinese phonetic input method'
url='https://chewing.im/'
arch=('i686' 'x86_64')
license=('LGPL2.1')
conflicts=("$_pkgname")
provides=("$_pkgname")
depends=('sqlite')
makedepends=('cmake' 'git' 'rust')
source=("git+https://github.com/chewing/libchewing/")
md5sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  ( set -o pipefail
    git describe --long --tag 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-rc/rc/;s/-/./g;s/^v//'
  )
}

prepare() {
  cd "$_pkgname"
  mkdir build
}

build() {
  cd $_pkgname/build
  # Specify the existence of ncurses.h manually as FindCurses.cmake cannot identify it
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DBUILD_INFO=ON \
    -DCURSES_HAVE_NCURSES_H=ON \
    ..
  make
}

check() {
  cd $_pkgname/build
  # parallel testing is broken (https://github.com/chewing/libchewing/issues/293)
  make -j1 check
  # Additional tests added in https://github.com/chewing/libchewing/pull/387
  cargo test
}

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