# Template file for 'sq'
pkgname=sq
version=0.48.5
revision=1
build_style=go
go_import_path="github.com/neilotoole/sq"
go_ldflags="-X ${go_import_path}/cli/buildinfo.Version=v${version}"
go_build_tags="libsqlite3"
make_check_args="-skip=TestEmptyAsNull"
makedepends="sqlite-devel"
short_desc="CLI tool that provides jq-style access to structured data sources"
maintainer="icp <pangolin@vivaldi.net>"
license="MIT"
homepage="https://sq.io"
changelog="https://raw.githubusercontent.com/neilotoole/sq/master/CHANGELOG.md"
distfiles="https://github.com/neilotoole/sq/archive/refs/tags/v${version}.tar.gz
 https://github.com/neilotoole/sq/releases/download/v${version}/sq-${version}-linux-amd64.tar.gz"
checksum="4ed9cef836e66174b6e01c8d410cd393aeae7f7069a428a7ab2adcd1e282cf68
 f41667f940156715488f7f9f381702af10b074f8f4d3d36ba96e279854f6931c"
conflicts="squirrel sequoia-sq"

post_extract() {
	mv sq-${version}/* .
}

post_install() {
	for shell in bash fish zsh; do
		vcompletion "completions/sq.${shell}" "${shell}"
	done

	vman manpages/sq.1.gz
	vlicense LICENSE
}
