substituteAll: Enumerate environment variables more reliably

Getting the names of all environment variables is tricky. The previous
implementation easily got confused by multi-line variables. The new
one is more reliable but not still not perfect.

This works around a segfault in Bash 4.3, where the expression
"${!var}" (where var="-9") crashes under certain conditions.

http://hydra.nixos.org/build/16693445
Ensure a correct value for $BASH

Previously it was set to /run/current-system/sw/sbin/nologin or
similar.
glibc: Include a copy of libgcc_s.so.1

This prevents failures like "libgcc_s.so.1 must be installed for
pthread_cancel to work" that occur because Glibc assumes libgcc_s.so.1
to be in Glibc's libdir.

This solution is pretty hacky, because the libgcc_s.so.1 from
bootstrap-tools might be too old. So if we update GCC, programs might
end up using an outdated libgcc_s.so.1. Ideally, we would build
libgcc_s.so.1 *before* Glibc, which might not be impossible...

Fixes #3548.
glibc: improve nscd version check after e316672dcb
linux-headers: Update to 3.12.32

We can do this because bootstrap-tools contains an unxz program now
(via busybox).
Merge remote-tracking branch 'origin/glibc-2.20' into staging
Merge remote-tracking branch 'origin/bash-4.3' into staging
Merge remote-tracking branch 'origin/perl-5.20' into staging
gnutls-3.2: maintenance+security update

CVE-2014-8564 seems only DOS, so relatively non-critical.
stdenv lib64-moving: fail instead of overwriting

Silent overwriting is dangerous and it bit us straightaway on gcc_multi.
https://github.com/NixOS/nixpkgs/commit/51f1b4ec48d5
gnutls-3.1: remove unused version

The upstream doesn't maintain these well, as they even fail to build now.
perl: Fix evaluation on Darwin
perl-5.14: Remove

It's EOL and unmaintained. There was only one package using it which
I've marked as broken.
libcurl: Honor $SSL_CERT_FILE
qt: upgrade to 5.3.2

This commit also removes the 5.2 branch in favor of 5.3. Several
components of KDE5 require Qt 5.3, so it doesn't make much sense to have
the rest of the system on an older version. Also, the application styles
may not be compatible because Qt breaks ABI compatibility between versions.
polkit-qt-1: Qt 5 support

polkit-qt-1 is upgraded to the latest version, which supports Qt 5. The
attributes are also renamed to differentiate the Qt 4 and Qt 5
branches. The prior naming scheme differentiated between polkit-qt-1 and
polkit-qt, but we no longer package the latter.
phonon: upgrade to 4.8.1

This version adds Qt 5 support.
phonon-backend-gstreamer: add Qt 5 support
phonon-backend-vlc: add Qt 5 support
qt5: find timezone table in $TZDIR