git.iko.soy/typeable/nixpkgs
on master help sign in
containerd: misc fixes

- build man during buildPhase - use `src.rev` for `commit` - install completion

commitd7d6f5507c9b3b551d7b02ac8d2021b66c5e176d authorzowoq <59103226+zowoq@users.noreply.github.com> dateThu 3 Dec 2020, 07:23 (6 years ago) parentf37c665
1 file changed+22−15
pkgs/applications/virtualization/containerd/default.nix+22−15
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;