mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 22:53:42 +00:00
d7d6f5507c
- build man during buildPhase - use `src.rev` for `commit` - install completion
62 lines
1.4 KiB
Nix
62 lines
1.4 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, buildGoPackage
|
|
, btrfs-progs
|
|
, go-md2man
|
|
, installShellFiles
|
|
, util-linux
|
|
, nixosTests
|
|
}:
|
|
|
|
buildGoPackage rec {
|
|
pname = "containerd";
|
|
version = "1.4.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "containerd";
|
|
repo = "containerd";
|
|
rev = "v${version}";
|
|
sha256 = "09xvhjg5f8h90w1y94kqqnqzhbhd62dcdd9wb9sdqakisjk6zrl0";
|
|
};
|
|
|
|
goPackagePath = "github.com/containerd/containerd";
|
|
outputs = [ "out" "man" ];
|
|
|
|
nativeBuildInputs = [ go-md2man installShellFiles util-linux ];
|
|
|
|
buildInputs = [ btrfs-progs ];
|
|
|
|
buildFlags = [ "VERSION=v${version}" "REVISION=${src.rev}" ];
|
|
|
|
BUILDTAGS = [ ]
|
|
++ lib.optional (btrfs-progs == null) "no_btrfs";
|
|
|
|
buildPhase = ''
|
|
cd go/src/${goPackagePath}
|
|
patchShebangs .
|
|
make binaries man $buildFlags
|
|
'';
|
|
|
|
installPhase = ''
|
|
install -Dm555 bin/* -t $out/bin
|
|
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; };
|
|
|
|
meta = with lib; {
|
|
homepage = "https://containerd.io/";
|
|
description = "A daemon to control runC";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ offline vdemeester ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|