mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 20:36:40 +02:00
78 lines
2.3 KiB
Plaintext
78 lines
2.3 KiB
Plaintext
maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
|
|
pkgname=kraftkit
|
|
pkgver=0.12.3
|
|
pkgrel=5
|
|
pkgdesc="CLI tool to build and use customized unikernel VMs"
|
|
url="https://unikraft.org/"
|
|
# Officially supported architectures
|
|
# Ref: https://github.com/unikraft/unikraft/tree/staging/arch
|
|
arch="x86_64 aarch64 armhf armv7"
|
|
license="BSD-3-Clause"
|
|
makedepends="
|
|
go
|
|
btrfs-progs-dev
|
|
gpgme-dev
|
|
"
|
|
subpackages="
|
|
$pkgname-doc
|
|
$pkgname-bash-completion
|
|
$pkgname-zsh-completion
|
|
$pkgname-fish-completion
|
|
runu:_runu
|
|
"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/unikraft/kraftkit/archive/refs/tags/v$pkgver.tar.gz"
|
|
options="net" # download Go modules
|
|
|
|
build() {
|
|
local _goldflags="
|
|
-X kraftkit.sh/internal/version.buildTime=$(date -u "+%Y-%m-%dT%H:%M:%S%z" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
|
|
-X kraftkit.sh/internal/version.commit=AlpineLinux
|
|
-X kraftkit.sh/internal/version.version=v$pkgver
|
|
-X kraftkit.sh/internal/cli/kraft.sentryDsn=
|
|
"
|
|
|
|
# TODO: build with additional `xen` tag
|
|
# error: assignment of read-only variable '_cgo_r' when building xenlight module
|
|
go build -v -o "$builddir" \
|
|
-ldflags "$_goldflags" \
|
|
-tags containers_image_storage_stub,containers_image_openpgp,netgo,osusergo \
|
|
./cmd/...
|
|
|
|
go run -tags containers_image_storage_stub,containers_image_openpgp,netgo,osusergo ./tools/genman \
|
|
generate ./docs/man/
|
|
|
|
for shell in bash fish zsh; do
|
|
./kraft completion $shell > kraft.$shell
|
|
done
|
|
}
|
|
|
|
check() {
|
|
# initrd tests try to start an ephemeral Docker container
|
|
# shellcheck disable=SC2046
|
|
go test \
|
|
-tags containers_image_storage_stub,containers_image_openpgp,osusergo,netgo \
|
|
$(go list ./... | grep -vF -e '/test/e2e' -e '/tools' -e '/initrd')
|
|
}
|
|
|
|
package() {
|
|
install -Dm755 kraft runu -t "$pkgdir"/usr/bin/
|
|
|
|
install -Dm644 docs/man/*.1.gz -t "$pkgdir"/usr/share/man/man1/
|
|
|
|
install -Dm644 kraft.bash \
|
|
"$pkgdir"/usr/share/bash-completion/completions/kraft
|
|
install -Dm644 kraft.zsh \
|
|
"$pkgdir"/usr/share/zsh/site-functions/_kraft
|
|
install -Dm644 kraft.fish \
|
|
"$pkgdir"/usr/share/fish/vendor_completions.d/kraft.fish
|
|
}
|
|
|
|
_runu() {
|
|
pkgdesc="OCI runtime for running Unikraft unikernels"
|
|
amove usr/bin/runu
|
|
}
|
|
|
|
sha512sums="
|
|
9d47b84aa9d984d43cac1e699302ac7e194fd7b16deee6d62cca0bcfa5264f25d62c86d03b62f05b5e809001d2dcb434efb3c16af34c13d745b1538728f7df32 kraftkit-0.12.3.tar.gz
|
|
"
|