# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-pyim-wbdict
pkgver=0.3.0
pkgrel=0
_pkgreal=pyim-wbdict
pkgdesc="Wubi dicts for Emacs-pyim"
url="https://github.com/tumashu/pyim-wbdict"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox emacs-pyim"
source="https://github.com/tumashu/pyim-wbdict/archive/$pkgver/emacs-pyim-wbdict-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
options="!check" # no tests provided

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

package() {
	install -Dvm644 ./*.el ./*.elc ./*.pyim \
		-t "$pkgdir"/usr/share/emacs/site-lisp/pyim/

	cd "$pkgdir"/usr/share/emacs/site-lisp/pyim
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
5dc31ab05cefea833f3232853d6f4dddf1b0ff115969f4934093fa329f23c2edcb36176d3b3959c9632c3ee78138e3dfc8ca0a07edc03965c6a970158c7c8ba5  emacs-pyim-wbdict-0.3.0.tar.gz
"
