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-10-04 09:18:07 +00:00
|
|
|
url 'http://www.erlang.org/download/otp_doc_man_R13B02-1.tar.gz'
|
|
|
|
md5 'b5f7b20faa049a8b6a753fc7a462d02d'
|
2009-09-01 00:06:11 +00:00
|
|
|
end
|
|
|
|
|
2009-09-02 15:11:46 +00:00
|
|
|
class ErlangHtmlDocs <Formula
|
2009-10-04 09:18:07 +00:00
|
|
|
url 'http://erlang.org/download/otp_doc_html_R13B02-1.tar.gz'
|
|
|
|
md5 'd48da533b49f7b32c94032f2a53c0073'
|
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-01 10:50:04 +00:00
|
|
|
def skip_clean? path
|
|
|
|
true if path =~ %r[#{lib}/erlang/erts-(\d+\.?)+/bin/beam(\.smp)?] # breaks crypto_drv.so loading
|
|
|
|
true if path =~ %r[#{lib}/erlang/lib] # crypto_drv.so etc. can't be stripped as plugins
|
|
|
|
end
|
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-10-03 15:16:44 +00:00
|
|
|
#ErlangHtmlDocs.new.brew { doc.install Dir['*'] }
|
2009-06-05 22:38:23 +00:00
|
|
|
end
|
2009-09-05 22:24:57 +00:00
|
|
|
end
|