Allow multiple hooks with the same name

You can now register multiple values per named hook, e.g.

  addHook preConfigure "echo foo"
  addHook preConfigure "echo bar"

will cause ‘runHook preConfigure’ to run both ‘echo foo’ and ‘echo
bar’ (in that order). It will also call the shell function
preConfigure() or eval the shell variable $preConfigure, if
defined. Thus, if you don't call addHook, it works like the old hook
mechanism.

Allowing multiple hooks makes stdenv more modular and extensible. For
instance, multiple setup hooks can define a preFixup hook, and all of
these will be executed.
Provide a hook for per-output fixup
Formatting
Allow buildInputs to be regular files

If a build input is a regular file, use it as a setup hook. This makes
setup hooks more efficient to create: you don't need a derivation that
copies them to $out/nix-support/setup-hook, instead you can use the
file as is.
Move RPATH shrinking from stdenv to a setup hook provided by patchelf
Fix dontPatchELF being set after the setup script has been sourced
Factor out fixup phase stuff into separate setup hooks
Drop redundant space
unpackFile: Always copy directories

If $src refers to a directory, then always copy it. Previously, we
checked the extension first, so if the directory had an extension like
.tar, unpackPhase would fail.
stdenv: Make unpackFile extensible via the hook mechanism

unpackCmd is now a regular hook, so there can be multiple functions
hooking into it.
unzip: Clean up expression
stdenv: Move unzip support to unzip's setup hook
stdenv: Move paxmark function to paxctl's setup hook
stdenv: Remove the special handling of gcc

Now gcc is just another build input, making it possible in the future
to have a stdenv that doesn't depend on a C compiler. This is very
useful on NixOS, since it would allow trivial builders like
writeTextFile to work without pulling in the C compiler.
stdenv: Reindent
Prevent an unnecessary evaluation of lib
stdenv: Don't use sed to build the setup script
Remove addHook

Just use bash arrays directly. I.e.

  addHook preConfigure myPreConfigure

is now

  preConfigureHooks+=(myPreConfigure)
Allow passing arguments to hooks

This allows envHooks and crossEnvHooks to be handled using the regular
hook mechanism.
fixupPhase: Fix making the outputs writable