2017-03-11 15:07:56 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, removeReferencesTo
|
2018-07-21 02:44:44 +02:00
|
|
|
, go, btrfs-progs }:
|
2016-05-21 18:19:11 +02:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "containerd-${version}";
|
2018-12-16 10:17:35 +01:00
|
|
|
version = "1.2.1";
|
2016-05-21 18:19:11 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2017-08-29 02:22:00 +02:00
|
|
|
owner = "containerd";
|
2016-05-21 18:19:11 +02:00
|
|
|
repo = "containerd";
|
|
|
|
rev = "v${version}";
|
2018-12-16 10:17:35 +01:00
|
|
|
sha256 = "16zn6p1ky3yrgn53z8h9wza53ch91fj47wj5xgz6w4c57j30f66p";
|
2016-05-21 18:19:11 +02:00
|
|
|
};
|
|
|
|
|
2017-09-13 08:34:03 +02:00
|
|
|
hardeningDisable = [ "fortify" ];
|
|
|
|
|
|
|
|
buildInputs = [ removeReferencesTo go btrfs-progs ];
|
|
|
|
buildFlags = "VERSION=v${version}";
|
|
|
|
|
|
|
|
BUILDTAGS = []
|
|
|
|
++ optional (btrfs-progs == null) "no_btrfs";
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# Extract the source
|
|
|
|
cd "$NIX_BUILD_TOP"
|
|
|
|
mkdir -p "go/src/github.com/containerd"
|
|
|
|
mv "$sourceRoot" "go/src/github.com/containerd/containerd"
|
|
|
|
export GOPATH=$NIX_BUILD_TOP/go:$GOPATH
|
|
|
|
'';
|
2016-05-21 18:19:11 +02:00
|
|
|
|
|
|
|
preBuild = ''
|
2017-09-13 08:34:03 +02:00
|
|
|
cd go/src/github.com/containerd/containerd
|
|
|
|
patchShebangs .
|
2016-05-21 18:19:11 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/* $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
2017-03-11 15:07:56 +01:00
|
|
|
find $out -type f -exec remove-references-to -t ${go} '{}' +
|
2016-05-21 18:19:11 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2018-09-02 00:56:34 +02:00
|
|
|
homepage = https://containerd.io/;
|
2016-05-21 18:19:11 +02:00
|
|
|
description = "A daemon to control runC";
|
|
|
|
license = licenses.asl20;
|
2018-08-20 16:36:48 +02:00
|
|
|
maintainers = with maintainers; [ offline vdemeester ];
|
2016-05-21 18:19:11 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|