# Contributor: Feng Shu <tumashu@163.com>

_realname=rime-bopomofo
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.0.0.20250729
_commit=1859af68a927ba3cd5afb8c47feedcecf874dab2
pkgrel=1
pkgdesc="Bopomofo input for rime (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/rime/rime-bopomofo"
license=('LGPL')
# Rime will regenerate yaml&prism bin, which makes terra-pinyin required on runtime (for translator)
# rime-cangjie is dependency for reverse lookup
depends=("${MINGW_PACKAGE_PREFIX}-rime-cangjie"
         "${MINGW_PACKAGE_PREFIX}-rime-terra-pinyin")
source=("https://github.com/rime/rime-bopomofo/archive/${_commit}/rime-bopomofo-${_commit}.tar.gz")
sha512sums=('9aa70caf5e1cd96a6c27755d13ef395cb23492a6c42b7f33b3b6f6c17a1faa4ae5224184602ff08bcbb4e06f036c2d2ed804e38ff1146769f1b5590184f73ede')

package() {
  cd "rime-bopomofo-${_commit}"
  install -Dm644 *.yaml -t "${pkgdir}${MINGW_PREFIX}/share/rime-data/"
}
