build: ignore dependencies that are not installed

Optional dependencies mean that it is possible to install the package without having the dependency installed. Normally Homebrew installs all dependencies automatically, but `--ignore-dependencies` is an option that disables this behaviour. But even with `--ignore-dependencies`, build.rb is desperate to have a working /opt prefix for every formula in the dependency tree and raises an exception if it cannot achieve this:

    Error: /usr/local/opt/$dependency not present or broken
    Please reinstall $dependency. Sorry :(

The attached patch simply prevents build.rb from trying to do anything whatsoever with dependencies that are not actually installed: thus we have no spurious errors, no superfluous components in paths and no unwarranted switching to stdenv.