# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=tree-sitter-markdown
pkgver=0.3.2
pkgrel=0
pkgdesc="A markdown grammar for tree-sitter"
url="https://github.com/tree-sitter-grammars/tree-sitter-markdown"
arch="all"
license="MIT"
makedepends="tree-sitter-dev"
subpackages="$pkgname-doc"
provides="tree-sitter-markdown-inline=$pkgver-r$pkgrel"
install_if="tree-sitter-grammars"
source="$pkgname-$pkgver.tar.gz::https://github.com/tree-sitter-grammars/tree-sitter-markdown/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # no tests for shared lib

_langs='markdown markdown-inline'

build() {
	local lang; for lang in $_langs; do
		abuild-tree-sitter build -s "tree-sitter-$lang/src"
	done
}

package() {
	local lang; for lang in $_langs; do
		DESTDIR="$pkgdir" abuild-tree-sitter install -s "tree-sitter-$lang/src"
	done
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
04064c3384e0a9f8f1336c4587d15b14cf6a01a4579034c64f99ee85cb0fe1bc217b2f802c53f542ca40db20e7ce3b0bfef0bfe398dd2731caed47360a09ac5b  tree-sitter-markdown-0.3.2.tar.gz
"
