# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=apx
pkgver=2.4.3
pkgrel=0
pkgdesc="A package manager that can install packages from multiple sources without altering the root filesystem"
url="https://github.com/Vanilla-OS/apx"
license="GPL-3.0-only"
# s390x, riscv64, armv7, armhf and x86 blocked by podman -> distrobox
arch="x86_64 aarch64 ppc64le"
depends="distrobox"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Vanilla-OS/apx/archive/refs/tags/v$pkgver.tar.gz
	config.json
	"
# net required to download go modules
# no tests
options="net !check"

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

build() {
	go build -trimpath -v -o apx
}

package() {
	install -Dm755 apx "$pkgdir"/usr/bin/apx
	install -Dm644 "$srcdir"/config.json "$pkgdir"/usr/share/apx/config.json

	install -Dm755 man/man1/apx.1 "$pkgdir"/usr/share/man/man1/apx.1
}

sha512sums="
ab5cb0fe895c98f49f616d0ded959e7adf33b710ceaa8129e5bed0c0047c90f18bc6970e219f0d2464ebe2b21854f81155e64f3230780cc6e1c66e04699dfc70  apx-2.4.3.tar.gz
0d0e999b5b2e714bcd63e69357740a805cf3670c2e9d03c36700de17aec0445e56cb1da27b1b192fe11287beb98833d616fcc51937872b845bdb693ea9901929  config.json
"
