2008-03-14 14:46:47 +01:00
|
|
|
{stdenv, klibc}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2008-05-22 14:01:24 +02:00
|
|
|
name = "${klibc.name}-shrunk";
|
2008-03-14 14:46:47 +01:00
|
|
|
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"];
|
|
|
|
}
|