containerd: misc fixes
- build man during buildPhase - use `src.rev` for `commit` - install completion
This commit is contained in:
parent
f37c665ea3
commit
d7d6f5507c
@ -1,12 +1,16 @@
|
|||||||
{ lib, fetchFromGitHub, buildGoPackage, btrfs-progs, go-md2man, installShellFiles, util-linux, nixosTests }:
|
{ lib
|
||||||
|
, fetchFromGitHub
|
||||||
with lib;
|
, buildGoPackage
|
||||||
|
, btrfs-progs
|
||||||
|
, go-md2man
|
||||||
|
, installShellFiles
|
||||||
|
, util-linux
|
||||||
|
, nixosTests
|
||||||
|
}:
|
||||||
|
|
||||||
buildGoPackage rec {
|
buildGoPackage rec {
|
||||||
pname = "containerd";
|
pname = "containerd";
|
||||||
version = "1.4.3";
|
version = "1.4.3";
|
||||||
# git commit for the above version's tag
|
|
||||||
commit = "269548fa27e0089a8b8278fc4fc781d7f65a939b";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "containerd";
|
owner = "containerd";
|
||||||
@ -22,29 +26,32 @@ buildGoPackage rec {
|
|||||||
|
|
||||||
buildInputs = [ btrfs-progs ];
|
buildInputs = [ btrfs-progs ];
|
||||||
|
|
||||||
buildFlags = [ "VERSION=v${version}" "REVISION=${commit}" ];
|
buildFlags = [ "VERSION=v${version}" "REVISION=${src.rev}" ];
|
||||||
|
|
||||||
BUILDTAGS = []
|
BUILDTAGS = [ ]
|
||||||
++ optional (btrfs-progs == null) "no_btrfs";
|
++ lib.optional (btrfs-progs == null) "no_btrfs";
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
cd go/src/${goPackagePath}
|
cd go/src/${goPackagePath}
|
||||||
patchShebangs .
|
patchShebangs .
|
||||||
make binaries $buildFlags
|
make binaries man $buildFlags
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
for b in bin/*; do
|
install -Dm555 bin/* -t $out/bin
|
||||||
install -Dm555 $b $out/$b
|
|
||||||
done
|
|
||||||
|
|
||||||
make man
|
|
||||||
installManPage man/*.[1-9]
|
installManPage man/*.[1-9]
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# completion installed separately so it can be overridden in docker
|
||||||
|
# can be moved to installPhase when docker uses containerd >= 1.4
|
||||||
|
postInstall = ''
|
||||||
|
installShellFiles --bash contrib/autocomplete/ctr
|
||||||
|
installShellFiles --zsh --name _ctr contrib/autocomplete/zsh_autocomplete
|
||||||
|
'';
|
||||||
|
|
||||||
passthru.tests = { inherit (nixosTests) docker; };
|
passthru.tests = { inherit (nixosTests) docker; };
|
||||||
|
|
||||||
meta = {
|
meta = with lib; {
|
||||||
homepage = "https://containerd.io/";
|
homepage = "https://containerd.io/";
|
||||||
description = "A daemon to control runC";
|
description = "A daemon to control runC";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user