default.nix (2103B)
1 { lib, fetchFromGitHub, buildGoPackage, btrfs-progs, go-md2man, utillinux, pkgconfig, libseccomp }: 2 3 with lib; 4 rec { 5 containerdGen = { version, sha256 }: 6 buildGoPackage rec { 7 pname = "containerd"; 8 name = "${pname}-${version}"; 9 10 src = fetchFromGitHub { 11 owner = "containerd"; 12 repo = "containerd"; 13 rev = "v${version}"; 14 sha256 = "${sha256}"; 15 }; 16 17 goPackagePath = "github.com/containerd/containerd"; 18 19 # FIXME: remove this 20 allowGoReference = true; 21 22 outputs = [ "out" "man" ]; 23 24 nativeBuildInputs = [ go-md2man utillinux pkgconfig ]; 25 26 buildInputs = [ btrfs-progs libseccomp ]; 27 28 buildFlags = [ "VERSION=v${version}" ]; 29 30 BUILDTAGS = [ ] 31 ++ optional (btrfs-progs == null) "no_btrfs"; 32 33 buildPhase = '' 34 cd go/src/${goPackagePath} 35 patchShebangs . 36 make binaries $buildFlags 37 ''; 38 39 installPhase = '' 40 for b in bin/*; do 41 install -Dm555 $b $out/$b 42 done 43 44 make man 45 manRoot="$man/share/man" 46 mkdir -p "$manRoot" 47 for manFile in man/*; do 48 manName="$(basename "$manFile")" # "docker-build.1" 49 number="$(echo $manName | rev | cut -d'.' -f1 | rev)" 50 mkdir -p "$manRoot/man$number" 51 gzip -c "$manFile" > "$manRoot/man$number/$manName.gz" 52 done 53 ''; 54 55 meta = { 56 homepage = "https://containerd.io/"; 57 description = "A daemon to control runC"; 58 license = licenses.asl20; 59 maintainers = with maintainers; [ offline vdemeester ]; 60 platforms = platforms.linux; 61 }; 62 }; 63 64 containerd_1_2 = makeOverridable containerdGen { 65 version = "1.2.13"; 66 sha256 = "1rac3iak3jpz57yarxc72bxgxvravwrl0j6s6w2nxrmh2m3kxqzn"; 67 }; 68 69 containerd_1_3 = makeOverridable containerdGen { 70 version = "1.3.6"; 71 sha256 = "1dd7kis8zfns0hc1q4xabwv07b4466wf8wh14c8sgx4rzw184fkw"; 72 }; 73 74 containerd_1_4 = makeOverridable containerdGen { 75 version = "1.4.0-beta.1"; 76 sha256 = "0q5cq42jkdpbxgikkzmvkkxpbjb3hjpv12i431b0z55cqqvc64mw"; 77 }; 78 }