archrelease: copy trunk to community-any
[ArchLinux/community.git] / rime-double-pinyin / repos / community-x86_64 / PKGBUILD
blob4977b06e01a57a6eb9a727dd49ac5469d2a41961
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=rime-double-pinyin
4 pkgver=0.0.0.20190120
5 _commit=69bf85d4dfe8bac139c36abbd68d530b8b6622ea
6 pkgrel=1
7 pkgdesc="double-pinyin input for rime"
8 arch=('x86_64')
9 url="https://github.com/rime/rime-double-pinyin"
10 license=('LGPL')
11 # dependency for reverse lookup: rime-stroke
12 # dependency on dictionary: rime-luna-pinyin
13 depends=('rime-luna-pinyin' 'rime-stroke')
14 makedepends=('librime' 'rime-prelude' 'rime-essay')
15 source=("https://github.com/rime/rime-double-pinyin/archive/$_commit/rime-double-pinyin-$_commit.tar.gz")
16 sha512sums=('2ab98a7b804b2fa3d0a59fd0b9a8b79316caa3a2da070766359d550d1d56edf85d55874044409780a2a21d729a2a7e834fdcf9419eb0d34252acbdef304a5c40')
18 prepare() {
19   cd $pkgname-$_commit
20   # Link essentials
21   for _f in $(pacman -Qql rime-prelude rime-essay rime-luna-pinyin | grep -v "/$"); do ln -sf $_f; done
23   # Build binaries only for this package
24   rm default.yaml
25   cp /usr/share/rime-data/default.yaml ./
26   sed -i -e '/- schema:/d' -e '/schema_list:/d' default.yaml
27   echo "schema_list:" >> default.yaml
28   ls *.schema.yaml | cut -d "." -f 1 | sed -e 's/\(.*\)/  - schema: \1/' >> default.yaml
31 build(){
32   cd $pkgname-$_commit
33   rime_deployer --build .
36 package() {
37   cd $pkgname-$_commit
38   find . -type l -delete
39   rm {,build/}default.yaml user.yaml build/luna*
40   install -Dm644 *.yaml -t "$pkgdir"/usr/share/rime-data/
41   install -Dm644 build/* -t "$pkgdir"/usr/share/rime-data/build/