# Maintainer: Wesley van Tilburg <justwesley@protonmail.com>
pkgname=minify
pkgver=2.20.37
pkgrel=0
pkgdesc="Minifier CLI for HTML, CSS, JS, JSON, SVG and XML"
url="https://github.com/tdewolff/minify"
arch="all"
options="net"
license="MIT"
makedepends="go bash"
subpackages="$pkgname-bash-completion"
source="$pkgname-$pkgver.tar.gz::https://github.com/tdewolff/minify/archive/v$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	mkdir build
	go build -o build ./cmd/minify
}

check() {
	go test ./...
}

package() {
	install -Dm755 ./build/minify -t "$pkgdir"/usr/bin
	install -Dm644 ./cmd/minify/bash_completion "$pkgdir"/usr/share/bash-completion/completions/minify
}

sha512sums="
d40e90b5875e6f2957c16aa92d6c65e7d8e62516df95388d4112daefa84f76e42e4e0316ee8f9bdd4602729c97c37ad3a93b72e837cbf775fb5d44b9d7dd0b38  minify-2.20.37.tar.gz
"
