cni: migrate to using buildGoPackage

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2018-12-20 08:22:13 +01:00
parent 8f9bd40d41
commit 5f7a34a264
No known key found for this signature in database
GPG Key ID: 083CC6FD6EB699A3
1 changed files with 6 additions and 12 deletions

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, go, removeReferencesTo }: { stdenv, fetchFromGitHub, buildGoPackage }:
stdenv.mkDerivation rec { buildGoPackage rec {
name = "cni-${version}"; name = "cni-${version}";
version = "0.6.0"; version = "0.6.0";
@ -11,29 +11,23 @@ stdenv.mkDerivation rec {
sha256 = "00ajs2r5r2z3l0vqwxrcwhjfc9px12qbcv5vnvs2mdipvvls1y2y"; sha256 = "00ajs2r5r2z3l0vqwxrcwhjfc9px12qbcv5vnvs2mdipvvls1y2y";
}; };
buildInputs = [ removeReferencesTo go ]; goPackagePath = "github.com/containernetworking/cni";
GOCACHE = "off";
buildPhase = '' buildPhase = ''
cd "go/src/${goPackagePath}"
patchShebangs build.sh patchShebangs build.sh
./build.sh ./build.sh
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/bin install -Dm555 bin/cnitool $bin/bin/cnitool
mv bin/cnitool $out/bin
'';
preFixup = ''
find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Container Network Interface - networking for Linux containers"; description = "Container Network Interface - networking for Linux containers";
license = licenses.asl20; license = licenses.asl20;
homepage = https://github.com/containernetworking/cni; homepage = https://github.com/containernetworking/cni;
maintainers = with maintainers; [offline]; maintainers = with maintainers; [ offline vdemeester ];
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];
}; };
} }