# Contributor: Francesco Camuffo <dev@fmac.xyz>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=ugrep
pkgver=6.5.0
pkgrel=0
pkgdesc="Ultra fast grep with interactive query UI and fuzzy search"
url="https://ugrep.com/"
arch="all"
license="BSD-3-Clause"
checkdepends="bash"
makedepends="
	brotli-dev
	bzip2-dev
	bzip3-dev
	linux-headers
	lz4-dev
	pcre2-dev
	xz-dev
	zlib-dev
	zstd-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/Genivia/ugrep/archive/refs/tags/v$pkgver.tar.gz"

build() {
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--with-bzip3
	make
}

check() {
	make test
}

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

sha512sums="
247a1d9cdf18bc85bd9823f37ba83acda4a43cc02af16458d7a2f8ae44c1acf860d9a765cd42105d9c61f4e1cea29b0a4ad09d9522c3a0a79b6de44b959ee409  ugrep-6.5.0.tar.gz
"
