Mac OS X(Mountain Lion)のErlangでwxを動かしたい(動かせてない)
Erlang/OTP trainingでobserver便利そうだったけど、手元で動かせてなかったので。
ちなみに、以下のようなわけで64bitのMac OS Xではwxは動かないらしいです。
http://erlang.org/pipermail/erlang-questions/2013-March/072687.html
以下を参考に入れてみました。
https://gist.github.com/jj1bdx/5441077
Xquartz, homebrew, kerl, gitが必要という事で、Boxen使っているのとkerlは前回入れたのでクリアということで、Xquartzをboxenで入れるところから。
$ vi /opt/boxen/repo/modules/people/manifests/ankoromochi.pp class people::ankoromochi { … package { 'XQuartz': provider => 'pkgdmg', source => 'http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.4.dmg'; } … } $ boxen
wxgtk.rbはさっきのgistにあるやつを持ってくる。
$ brew install wxgtk.rb ==> Downloading http://downloads.sourceforge.net/project/wxwindows/2.8.12/wxGTK-2.8.12.tar.gz ==> ./configure --with-libpng --with-opengl --with-libjpeg --with-libtiff --with-freetype --with-zlib --enable-unicode --prefix=/opt/boxen/homebrew/Cellar/wxgtk/2.8.12 ... ==> make install brew: superenv removed: -I/opt/X11/include -Wall -Wundef -Wno-ctor-dtor-privacy -O2 clang: error: cannot specify -o when generating multiple output files clang: error: cannot specify -o when generating multiple output files make: *** [.pch/wxprec_qadll/wx/wxprec.h.gch] Error 1 make: *** [.pch/wxprec_htmldll/wx/wxprec.h.gch] Error 1
error出たので、以下を参考に修正。
https://github.com/mxcl/homebrew/issues/22124
wxgtk.rbに--disable-precomp-headersのoptionを追加してもっかい。
無事入ったので、patchのあたったErlangをbuildする。boxen使ってるとwxgtkが入るpathが違う。
$ KERL_CONFIGURE_OPTIONS="--enable-darwin-64bit \ --disable-hipe \ --enable-kernel-poll \ --enable-threads \ --enable-smp-support \ --with-wxdir=/opt/boxen/homebrew/opt/wxgtk \ --with-wx-config=/opt/boxen/homebrew/opt/wxgtk/bin/wx-config" \ ./kerl build git https://github.com/jj1bdx/otp kr-r16b02-osx-wx kr-r16b02-osx-wx … beam/erl_bif_re.c:68:5: error: use of undeclared identifier 'erts_pcre_malloc'; did you mean 'erts_realloc'? erts_pcre_malloc = &erts_erts_pcre_malloc; ^~~~~~~~~~~~~~~~ …
と、ここでこける><
なぜか昨日は通ってた、全然関係ないErlangのbuildも通らなくなってしまった。
なんで通んなくなったんだろ・・・(まだ調べてる途中…)
今日はここまで。