caskroom/homebrew-cask — pull request #8485 by bronson (2014-12-29 09:24:24+00:00)
Title: Add Gnu Backgammon app, latest and legacy versions

This works great AS LONG AS you install it globally:

brew cask install gnubg --appdir=/Applications

Is there a way for the caskfile to force the app to be installed in /Applications?

Unfortunately, GnuBG is unable to run in ~/Applications. There are at least two problems:
* The `gnubg.app/Contents/MacOS/bin/gnubg.x11` launch script is hard-coded: `export GNUBGPATH="/Applications/Gnubg.app/Contents/MacOS"`
* The executables in `gnubg.app/Contents/MacOS/local/bin` have absolute paths (as reported by `otool -L gnubg.app/Contents/MacOS/local/bin/gnubg`

The first problem would be easy to fix with a patch but the second problem looks pretty serious.

Worst case, maybe I should add a check and admonish the user if the destination is wrong? Something like:

```ruby
raise "you must install with --appdir=/Applications" unless appdir == '/Applications'
```