# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-circe
pkgver=2.13
pkgrel=0
_pkgreal=circe
pkgdesc="Client for IRC in Emacs"
url="https://github.com/emacs-circe/circe"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
checkdepends="emacs-buttercup"
source="https://github.com/emacs-circe/circe/archive/v$pkgver/emacs-circe-$pkgver.tar.gz
	fix-test-tracking.patch
	"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	emacs -batch -q -no-site-file -L . \
		-f batch-byte-compile \
		./*.el
	rm -v circe-pkg.elc
}

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

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

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

sha512sums="
10e5998fa211d5a340eacec6bf88fc4ef749fbae01cfbd8cd01204a7d4533d0ecb4dda54543667c5caf4f44142fef737dcc2750d44525f69dfff18e245cae02e  emacs-circe-2.13.tar.gz
696b5ebf5011dbf8a256a5350f03c58a15ee9d9f7b533628ec5f2644592141c287e7b98e67e0d0327e81c54a9888e938c510318c171b8b427924cbdadfe7bb5a  fix-test-tracking.patch
"
