summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c7ad4f44354e0bf8dfd894736d8377eef17c64c5 (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
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Kasei Wang <kasei@kasei.im>
# Maintainer: Kisaragi Hiu <mail@kisaragi-hiu.com>

pkgname=rime-pinyin-zhwiktionary-hant
_converter=rime-pinyin-zhwiktionary-hant-converter
_zhwiktionaryver=latest
pkgver=0.20240401
pkgrel=1
pkgdesc="Rime Pinyin (+ tones) Dictionary for zh.wiktionary.org (Traditional Chinese)"
arch=('any')
url="https://github.com/kisaragi-hiu/rime-pinyin-zhwiktionary-hant"
license=('CC-BY-3.0' 'GFDL-1.3-only')
makedepends=('opencc' 'pypinyin' 'git')
source=(git+https://github.com/kisaragi-hiu/rime-pinyin-zhwiktionary-hant-converter
        https://dumps.wikimedia.org/zhwiktionary/$_zhwiktionaryver/zhwiktionary-$_zhwiktionaryver-all-titles-in-ns0.gz
        https://dumps.wikimedia.org/zhwiktionary/$_zhwiktionaryver/zhwiktionary-$_zhwiktionaryver-md5sums.txt
        https://www.gnu.org/licenses/fdl-1.3.txt)
sha512sums=('SKIP'
            'SKIP'
            'SKIP'
            '22d46818d3998ad841f537af4de7c50440dd918099fb6c5d4ab324cd71dc03066bfe1b67210a5efde77abd1d97b88da3c3dbfc39a24ae7248ee2d64e7f0fe6bb')

_make="make -L VERSION=$_zhwiktionaryver"

pkgver() {
  if [[ $(head -1 zhwiktionary-$_zhwiktionaryver-md5sums.txt) =~ [[:digit:]]{8} ]]; then
    echo 0.${BASH_REMATCH[0]}
  fi
}

prepare() {
  cd $_converter
  # Workaround pacman decompression
  touch zhwiktionary-$_zhwiktionaryver-all-titles-in-ns0.gz
  ln -sf ../zhwiktionary-$_zhwiktionaryver-all-titles-in-ns0
}

build() {
  cd $_converter
  $_make build
}

# package_fcitx5-pinyin-zhwiktionary-hant() {
#   cd $_converter
#   $_make DESTDIR="$pkgdir" install
#   install -Dm644 ../fdl-1.3.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
# }

package() {
  cd $_converter
  $_make DESTDIR="$pkgdir" install
  install -Dm644 ../fdl-1.3.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}