Use brew to install packages on OS X

Check the platform first.