summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 403e46fd2c2c074a914178eecf98617cf2a20f77 (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
# Maintainer: ZjeuhPiung <sophgn@outlook.com>
pkgname=rime-middle-chinese-git
pkgver=r6.542245e
pkgrel=1
pkgdesc="中古漢語拼音輸入方案(切韻音系)"
arch=('x86_64')
url='https://github.com/biopolyhedron/rime-middle-chinese'
source=("$pkgname::git+$url")
license=(custom)
conflicts=('rime-middle-chinese')
depends=('rime-luna-pinyin')
makedepends=('librime' 'rime-prelude' 'rime-essay')
sha512sums=('SKIP')

pkgver() {
  cd "$pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd $pkgname
    for _f in $(pacman -Qql rime-prelude rime-essay rime-luna-pinyin | grep -v "/$"); do ln -sf $_f; done
}

build() {
    cd $pkgname
    for _s in $(ls *.schema.yaml); do rime_deployer --compile $_s; done
}

package() {
  cd $pkgname
  find . -type l -delete
  rm build/luna*
  rm build/*.txt
  install -Dm644 *.yaml -t "$pkgdir"/usr/share/rime-data/
  install -Dm644 build/* -t "$pkgdir"/usr/share/rime-data/build/
}