# Maintainer: Caleb Maclennan pkgname=devbox pkgver=0.10.6 pkgrel=1 pkgdesc='A cli tool to easily create isolated shells and containers' arch=(x86_64) url="https://github.com/jetpack-io/$pkgname" license=(Apache-2.0) depends=(nix) makedepends=(go) optdepends=('docker: for container support') _archive="$pkgname-$pkgver" source=("$url/archive/$pkgver/$_archive.tar.gz") sha256sums=('c09df93c93bf628ec254d008897246633e1690e88307d7dae0e47a6a569a0c4a') prepare(){ cd "$_archive" export GOPATH="$srcdir" go mod download } build() { cd "$_archive" export GOPATH="$srcdir" local _prefix=go.jetpack.io/devbox/build go build \ -trimpath \ -buildmode=pie \ -mod=readonly \ -modcacherw \ -ldflags "-linkmode external -extldflags \"$LDFLAGS\" -X $_prefix.Version=$pkgver" \ -o $pkgname cmd/devbox/main.go } check() { cd "$_archive" export GOPATH="$srcdir" # go test ./boxcli } package() { cd "$_archive" install -Dm0755 -t "$pkgdir/usr/bin/" "$pkgname" }