Repeat fix 72ed4e0a for all dependencies.

As it turns out all Solaris dependencies suffer from the same problem,
so fix them all (and do FreeBSD as well, while we're at it). The fix
is:

Make sure all .so files are part of run time dependencies. The old
code omitted .so without a numbered suffix, which would make it a
build time dependency instead of run time dependency.
(cherry picked from commit d17db809b2e091fb38f3e853ed45c63688e709cc)
Inside WORKDIR/build/buildscripts we need the full .git/ directory to be available in order for the "revision" file to take the correct git SHA.

(cherry picked from commit 09e2383e5173ab33d3e1914174f3fe6f48b2c26a)
Remove stale comment.

(cherry picked from commit f4e3456993536653bc2b815c8f46eb50f311b3cb)