1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/libraries/glibc/multi.nix

29 lines
824 B
Nix
Raw Normal View History

{ runCommand, glibc, glibc32
}:
let
nameVersion = builtins.parseDrvName glibc.name;
2015-12-05 16:40:37 +00:00
glibc64 = glibc;
in
runCommand "${nameVersion.name}-multi-${nameVersion.version}"
{ outputs = [ "bin" "dev" "out"]; } # TODO: no static version here (yet)
''
2015-12-05 16:40:37 +00:00
mkdir -p "$out/lib"
ln -s '${glibc64.out}'/lib/* "$out/lib"
ln -s '${glibc32.out}/lib' "$out/lib/32"
ln -s lib "$out/lib64"
# fixing ldd RLTDLIST
2015-12-05 16:40:37 +00:00
mkdir -p "$bin/bin"
cp -s '${glibc64.bin}'/bin/* "$bin/bin/"
rm "$bin/bin/ldd"
2015-10-07 13:11:39 +01:00
sed -e "s|^RTLDLIST=.*$|RTLDLIST=\"$out/lib/ld-linux-x86-64.so.2 $out/lib/32/ld-linux.so.2\"|g" \
2015-12-05 16:40:37 +00:00
'${glibc64.bin}/bin/ldd' > "$bin/bin/ldd"
chmod +x "$bin/bin/ldd"
2015-12-05 16:40:37 +00:00
mkdir "$dev"
cp -rs '${glibc32.dev}'/include "$dev/"
2015-12-05 16:40:37 +00:00
chmod +w -R "$dev"
cp -rsf '${glibc64.dev}'/include "$dev/"
''