2018-12-07 21:14:03 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, go, removeReferencesTo }:
|
2018-03-17 05:35:35 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "cni-plugins-${version}";
|
2019-04-07 23:30:30 +01:00
|
|
|
version = "0.7.5";
|
2018-03-17 05:35:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "containernetworking";
|
|
|
|
repo = "plugins";
|
|
|
|
rev = "v${version}";
|
2019-04-07 23:30:30 +01:00
|
|
|
sha256 = "1kfi0iz2hs4rq3cdkw12j8d47ac4f5vrpzcwcrs2yzmh2j4n5sz5";
|
2018-03-17 05:35:35 +00:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:14:03 +00:00
|
|
|
buildInputs = [ removeReferencesTo go ];
|
|
|
|
|
2018-03-17 05:35:35 +00:00
|
|
|
buildPhase = ''
|
|
|
|
patchShebangs build.sh
|
2019-02-28 01:46:32 +00:00
|
|
|
export "GOCACHE=$TMPDIR/go-cache"
|
2018-03-17 05:35:35 +00:00
|
|
|
./build.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv bin/* $out/bin
|
|
|
|
'';
|
|
|
|
|
2018-12-07 21:14:03 +00:00
|
|
|
preFixup = ''
|
|
|
|
find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
|
|
|
|
'';
|
|
|
|
|
2018-03-17 05:35:35 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Some standard networking plugins, maintained by the CNI team";
|
|
|
|
homepage = https://github.com/containernetworking/plugins;
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ cstrahan ];
|
|
|
|
};
|
|
|
|
}
|