# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-pyim-smzmdict
pkgver=0_git20210505
_gitrev=b66c7c52cfd862b3fdace04f49c2af6c394232b4
pkgrel=0
_pkgreal=pyim-smzmdict
pkgdesc="Sanma(triple) Zhengma dict for Emacs-pyim"
url="https://github.com/con5tella/pyim-smzmdict"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox emacs-pyim"
source="https://github.com/con5tella/pyim-smzmdict/archive/$_gitrev/emacs-pyim-smzmdict-$_gitrev.tar.gz"
builddir="$srcdir/$_pkgreal-$_gitrev"
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="
64c1add9965fb773f54500802c2a7e73589934431e7f6942dcc054b2773f2490c1a56579a111a8dc4c3296775b97dc9dec201aef413402957f9b98446cd77f2d  emacs-pyim-smzmdict-b66c7c52cfd862b3fdace04f49c2af6c394232b4.tar.gz
"
