4624c8bc3f
for installation in initrds. svn path=/nixpkgs/trunk/; revision=11125
20 lines
475 B
Nix
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"];
|
|
}
|