# Contributor: Phil Estes <estesp@gmail.com>
# Maintainer: Phil Estes <estesp@gmail.com>
pkgname=manifest-tool
pkgver=2.2.0
_pkgcommit=51f8b037521e04178cc9d540304fd0034d3d449c
pkgrel=1
pkgdesc="tool for inspecting and creating multi-platform container images"
url="https://github.com/estesp/manifest-tool"
arch="all"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/estesp/manifest-tool/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/manifest-tool-$pkgver/"

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

build() {
	msg "Building manifest-tool"
	cd v2 && go build \
		-ldflags "-X main.gitCommit=$_pkgcommit -X main.version=$pkgver" \
		-o ../manifest-tool github.com/estesp/manifest-tool/v2/cmd/manifest-tool
}

check() {
	echo "no check"
}

package() {
	install -Dm0755 manifest-tool -t "$pkgdir"/usr/bin/
}

sha512sums="
911831cff5ad0b20d9bfd499cede73d678b9897d292f6967af50175dfbe2c77fbd991d4aaf9438b894b4d6f3e29ba63457b1f24c3478c39e590eb22865ff0e96  manifest-tool-2.2.0.tar.gz
"
