pkgname=cgit-syntect-bat pkgver=0.24.0 pkgrel=1 pkgdesc="syntax pack based on bat for cgit-syntect" arch=(any) url="https://github.com/sharkdp/bat" makedepends=(bat cgit-syntect) source=("git+$url#commit=v$pkgver") sha256sums=(SKIP) pkgver() { bat --version | sed -n 's/^bat \([0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/p' } prepare() { sed -i 's/bat .*//' bat/assets/create.sh # don't automatically build sed -i 's/local submodule_prompt=unspecified/local submodule_prompt=y/' bat/assets/create.sh # don't prompt user sed -i 's/^trap reverse_patches .*$//' bat/assets/create.sh # don't reverse patches } build() { bat/assets/create.sh # prepare submodules and patches MODE=compile cgit-syntect $srcdir/bat/assets/syntaxes syntax.packdump # compile syntaxes } package() { install -Dm0755 -t "$pkgdir/usr/share/cgit-syntect" syntax.packdump }