2017-03-11 14:07:56 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, removeReferencesTo
|
2017-09-13 07:34:03 +01:00
|
|
|
, go, libapparmor, apparmor-parser, libseccomp, btrfs-progs }:
|
2016-05-21 17:19:11 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "containerd-${version}";
|
2017-09-13 07:34:03 +01:00
|
|
|
version = "1.0.1";
|
2016-05-21 17:19:11 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2017-08-29 01:22:00 +01:00
|
|
|
owner = "containerd";
|
2016-05-21 17:19:11 +01:00
|
|
|
repo = "containerd";
|
|
|
|
rev = "v${version}";
|
2017-09-13 07:34:03 +01:00
|
|
|
sha256 = "0kfafqi66yp4qy738pl11f050hfrx9m4kc670qpx7fmf9ii7q6p2";
|
2016-05-21 17:19:11 +01:00
|
|
|
};
|
|
|
|
|
2017-09-13 07:34:03 +01: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 17:19:11 +01:00
|
|
|
|
|
|
|
preBuild = ''
|
2017-09-13 07:34:03 +01:00
|
|
|
cd go/src/github.com/containerd/containerd
|
|
|
|
patchShebangs .
|
2016-05-21 17:19:11 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/* $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
2017-03-11 14:07:56 +00:00
|
|
|
find $out -type f -exec remove-references-to -t ${go} '{}' +
|
2016-05-21 17:19:11 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://containerd.tools/;
|
|
|
|
description = "A daemon to control runC";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ offline ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|