gcc, glibc: merge changes from original multiple-output

Can't be done automatically because of file copies/moves.
This commit is contained in:
Vladimír Čunát
2014-08-25 10:29:54 +02:00
parent def75f0282
commit c96f4d7949
5 changed files with 41 additions and 10 deletions
@@ -12,8 +12,10 @@ postConfigure() {
export NIX_DONT_SET_RPATH=1
unset CFLAGS
}
# Apparently --bindir is not respected.
makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
}
postInstall() {
if test -n "$installLocales"; then
@@ -27,7 +29,7 @@ postInstall() {
if test -z "$hurdHeaders"; then
# Include the Linux kernel headers in Glibc, except the `scsi'
# subdirectory, which Glibc provides itself.
(cd $out/include && \
(cd $dev/include && \
ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .)
fi
@@ -52,6 +54,17 @@ postInstall() {
# Get rid of more unnecessary stuff.
rm -rf $out/var $out/sbin/sln
# Put libraries for static linking in a separate output. Note
# that libc_nonshared.a and libpthread_nonshared.a are required
# for dynamically-linked applications.
mkdir -p $static/lib
mv $out/lib/*.a $static/lib
mv $static/lib/lib*_nonshared.a $out/lib
# Work around a Nix bug: hard links across outputs cause a build failure.
cp $bin/bin/getconf $bin/bin/getconf_
mv $bin/bin/getconf_ $bin/bin/getconf
}
genericBuild
@@ -25,6 +25,8 @@ in
builder = ./builder.sh;
outputs = [ "out" "dev" "bin" "static" ];
# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
# any program we run, because the gcc will have been placed at a new
# store path than that determined when built (as a source for the
@@ -95,7 +97,7 @@ in
# To avoid a dependency on the build system 'bash'.
preFixup = ''
rm $out/bin/{ldd,tzselect,catchsegv,xtrace}
rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
'';
}
else {}))
@@ -25,7 +25,7 @@ build null {
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
buildPhase =
''
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
mkdir -p $TMPDIR/"${stdenv.gcc.libc}/lib/locale"
# Hack to allow building of the locales (needed since glibc-2.12)
sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \