kubernetes: use removeReferencesTo

This commit is contained in:
Joachim Fasting 2017-03-11 15:07:45 +01:00
parent 0a7673d202
commit 061ff21bbf
No known key found for this signature in database
GPG Key ID: 7544761007FE4E08

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, which, go, go-bindata, makeWrapper, rsync { stdenv, lib, fetchFromGitHub, removeReferencesTo, which, go, go-bindata, makeWrapper, rsync
, iptables, coreutils , iptables, coreutils
, components ? [ , components ? [
"cmd/kubeadm" "cmd/kubeadm"
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
sha256 = "1ps9bn5gqknyjv0b9jvp7xg3cyd4anq11j785p22347al0b8w81v"; sha256 = "1ps9bn5gqknyjv0b9jvp7xg3cyd4anq11j785p22347al0b8w81v";
}; };
buildInputs = [ makeWrapper which go rsync go-bindata ]; buildInputs = [ removeReferencesTo makeWrapper which go rsync go-bindata ];
outputs = ["out" "man" "pause"]; outputs = ["out" "man" "pause"];
@ -59,12 +59,7 @@ stdenv.mkDerivation rec {
''; '';
preFixup = '' preFixup = ''
# Remove references to go compiler find $out/bin $pause/bin -type f -exec remove-references-to -t ${go} '{}' +
while read file; do
cat $file | sed "s,${go},$(echo "${go}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" > $file.tmp
mv $file.tmp $file
chmod +x $file
done < <(find $out/bin $pause/bin -type f 2>/dev/null)
''; '';
meta = { meta = {