# Contributor: Shiz <hi@shiz.me>
# Maintainer: Shiz <hi@shiz.me>
pkgname=yodl
pkgver=4.02.00
pkgrel=0
pkgdesc="Pre-document language and tools to process it"
url="https://fbb-git.github.io/yodl/"
arch="all"
license="GPL-2.0"
makedepends="icmake bash perl flex bison ncurses"
subpackages="$pkgname-doc"
source="yodl-$pkgver.tar.gz::https://github.com/fbb-git/yodl/archive/$pkgver.tar.gz"
builddir="$srcdir/yodl-$pkgver/yodl"

prepare() {
	cd "$builddir"
	sed -i 's!DOCDOC\s*=.*$!DOCDOC = BASE + "/share/doc/yodl";!g' INSTALL.im
}

build() {
	cd "$builddir"
	local module; for module in programs macros man; do
		./build $module
	done
}

check() {
	cd "$builddir"
	# yodl likes to exit with a non-zero exit status with --version.
	./tmp/install/usr/bin/yodl --version | grep -q 'yodl version'
}

package() {
	cd "$builddir"
	local module; for module in programs macros man; do
		./build install $module "$pkgdir"
	done
}

sha512sums="ca3a2490bf54a0ce4e800a62a3de9a5cf37df96f0f553de89623ef6d36f07b65b7c09168e77d267d7fb79d900a8e8a6c6d3c17c4b733345001213f5450c02b13  yodl-4.02.00.tar.gz"
