3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #23748 from joachifm/use-remove-references-to

Use removeReferencesTo
This commit is contained in:
Joachim F 2017-03-12 15:07:49 +01:00 committed by GitHub
commit 6fce6c9adb
4 changed files with 13 additions and 29 deletions

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
, components ? [
"cmd/kubeadm"
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
sha256 = "1ps9bn5gqknyjv0b9jvp7xg3cyd4anq11j785p22347al0b8w81v";
};
buildInputs = [ makeWrapper which go rsync go-bindata ];
buildInputs = [ removeReferencesTo makeWrapper which go rsync go-bindata ];
outputs = ["out" "man" "pause"];
@ -59,12 +59,7 @@ stdenv.mkDerivation rec {
'';
preFixup = ''
# Remove references to go compiler
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)
find $out/bin $pause/bin -type f -exec remove-references-to -t ${go} '{}' +
'';
meta = {

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub
{ stdenv, lib, fetchFromGitHub, removeReferencesTo
, go, libapparmor, apparmor-parser, libseccomp }:
with lib;
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
sha256 = "16p8kixhzdx8afpciyf3fjx43xa3qrqpx06r5aqxdrqviw851zh8";
};
buildInputs = [ go ];
buildInputs = [ removeReferencesTo go ];
preBuild = ''
ln -s $(pwd) vendor/src/github.com/docker/containerd
@ -26,10 +26,7 @@ stdenv.mkDerivation rec {
'';
preFixup = ''
# remove references to go compiler
while read file; do
sed -ri "s,${go},$(echo "${go}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
done < <(find $out/bin -type f 2>/dev/null)
find $out -type f -exec remove-references-to -t ${go} '{}' +
'';
meta = {

View file

@ -1,5 +1,5 @@
{ stdenv, lib, fetchFromGitHub, makeWrapper, pkgconfig, go-md2man
, go, containerd, runc, docker-proxy, tini
{ stdenv, lib, fetchFromGitHub, makeWrapper, removeReferencesTo, pkgconfig
, go-md2man, go, containerd, runc, docker-proxy, tini
, sqlite, iproute, bridge-utils, devicemapper, systemd
, btrfs-progs, iptables, e2fsprogs, xz, utillinux, xfsprogs
, procps
@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
});
buildInputs = [
makeWrapper pkgconfig go-md2man go
makeWrapper removeReferencesTo pkgconfig go-md2man go
sqlite devicemapper btrfs-progs systemd
];
@ -126,12 +126,7 @@ stdenv.mkDerivation rec {
'';
preFixup = ''
# remove references to go compiler, gcc and glibc
while read file; do
sed -ri "s,${go},$(echo "${go}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
sed -ri "s,${stdenv.cc.cc},$(echo "${stdenv.cc.cc}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
sed -ri "s,${stdenv.glibc.dev},$(echo "${stdenv.glibc.dev}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
done < <(find $out -type f 2>/dev/null)
find $out -type f -exec remove-references-to -t ${go} -t ${stdenv.cc.cc} -t ${stdenv.glibc.dev} '{}' +
'';
meta = {

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, fetchpatch, go-md2man
{ stdenv, lib, fetchFromGitHub, fetchpatch, removeReferencesTo, go-md2man
, go, pkgconfig, libapparmor, apparmor-parser, libseccomp }:
with lib;
@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
hardeningDisable = ["fortify"];
buildInputs = [ go-md2man go pkgconfig libseccomp libapparmor apparmor-parser ];
buildInputs = [ removeReferencesTo go-md2man go pkgconfig libseccomp libapparmor apparmor-parser ];
makeFlags = ''BUILDTAGS+=seccomp BUILDTAGS+=apparmor'';
@ -61,10 +61,7 @@ stdenv.mkDerivation rec {
'';
preFixup = ''
# remove references to go compiler
while read file; do
sed -ri "s,${go},$(echo "${go}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
done < <(find $out/bin -type f 2>/dev/null)
find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
'';
meta = {