summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 972cfa136cc1d74ee4d29151db26138b54c442e6 (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
pkgname=pyf9-git
_pkgname=PyF9
pkgver=r11.6f451b1
pkgrel=1
pkgdesc="Chinese IME in testing. No copyright infringing materials included."
arch=('i686' 'x86_64')
url="https://github.com/Saren-Arterius/PyF9"
depends=('xdotool' 'python-pillow' 'python-xlib' 'tk' 'xorg-xauth')
makedepends=('firefox' 'npm' 'xorg-server-xvfb' 'wget')
source=('git+https://github.com/Saren-Arterius/PyF9.git' 'pyf9.desktop')
sha256sums=('SKIP' 'a65cbaf96d480b154d257eeead5c1941079b0e5c257ba22c6e35a93b5628207f')

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

build() {
  echo Downloading image assets...
  cd "${_pkgname}/assets/"
  after_p=$(printf "\x$(printf %x 113)")
  arr=$(seq 0 9); arr+=(s)
  for i in ${arr[@]}; do
    wget -q "https://web.archive.org/web/20151031013114/https://hk.dictionary.yahoo.com/static/MasterView/assets/${after_p}9/grx/${after_p}9_${i}.png" -O f9_${i}.png;
  done
  rm please_grab_shit_from_their_website.sha1sum
  cd ../../

  echo Scrapping DB data... This might take up to few minutes
  cd "${_pkgname}/db-scrapper/"
  npm install
  npm start
}

package() {
  mkdir -p ${pkgdir}/opt/${_pkgname}
  install -Dm644 "pyf9.desktop" "${pkgdir}/usr/share/applications/pyf9.desktop"
  cd "${_pkgname}"
  install -Dm755 "main.py" "${pkgdir}/opt/${_pkgname}/pyf9"
  install -Dm644 "pyxhook.py" "${pkgdir}/opt/${_pkgname}/pyxhook.py"
  cp -r assets "${pkgdir}/opt/${_pkgname}"
}