2008-03-14 13:46:47 +00:00
|
|
|
{stdenv, klibc}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2008-05-28 15:33:49 +01:00
|
|
|
# !!! For now, the name has to be exactly as long as the original
|
|
|
|
# name due to the sed hackery below. Once patchelf 0.4 is in the
|
|
|
|
# tree, we can do this properly.
|
|
|
|
#name = "${klibc.name}-shrunk";
|
|
|
|
name = "${klibc.name}";
|
2008-03-14 13:46:47 +00:00
|
|
|
buildCommand = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/lib
|
2015-04-26 18:54:51 +01:00
|
|
|
cp -prd ${klibc.out}/lib/klibc/bin $out/
|
|
|
|
cp -p ${klibc.out}/lib/*.so $out/lib/
|
2008-03-14 13:46:47 +00:00
|
|
|
chmod +w $out/*
|
2015-04-26 18:54:51 +01:00
|
|
|
old=$(echo ${klibc.out}/lib/klibc-*.so)
|
2008-03-14 13:46:47 +00:00
|
|
|
new=$(echo $out/lib/klibc-*.so)
|
|
|
|
for i in $out/bin/*; do
|
|
|
|
echo $i
|
|
|
|
sed "s^$old^$new^" -i $i
|
|
|
|
# !!! use patchelf
|
2008-05-28 15:33:49 +01:00
|
|
|
#patchelf --set-interpreter $new $i
|
2008-03-14 13:46:47 +00:00
|
|
|
done
|
|
|
|
''; # */
|
|
|
|
allowedReferences = ["out"];
|
2016-08-02 17:06:29 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
2008-03-14 13:46:47 +00:00
|
|
|
}
|