I use Homebrew to install most packages. But sometimes some packages are not available via Homebrew. I wonder if I can use pkgsrc to build the software from source. The instruction is as the following (in section titled "Building From Source"): http://www.perkin.org.uk/pages/pkgsrc-binary-packages-for-osx.html.
Is this approach OK? What are the potential problems?
As was already answered, it's totally OK. As for the pitfalls, if you add path to the binaries installed via pkgsrc, chances are that whenever you build something by hands gnu autotools will pick up the libraries from pkgsrc (for example, because pkg-config is exposed, but there are other ways), and not from the base system. Sometimes it's what you want, other times it's a problem. It's nasty especially because you don't know something is wrong until you delete your pkgsrc.