# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-fsm
pkgver=0.2.1_git20221212
_gitrev=595d57373934ad94423c7f37a6c9cce5df81ec6c
pkgrel=0
_pkgreal=fsm
pkgdesc="State machine library inspired by Erlang's gen_fsm"
url="https://elpa.gnu.org/packages/fsm.html"
arch="noarch"
license="GPL-2.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/emacsmirror/fsm/archive/$_gitrev/emacs-fsm-$_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 \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

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

sha512sums="
538a1bd02c607bc56f28da07ea0c1341c37ee2a04b878e81fd2e4c56f4260779287004fcc329b43dd43ecfe9c75e9dbd4b8a107efdfdb71ae9fd7b8b38ad1bfd  emacs-fsm-595d57373934ad94423c7f37a6c9cce5df81ec6c.tar.gz
"
