depends: fix already installed check on osx

Avoid depending on .so files which could be .dylib on osx
Fix some invalid dependencies
Merge pull request #4271 from elupus/depends_fix

depends: fix already installed check on osx