# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-popup
pkgver=0.5.9
pkgrel=0
_pkgreal=popup
pkgdesc="Visual popup user interface library"
url="https://github.com/auto-complete/popup-el"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/auto-complete/popup-el/archive/v$pkgver/emacs-popup-$pkgver.tar.gz"
builddir="$srcdir/popup-el-$pkgver"

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

check() {
	emacs -batch -q -no-site-file -L . \
		-l tests/run-test.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="
1a8c5ecb56e695f7a37915063d4e105cee92f8ae5a21e2e39ffe556dfdcf03c056b69f5e36c6ff3643713a914bb531adabcfbc525c531821e1520f7b3e93dc0b  emacs-popup-0.5.9.tar.gz
"
