From 5f7a34a2645a795832a453a2d5581750d7a0b9ba Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Thu, 20 Dec 2018 08:22:13 +0100 Subject: [PATCH] cni: migrate to using buildGoPackage Signed-off-by: Vincent Demeester --- .../networking/cluster/cni/default.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/networking/cluster/cni/default.nix b/pkgs/applications/networking/cluster/cni/default.nix index 130ccdc83111..3f342ea04a03 100644 --- a/pkgs/applications/networking/cluster/cni/default.nix +++ b/pkgs/applications/networking/cluster/cni/default.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchFromGitHub, go, removeReferencesTo }: +{ stdenv, fetchFromGitHub, buildGoPackage }: -stdenv.mkDerivation rec { +buildGoPackage rec { name = "cni-${version}"; version = "0.6.0"; @@ -11,29 +11,23 @@ stdenv.mkDerivation rec { sha256 = "00ajs2r5r2z3l0vqwxrcwhjfc9px12qbcv5vnvs2mdipvvls1y2y"; }; - buildInputs = [ removeReferencesTo go ]; - - GOCACHE = "off"; + goPackagePath = "github.com/containernetworking/cni"; buildPhase = '' + cd "go/src/${goPackagePath}" patchShebangs build.sh ./build.sh ''; installPhase = '' - mkdir -p $out/bin - mv bin/cnitool $out/bin - ''; - - preFixup = '' - find $out/bin -type f -exec remove-references-to -t ${go} '{}' + + install -Dm555 bin/cnitool $bin/bin/cnitool ''; meta = with stdenv.lib; { description = "Container Network Interface - networking for Linux containers"; license = licenses.asl20; homepage = https://github.com/containernetworking/cni; - maintainers = with maintainers; [offline]; + maintainers = with maintainers; [ offline vdemeester ]; platforms = [ "x86_64-linux" ]; }; }