# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-async
pkgver=1.9.8
pkgrel=0
_pkgreal=async
pkgdesc="Simple library for asynchronous processing"
url="https://github.com/jwiegley/emacs-async"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
checkdepends="emacs-buttercup"
source="https://github.com/jwiegley/emacs-async/archive/v$pkgver/emacs-async-$pkgver.tar.gz"

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

check() {
	HOME="$srcdir" buttercup -L . --traceback pretty
}

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

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

sha512sums="
c4c5406ce28dbfea0130b43a7f85d0a47626cf630c73318280896bd28f29bf5a8949077c242cd9c6162fecabbc619b2a270d532df341c4e286f1f7bb499da5f3  emacs-async-1.9.8.tar.gz
"
