# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=vis
pkgver=0.4
_testver=0.2
pkgrel=1
pkgdesc="A vim like text editor"
url="https://github.com/martanne/vis"
arch="all"
license="ISC"
depends="!outils-vis lua5.3-lpeg"
depends_dev=""
makedepends="libtermkey-dev ncurses-dev acl-dev lua5.3-dev"
checkdepends="vim"
install=""
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/martanne/$pkgname/archive/v$pkgver.tar.gz
	$pkgname-test-$pkgver.tar.gz::https://github.com/martanne/$pkgname-test/archive/v$_testver.tar.gz
	fortify-source.patch"

_testdir="$srcdir"/$pkgname-test-$_testver
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	./configure \
		--prefix=/usr \
		--enable-lua \
		--enable-acl
	make
}

check() {
	cp -r "$_testdir"/* "$builddir"/test/
	make -C "$builddir" test
}

package() {
	make -C "$builddir" DESTDIR="$pkgdir" install
}

sha512sums="d8fcf667ecad7b32752d6c5dbd004544e1a9283775d54d93c24ce8f314b98154aed5c6014cc03223d8427c2b1e3fd0d4b348dfa12ce30236fddd93b34521ee5f  vis-0.4.tar.gz
892effa08c80c75e78eeb993ba8a0ddc110cc6f654fa1bf970454c35c839e9467b0ab41578f49af1fba0514c61f887fa044b9d01ab58f4dd749582a9550a2c29  vis-test-0.4.tar.gz
53a2f70a67e4fdb7462904428bbd556f5452989ada746ec8d67b7a90aabbf806377ef7d66d760d0d74ab3101d4af2154b1a59403fce60b20ef11476242cba713  fortify-source.patch"
