git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #107778 from zowoq/containerd

containerd: misc fixes

commitf13837054b2a40f167fbabcf42d9e868cb075fae authorFlorian Klink <flokli@flokli.de> dateTue 29 Dec 2020, 01:04 (6 years ago) parent86bee6a824cfdd
2 files changed+24−15
pkgs/applications/virtualization/containerd/default.nix+22−15 pkgs/applications/virtualization/docker/default.nix+2
pkgs/applications/virtualization/containerd/default.nix+22−15
@@ -1,12 +1,16 @@
1−{ lib, fetchFromGitHub, buildGoPackage, btrfs-progs, go-md2man, installShellFiles, util-linux, nixosTests }:
2−
3−with lib;
1+{ lib
2+, fetchFromGitHub
3+, buildGoPackage
4+, btrfs-progs
5+, go-md2man
6+, installShellFiles
7+, util-linux
8+, nixosTests
9+}:
410
511buildGoPackage rec {
612 pname = "containerd";
713 version = "1.4.3";
8− # git commit for the above version's tag
9− commit = "269548fa27e0089a8b8278fc4fc781d7f65a939b";
1014
1115 src = fetchFromGitHub {
1216 owner = "containerd";
@@ -22,29 +26,32 @@ buildGoPackage rec {
2226
2327 buildInputs = [ btrfs-progs ];
2428
25− buildFlags = [ "VERSION=v${version}" "REVISION=${commit}" ];
29+ buildFlags = [ "VERSION=v${version}" "REVISION=${src.rev}" ];
2630
27− BUILDTAGS = []
28− ++ optional (btrfs-progs == null) "no_btrfs";
31+ BUILDTAGS = [ ]
32+ ++ lib.optional (btrfs-progs == null) "no_btrfs";
2933
3034 buildPhase = ''
3135 cd go/src/${goPackagePath}
3236 patchShebangs .
33− make binaries $buildFlags
37+ make binaries man $buildFlags
3438 '';
3539
3640 installPhase = ''
37− for b in bin/*; do
38− install -Dm555 $b $out/$b
39− done
40−
41− make man
41+ install -Dm555 bin/* -t $out/bin
4242 installManPage man/*.[1-9]
4343 '';
4444
45+ # completion installed separately so it can be overridden in docker
46+ # can be moved to installPhase when docker uses containerd >= 1.4
47+ postInstall = ''
48+ installShellFiles --bash contrib/autocomplete/ctr
49+ installShellFiles --zsh --name _ctr contrib/autocomplete/zsh_autocomplete
50+ '';
51+
4552 passthru.tests = { inherit (nixosTests) docker; };
4653
47− meta = {
54+ meta = with lib; {
4855 homepage = "https://containerd.io/";
4956 description = "A daemon to control runC";
5057 license = licenses.asl20;
pkgs/applications/virtualization/docker/default.nix+2
@@ -41,6 +41,8 @@ rec {
4141 rev = containerdRev;
4242 sha256 = containerdSha256;
4343 };
44+ # disable completion, can be removed when docker uses containerd >= 1.4
45+ postInstall = [];
4446 # This should be removed once Docker uses containerd >=1.4
4547 nativeBuildInputs = oldAttrs.nativeBuildInputs ++ lib.optional withlibseccomp pkgconfig;
4648 buildInputs = oldAttrs.buildInputs ++ lib.optional withlibseccomp libseccomp;