[build] detect darwin platform correctly