nixpkgs-suyu/pkgs/os-specific/linux/klibc/shrunk.nix
Eelco Dolstra 4624c8bc3f * klibShrunk: just the klibc binaries without header files etc; useful
for installation in initrds.

svn path=/nixpkgs/trunk/; revision=11125
2008-03-14 13:46:47 +00:00

20 lines
475 B
Nix

{stdenv, klibc}:
stdenv.mkDerivation {
name = "${klibc.name}";
buildCommand = ''
ensureDir $out/lib
cp -prd ${klibc}/lib/klibc/bin $out/
cp -p ${klibc}/lib/*.so $out/lib/
chmod +w $out/*
old=$(echo ${klibc}/lib/klibc-*.so)
new=$(echo $out/lib/klibc-*.so)
for i in $out/bin/*; do
echo $i
sed "s^$old^$new^" -i $i
# !!! use patchelf
#patchelf --set-rpath /foo/bar $i
done
''; # */
allowedReferences = ["out"];
}