mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 17:41:12 +00:00
a9c0329c08
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{ stdenv, lib, fetchFromGitHub, removeReferencesTo
|
|
, go, btrfs-progs }:
|
|
|
|
with lib;
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "containerd-${version}";
|
|
version = "1.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "containerd";
|
|
repo = "containerd";
|
|
rev = "v${version}";
|
|
sha256 = "03d244v85975bavmlg66kd283jdb22yyvwkwcgy91n63jhvvbadk";
|
|
};
|
|
|
|
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
|
|
'';
|
|
|
|
preBuild = ''
|
|
cd go/src/github.com/containerd/containerd
|
|
patchShebangs .
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp bin/* $out/bin
|
|
'';
|
|
|
|
preFixup = ''
|
|
find $out -type f -exec remove-references-to -t ${go} '{}' +
|
|
'';
|
|
|
|
meta = {
|
|
homepage = https://containerd.io/;
|
|
description = "A daemon to control runC";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ offline vdemeester ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|