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

_realname=rime-prelude
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
         "${MINGW_PACKAGE_PREFIX}-librime-data")
pkgver=0.0.0.20250420
_commit=3c602fdb0dcca7825103e281efc50ef7580f99ec
pkgrel=1
pkgdesc="Essential files for building up your Rime configuration (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/rime/rime-prelude"
license=('LGPL')
source=("https://github.com/rime/rime-prelude/archive/${_commit}/rime-prelude-${_commit}.tar.gz")
sha512sums=('a255e1eba62e31ba82c32182be2d387d6b52006befd42eadb2b8a0721aac32ab36618021192cbc9f3fb6d81e9dea2e69122c0fccb7f60b1a98c180f760912d33')

eval "package_${MINGW_PACKAGE_PREFIX}-${_realname}() {
  cd rime-prelude-\$_commit
  install -Dm644 *.yaml -t \${pkgdir}\${MINGW_PREFIX}/share/rime-data/
}"

eval "package_${MINGW_PACKAGE_PREFIX}-librime-data() {
  pkgdesc='Meta package of preset librime data (mingw-w64)'
  depends=(${MINGW_PACKAGE_PREFIX}-rime-bopomofo
           ${MINGW_PACKAGE_PREFIX}-rime-cangjie
           ${MINGW_PACKAGE_PREFIX}-rime-essay
           ${MINGW_PACKAGE_PREFIX}-rime-luna-pinyin
           ${MINGW_PACKAGE_PREFIX}-rime-prelude
           ${MINGW_PACKAGE_PREFIX}-rime-stroke
           ${MINGW_PACKAGE_PREFIX}-rime-terra-pinyin)
}"
