# Contributor: Phil Estes <estesp@gmail.com>
# Maintainer: Phil Estes <estesp@gmail.com>
pkgname=manifest-tool
pkgver=2.1.7
_pkgcommit=51f8b037521e04178cc9d540304fd0034d3d449c
pkgrel=0
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="
62d287ec5d9ff69bc5db323fcd9f38b0627951c7c47d73dd8d6cc613c60ed184196cf519c3d9ae170918b976954b97264580809e1937939484432b955f2b1994  manifest-tool-2.1.7.tar.gz
"
