Skip to content

Instantly share code, notes, and snippets.

@zhiyzuo
Last active May 17, 2020 12:17
Show Gist options
  • Save zhiyzuo/a489ffdcc5da87f28f8589a55aa206dd to your computer and use it in GitHub Desktop.
Save zhiyzuo/a489ffdcc5da87f28f8589a55aa206dd to your computer and use it in GitHub Desktop.
A brief note on how to install rattle/RGtk2 on macOS
@yihui
Copy link

yihui commented Jun 14, 2018

As I just pointed out in a comment under @zhiyzuo's post (https://zhiyzuo.github.io/installation-rattle/#comment-3944233914), the whole thing can be simplified to this:

system('brew install gtk+')

local({
  if (Sys.info()[['sysname']] != 'Darwin') return()

  .Platform$pkgType = 'mac.binary.el-capitan'
  unlockBinding('.Platform', baseenv())
  assign('.Platform', .Platform, 'package:base')
  lockBinding('.Platform', baseenv())

  options(
    pkgType = 'both', install.packages.compile.from.source = 'always',
    repos = 'https://macos.rbind.org'
  )
})

install.packages(c('RGtk2', 'cairoDevice', 'rattle'))

No more struggling with editing the gtk+ formula :)

@bison31205
Copy link

thx,it work!

@sharkdeng
Copy link

I am getting this when doing "R CMD INSTALL RGtk2_2.20.33.tar.gz"

configure: error: GTK version 2.8.0 required

I am on MacOS Sierra 10.12.6, R version is 3.4.2
When I did "brew install --build-from-source --verbose gtk+" it installed GTK 2.24.31_1

I encountered same problem. Did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment