git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #51682 from adisbladis/closure-size/cni

cni/cni-plugins: Remove go references

commit7574d4ef15dfd28cde1f728d81a46d94fa64bfe6 authoradisbladis <adisbladis@gmail.com> dateFri 7 Dec 2018, 22:15 (8 years ago) parentca3f0892a7b82c
2 files changed+16−4
pkgs/applications/networking/cluster/cni/default.nix+8−2 pkgs/applications/networking/cluster/cni/plugins.nix+8−2
pkgs/applications/networking/cluster/cni/default.nix+8−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub, go }:
1+{ stdenv, fetchFromGitHub, go, removeReferencesTo }:
22
33stdenv.mkDerivation rec {
44 name = "cni-${version}";
@@ -11,7 +11,9 @@ stdenv.mkDerivation rec {
1111 sha256 = "00ajs2r5r2z3l0vqwxrcwhjfc9px12qbcv5vnvs2mdipvvls1y2y";
1212 };
1313
14− buildInputs = [ go ];
14+ buildInputs = [ removeReferencesTo go ];
15+
16+ GOCACHE = "off";
1517
1618 buildPhase = ''
1719 patchShebangs build.sh
@@ -23,6 +25,10 @@ stdenv.mkDerivation rec {
2325 mv bin/cnitool $out/bin
2426 '';
2527
28+ preFixup = ''
29+ find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
30+ '';
31+
2632 meta = with stdenv.lib; {
2733 description = "Container Network Interface - networking for Linux containers";
2834 license = licenses.asl20;
pkgs/applications/networking/cluster/cni/plugins.nix+8−2
@@ -1,4 +1,4 @@
1−{ stdenv, lib, fetchFromGitHub, go }:
1+{ stdenv, lib, fetchFromGitHub, go, removeReferencesTo }:
22
33stdenv.mkDerivation rec {
44 name = "cni-plugins-${version}";
@@ -11,7 +11,9 @@ stdenv.mkDerivation rec {
1111 sha256 = "1sywllwnr6lc812sgkqjdd3y10r82shl88dlnwgnbgzs738q2vp2";
1212 };
1313
14− buildInputs = [ go ];
14+ buildInputs = [ removeReferencesTo go ];
15+
16+ GOCACHE = "off";
1517
1618 buildPhase = ''
1719 patchShebangs build.sh
@@ -23,6 +25,10 @@ stdenv.mkDerivation rec {
2325 mv bin/* $out/bin
2426 '';
2527
28+ preFixup = ''
29+ find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
30+ '';
31+
2632 meta = with lib; {
2733 description = "Some standard networking plugins, maintained by the CNI team";
2834 homepage = https://github.com/containernetworking/plugins;