1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
6 pkgdesc='Docker-compatible CLI for containerd'
8 url='https://github.com/containerd/nerdctl'
10 depends=('containerd')
11 makedepends=('git' 'go')
13 'buildkit: to build OCI images'
14 'cni-plugins: to run OCI images'
15 'rootlesskit: for rootless mode'
16 'slirp4netns: for rootless mode'
19 _commit='b224b280ff3086516763c7335fc0e0997aca617a'
21 "$pkgname::git+$url.git#commit=$_commit"
22 'skip-failing-test.patch'
25 'c168de6147edcebf31df4b2e22dc830cad62b81780d10105aada8e17347523747d413c4398bec3840f079a37177b6f9c3ca87c8f0119f4f651f7e4c6462eb8b3')
27 'c4dd2803d0fb6ef0067ee2ec3fb34f606618e157264e03f9b607629900b11a774f484c8cb320054f90911400bb436ca65f024bf5d63f39766e5b7f19fd8814e5')
31 git describe --tags | sed 's/^v//'
37 # create directory for build output
40 # download dependencies
41 export GOPATH="${srcdir}"
44 # skip failing unit test
45 patch -p1 -i ../skip-failing-test.patch
52 export CGO_CPPFLAGS="${CPPFLAGS}"
53 export CGO_CFLAGS="${CFLAGS}"
54 export CGO_CXXFLAGS="${CXXFLAGS}"
55 export GOPATH="${srcdir}"
61 -ldflags "-compressdwarf=false \
63 -extldflags ${LDFLAGS} \
64 -X github.com/containerd/nerdctl/pkg/version.Version=$pkgver \
65 -X github.com/containerd/nerdctl/pkg/version.Revision=$_commit" \
69 # generate shell auto-completions
70 for completion in bash fish zsh; do
71 ./build/nerdctl completion "$completion" > "build/$completion-completions"
84 # binary & rootless scripts
85 install -vDm755 -t "$pkgdir/usr/bin" build/nerdctl extras/rootless/*.sh
88 install -vDm644 build/bash-completions "$pkgdir/usr/share/bash-completion/completions/$pkgname"
89 install -vDm644 build/fish-completions "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"
90 install -vDm644 build/zsh-completions "$pkgdir/usr/share/zsh/site-functions/_$pkgname"