Skip to content

Instantly share code, notes, and snippets.

@dch
Last active December 29, 2015 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dch/7699886 to your computer and use it in GitHub Desktop.
Save dch/7699886 to your computer and use it in GitHub Desktop.
Get yourself a relocatable Erlang/OTP for OS X users with WxWidgets support. Thanks Konrad & team at ESL for their tips and assistance.

This easy hack allows OS X users to install Erlang/OTP with a working WxWidgets & observer and other useful tools, anywhere they want, without getting in the way of existing erlang versions from homebrew, macports, or kerl.

Prior to OTP 17.1, the 64-bit Erlang/OTP will crash or fail to compile with WxWidgets anyway, hence using the 32-bit version. brew install wxmac && brew install --no-docs --with-dirty-schedulers --time --devel -v erlang.

but note that most applications are not yet compatible with R17. But then if you want dirty scheduler support you probably already know that.

URL=http://packages.erlang-solutions.com/site/esl-erlang
DMG=FLAVOUR_1_general/esl-erlang_16.b.3-2\~osx\~10.6.8_i386.dmg
DEST=~/erlbrew/esl-erlang_16B03-x86
pushd $TMPDIR
curl -L $URL/$DMG -o esl-erlang.dmg
hdiutil attach -quiet -readonly -mountpoint $TMPDIR/esl-erlang esl-erlang.dmg
tar xOzf $TMPDIR/esl-erlang/*.pkg Erlang.pkg/Payload  | tar xzf -  --strip-components 2
hdiutil detach $TMPDIR/esl-erlang
# move it to its final location & run the installer to fix up paths
mv local $DEST
rm esl*.dmg
(cd $DEST; ./lib/erlang/Install -minimal `pwd -P`/lib/erlang)
popd

Thanks to Konrad Gądek from Erlang Solutions for suggestions on using hdiutil!

#!/bin/sh
OBSERVERL=~/erlbrew/esl-erlang_16B03-x86
PATH=$OBSERVERL/bin:$PATH
exec $OBSERVERL/bin/erl -sname observer -hidden -run observer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment