2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-06-05 22:38:23 +00:00
|
|
|
|
2009-09-01 00:06:11 +00:00
|
|
|
class ErlangManuals <Formula
|
2009-12-06 15:30:04 +00:00
|
|
|
url 'http://www.erlang.org/download/otp_doc_man_R13B03.tar.gz'
|
|
|
|
md5 '1fe80b110061ef73614824fb06d4d6eb'
|
2009-09-02 15:11:46 +00:00
|
|
|
end
|
|
|
|
|
2009-06-05 22:38:23 +00:00
|
|
|
class Erlang <Formula
|
2009-12-01 10:50:04 +00:00
|
|
|
version 'R13B03'
|
2009-12-02 11:38:15 +00:00
|
|
|
url "http://erlang.org/download/otp_src_#{version}.tar.gz"
|
2009-12-01 10:50:04 +00:00
|
|
|
md5 '411fcb29f0819973f71e28f6b56d9948'
|
2009-10-04 09:18:07 +00:00
|
|
|
homepage 'http://www.erlang.org'
|
2009-09-02 15:11:46 +00:00
|
|
|
|
2009-12-06 15:29:16 +00:00
|
|
|
# we can't strip the beam executables or any plugins
|
|
|
|
# there isn't really anything else worth stripping and it takes a really
|
|
|
|
# long time to run `file` over everything in lib because there is almost
|
|
|
|
# 4000 files (and really erlang guys! what's with that?! Most of them should
|
|
|
|
# be in share/erlang!)
|
|
|
|
skip_clean 'lib'
|
|
|
|
# may as well skip this too, everything is just shell scripts
|
|
|
|
skip_clean 'bin'
|
2009-09-18 18:16:39 +00:00
|
|
|
|
2009-10-30 11:02:13 +00:00
|
|
|
def patches
|
2009-12-01 10:50:04 +00:00
|
|
|
{ :p0 => ["patch-erts_emulator_Makefile.in",
|
2009-10-30 11:02:13 +00:00
|
|
|
"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
|
|
|
|
|
2009-06-05 22:38:23 +00:00
|
|
|
def install
|
2009-08-07 14:41:43 +00:00
|
|
|
ENV.deparallelize
|
2009-11-09 17:56:16 +00:00
|
|
|
ENV.gcc_4_2 # see http://github.com/mxcl/homebrew/issues/#issue/120
|
|
|
|
|
2009-09-02 15:11:46 +00:00
|
|
|
config_flags = ["--disable-debug",
|
|
|
|
"--prefix=#{prefix}",
|
2009-08-10 19:06:20 +00:00
|
|
|
"--enable-kernel-poll",
|
|
|
|
"--enable-threads",
|
|
|
|
"--enable-dynamic-ssl-lib",
|
2009-11-09 17:56:16 +00:00
|
|
|
"--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
|
2009-09-05 22:24:57 +00:00
|
|
|
|
2009-11-11 17:25:48 +00:00
|
|
|
if Hardware.is_64_bit? and MACOS_VERSION >= 10.6
|
2009-09-05 22:24:57 +00:00
|
|
|
config_flags << "--enable-darwin-64bit"
|
|
|
|
config_flags << "--enable-m64-build"
|
|
|
|
end
|
2009-09-02 15:11:46 +00:00
|
|
|
|
|
|
|
system "./configure", *config_flags
|
2009-11-11 17:25:48 +00:00
|
|
|
system "touch lib/wx/SKIP" if MACOS_VERSION >= 10.6
|
2009-06-05 22:38:23 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
2009-09-02 15:11:46 +00:00
|
|
|
|
2009-09-01 00:06:11 +00:00
|
|
|
ErlangManuals.new.brew { man.install Dir['man/*'] }
|
2009-06-05 22:38:23 +00:00
|
|
|
end
|
2009-12-06 15:30:23 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
"erl -noshell -eval 'crypto:start().' -s init stop"
|
|
|
|
end
|
2009-09-05 22:24:57 +00:00
|
|
|
end
|