summaryrefslogtreecommitdiff
path: root/testing/mage/APKBUILD
blob: 7cda53326cf61cfe4116162426c64e17451f9f39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Contributor: Mark Pashmfouroush <mark@markpash.me>
# Maintainer: Mark Pashmfouroush <mark@markpash.me>
pkgname=mage
pkgver=1.13.0
pkgrel=4
# Commit hash that corresponds to the version
_commit=3504e09d7fcfdeab6e70281edce5d5dfb205f31a
pkgdesc="make-like build tool using Go"
url="https://magefile.org/"
license="Apache-2.0"
arch="all"
depends="go"
options="chmod-clean net"
source="https://github.com/magefile/mage/archive/v$pkgver/mage-$pkgver.tar.gz"

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

build() {
	go build -o bin/mage -ldflags="
		-X \"github.com/magefile/mage/mage.timestamp=$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})\"
		-X \"github.com/magefile/mage/mage.commitHash=$_commit\"
		-X \"github.com/magefile/mage/mage.gitTag=$pkgver\"
		"
}

check() {
	export GOROOT=/usr/lib/go
	go vet ./...
	go test -v -tags CI ./...
}

package() {
	install -Dm0755 bin/mage "$pkgdir/usr/bin/mage"
}

sha512sums="
a393a0192ecaf8664f9dd35acfd994993ab1c028a08fb8c925fc569ce58dc9d58baeef4760b012563e3f3a6957c77d548bb33a6b577d12af2e030e2465e6d24b  mage-1.13.0.tar.gz
"