require 'formula' class ErlangManuals ["patch-erts_emulator_Makefile.in", "patch-erts_emulator_hipe_hipe_amd64_asm.m4.diff", "patch-erts_emulator_hipe_hipe_amd64_bifs.m4.diff", "patch-erts_emulator_hipe_hipe_amd64_glue.S.diff", "patch-erts_emulator_hipe_hipe_amd64.c.diff", "patch-erts_emulator_sys_unix_sys_float.c.diff", "patch-lib_ssl_c_src_esock_openssl.c", "patch-lib_wx_configure.in", "patch-lib_wx_configure" ].map { |file_name| "http://svn.macports.org/repository/macports/!svn/bc/60054/trunk/dports/lang/erlang/files/#{file_name}" } } end def install ENV.deparallelize ENV.gcc_4_2 # see http://github.com/mxcl/homebrew/issues/#issue/120 config_flags = ["--disable-debug", "--prefix=#{prefix}", "--enable-kernel-poll", "--enable-threads", "--enable-dynamic-ssl-lib", "--enable-smp-support"] unless ARGV.include? '--disable-hipe' # HIPE doesn't strike me as that reliable on OS X # http://syntatic.wordpress.com/2008/06/12/macports-erlang-bus-error-due-to-mac-os-x-1053-update/ # http://www.erlang.org/pipermail/erlang-patches/2008-September/000293.html config_flags << '--enable-hipe' end if Hardware.is_64_bit? and MACOS_VERSION >= 10.6 config_flags << "--enable-darwin-64bit" config_flags << "--enable-m64-build" end system "./configure", *config_flags system "touch lib/wx/SKIP" if MACOS_VERSION >= 10.6 system "make" system "make install" ErlangManuals.new.brew { man.install Dir['man/*'] } end def test "erl -noshell -eval 'crypto:start().' -s init stop" end end