Added changes from Hari for apple R build, did'nt break my working system hopes this helps
Merge branch 'noX11' into devel