Build using go and switch versioning scheme

This commit is contained in:
Manuel 2022-03-28 06:43:03 +02:00
parent db68a80477
commit 2a0929d868
Signed by: Manuel
GPG key ID: 4085037435E1F07A
2 changed files with 45 additions and 29 deletions

View file

@ -1,16 +1,17 @@
pkgbase = gvisor-git pkgbase = gvisor-git
pkgdesc = User-space kernel, sandboxed container runtime pkgdesc = OCI container sandbox runtime focused on security, efficiency, and ease of use
pkgver = r80.275a7b6 pkgver = 20220321.0.r15.gb8fa96e20
pkgrel = 1 pkgrel = 1
url = https://github.com/google/gvisor url = https://gvisor.dev
arch = x86_64 arch = x86_64
license = Apache-2.0 arch = aarch64
license = Apache
makedepends = git makedepends = git
makedepends = bazel makedepends = go
makedepends = python optdepends = docker: for Docker runtime support
provides = runsc provides = gvisor
source = git+https://github.com/google/gvisor conflicts = gvisor
sha256sums = SKIP source = git+https://github.com/google/gvisor#branch=go
sha512sums = SKIP
pkgname = gvisor-git pkgname = gvisor-git

View file

@ -1,30 +1,45 @@
# Maintainer: Vincent Kobel (v@kobl.one) # Maintainer: Manuel Hüsers <aur@huesers.de>
# Contributor: Vincent Kobel (v@kobl.one)
_pkgname='gvisor' pkgname='gvisor-git'
pkgname="${_pkgname}-git" _pkgbin='runsc'
pkgver=r80.275a7b6 _pkgshim='containerd-shim-runsc-v1'
pkgver=20220321.0.r15.gb8fa96e20
pkgrel=1 pkgrel=1
pkgdesc="User-space kernel, sandboxed container runtime" pkgdesc='OCI container sandbox runtime focused on security, efficiency, and ease of use'
arch=('x86_64') arch=('x86_64' 'aarch64')
url='https://github.com/google/gvisor' url='https://gvisor.dev'
license=('Apache-2.0') license=('Apache')
sha256sums=('SKIP') makedepends=('git' 'go')
source=("git+https://github.com/google/${_pkgname}") optdepends=('docker: for Docker runtime support')
provides=('runsc') provides=(
makedepends=('git' 'bazel' 'python') "${pkgname%-git}"
)
conflicts=(
"${pkgname%-git}"
)
source=("git+https://github.com/google/${pkgname%-git}#branch=go")
sha512sums=('SKIP')
pkgver() { pkgver() {
cd "${_pkgname}" cd "${pkgname%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/release-//g;s/-/./g'
} }
build() { build() {
cd "${srcdir}/${_pkgname}" cd "${pkgname%-git}"
bazel build runsc export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GO111MODULE=on
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
CGO_ENABLED=0 go build -v -o $_pkgbin -ldflags "-X main.version=${pkgver}" gvisor.dev/gvisor/runsc
go build -v -o $_pkgshim gvisor.dev/gvisor/shim
} }
package() { package() {
cd "${srcdir}/${_pkgname}" cd "${pkgname%-git}"
install -D ./bazel-bin/runsc/linux_amd64_pure_stripped/runsc "${pkgdir}/usr/bin/runsc" install -Dm 755 "$_pkgbin/$_pkgbin" "$pkgdir/usr/bin/$_pkgbin"
install -Dm 755 "$_pkgshim" "$pkgdir/usr/bin/$_pkgshim"
} }