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}";
|
2018-11-19 21:10:48 +00:00
|
|
|
version = "0.7.4";
|
2018-03-17 05:35:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "containernetworking";
|
|
|
|
repo = "plugins";
|
|
|
|
rev = "v${version}";
|
2018-11-19 21:10:48 +00:00
|
|
|
sha256 = "1sywllwnr6lc812sgkqjdd3y10r82shl88dlnwgnbgzs738q2vp2";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|