2023-05-07 08:27:01 +00:00
|
|
|
{ lib
|
|
|
|
, runCommand, glibc, glibc32
|
2014-07-10 07:55:50 +00:00
|
|
|
}:
|
|
|
|
|
2014-12-10 17:24:42 +00:00
|
|
|
let
|
|
|
|
nameVersion = builtins.parseDrvName glibc.name;
|
2015-12-05 16:40:37 +00:00
|
|
|
glibc64 = glibc;
|
2014-12-10 17:24:42 +00:00
|
|
|
in
|
|
|
|
runCommand "${nameVersion.name}-multi-${nameVersion.version}"
|
2022-05-29 16:25:54 +00:00
|
|
|
# out as the first output is an exception exclusive to glibc
|
2023-05-07 08:27:01 +00:00
|
|
|
{
|
|
|
|
outputs = [ "out" "bin" "dev" ]; # TODO: no static version here (yet)
|
|
|
|
passthru = {
|
|
|
|
libgcc = lib.lists.filter (x: x!=null) [
|
|
|
|
(glibc64.libgcc or null)
|
|
|
|
(glibc32.libgcc or null)
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
2014-07-10 07:55:50 +00:00
|
|
|
''
|
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"
|
2014-07-10 07:55:50 +00:00
|
|
|
|
|
|
|
# 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 12:11:39 +00: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"
|
2014-07-10 07:55:50 +00:00
|
|
|
|
2015-12-05 16:40:37 +00:00
|
|
|
mkdir "$dev"
|
2016-08-30 12:18:51 +00:00
|
|
|
cp -rs '${glibc32.dev}'/include "$dev/"
|
2015-12-05 16:40:37 +00:00
|
|
|
chmod +w -R "$dev"
|
2016-08-30 12:18:51 +00:00
|
|
|
cp -rsf '${glibc64.dev}'/include "$dev/"
|
2014-07-10 07:55:50 +00:00
|
|
|
''
|