add darwin support

Thanks to Olivier Guillaumin.