summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8c594da85629ec6c64e67575feb24f8d83475017 (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
41
42
43
44
45
# Maintainer: Manuel Hüsers <aur@huesers.de>
# Contributor: Vincent Kobel (v@kobl.one)

pkgname='gvisor-git'
_pkgbin='runsc'
_pkgshim='containerd-shim-runsc-v1'
pkgver=20240401.0
pkgrel=1
pkgdesc='OCI container sandbox runtime focused on security, efficiency, and ease of use'
arch=('x86_64' 'aarch64')
url='https://gvisor.dev'
license=('Apache')
makedepends=('git' 'go')
optdepends=('docker: for Docker runtime support')
provides=(
	"${pkgname%-git}"
)
conflicts=(
	"${pkgname%-git}"
)
source=("git+https://github.com/google/${pkgname%-git}#branch=go")
sha512sums=('SKIP')

pkgver() {
	cd "${pkgname%-git}"
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/release-//g;s/-/./g'
}

build() {
	cd "${pkgname%-git}"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export CGO_LDFLAGS="${LDFLAGS}"
	export GOPATH="${srcdir}"
	export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
	go build -v -o "bin/$_pkgbin" -ldflags "-linkmode=external -compressdwarf=false -X gvisor.dev/gvisor/runsc/version.version=${pkgver}" gvisor.dev/gvisor/runsc
	go build -v -o "bin/$_pkgshim" -ldflags "-linkmode=external -compressdwarf=false" gvisor.dev/gvisor/shim
}

package() {
	cd "${pkgname%-git}"
	install -Dm 755 "bin/$_pkgbin" "$pkgdir/usr/bin/$_pkgbin"
	install -Dm 755 "bin/$_pkgshim" "$pkgdir/usr/bin/$_pkgshim"
}