| 1 | # $Id: Portfile 81904 2011-08-06 13:39:19Z jmr@macports.org $ |
|---|
| 2 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
|---|
| 3 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | name erlang |
|---|
| 6 | version R14B03 |
|---|
| 7 | revision 1 |
|---|
| 8 | categories lang erlang |
|---|
| 9 | maintainers bfulgham |
|---|
| 10 | platforms darwin |
|---|
| 11 | description The Erlang Programming Language |
|---|
| 12 | long_description \ |
|---|
| 13 | Erlang is a programming language designed at the \ |
|---|
| 14 | Ericsson Computer Science Laboratory. Open-source \ |
|---|
| 15 | Erlang is being released to help encourage the spread \ |
|---|
| 16 | of Erlang outside Ericsson. \ |
|---|
| 17 | \ |
|---|
| 18 | We are releasing free of charge: \ |
|---|
| 19 | The entire source code of the current Erlang \ |
|---|
| 20 | system. \ |
|---|
| 21 | Extensive libraries of code for building robust \ |
|---|
| 22 | fault-tolerant distributed applications. \ |
|---|
| 23 | All with documentation. \ |
|---|
| 24 | \ |
|---|
| 25 | All the above software has been battle tested in a \ |
|---|
| 26 | number of Ericsson products, for example the new \ |
|---|
| 27 | Ericsson ATM switch. |
|---|
| 28 | |
|---|
| 29 | homepage http://www.erlang.org/ |
|---|
| 30 | master_sites http://www.erlang.org/download/ \ |
|---|
| 31 | http://www.erlang.org/download/patches/:patches |
|---|
| 32 | |
|---|
| 33 | # Parallel build doesn't work as per R13B01 |
|---|
| 34 | use_parallel_build no |
|---|
| 35 | |
|---|
| 36 | universal_variant no |
|---|
| 37 | |
|---|
| 38 | distfiles otp_src_${version}${extract.suffix} \ |
|---|
| 39 | otp_doc_man_${version}${extract.suffix} \ |
|---|
| 40 | otp_doc_html_${version}${extract.suffix} |
|---|
| 41 | |
|---|
| 42 | checksums otp_src_${version}.tar.gz \ |
|---|
| 43 | sha1 109812114ef7c2855ade14b90813a870c89f6d43 \ |
|---|
| 44 | rmd160 468736a53b2e74ab0cd0f706751b5b03cbfa87cd \ |
|---|
| 45 | otp_doc_man_${version}.tar.gz \ |
|---|
| 46 | sha1 6bd773d2eee069762ba344dc8825ac52722398e1 \ |
|---|
| 47 | rmd160 f6e30764fe122cc0e571f8338f7c3eb3ff3bd893 \ |
|---|
| 48 | otp_doc_html_${version}.tar.gz \ |
|---|
| 49 | sha1 c662e3b4387772c916f2f8c3e9dbceb275207d8c \ |
|---|
| 50 | rmd160 7be3c667de0b5e42f0d56eeadd155bcf977488cf |
|---|
| 51 | |
|---|
| 52 | pre-patch { file rename ${workpath}/otp_src_${version} ${workpath}/${name}-${version} } |
|---|
| 53 | |
|---|
| 54 | # http://www.erlang.org/pipermail/erlang-bugs/2009-January/001171.html |
|---|
| 55 | patchfiles patch-toolbar.erl \ |
|---|
| 56 | patch-erts_emulator_Makefile.in \ |
|---|
| 57 | patch-erts_emulator_hipe_hipe_amd64_asm.m4.diff \ |
|---|
| 58 | patch-erts_emulator_hipe_hipe_amd64.c.diff \ |
|---|
| 59 | patch-erts_emulator_sys_unix_sys_float.c.diff \ |
|---|
| 60 | patch-erts_configure.diff \ |
|---|
| 61 | patch-lib_ssl_c_src_esock_openssl.c \ |
|---|
| 62 | patch-disable_wx.diff |
|---|
| 63 | |
|---|
| 64 | configure.args --prefix=${prefix} \ |
|---|
| 65 | --enable-kernel-poll \ |
|---|
| 66 | --enable-threads \ |
|---|
| 67 | --enable-dynamic-ssl-lib \ |
|---|
| 68 | --enable-smp-support \ |
|---|
| 69 | --enable-hipe \ |
|---|
| 70 | --without-ssl \ |
|---|
| 71 | --without-odbc |
|---|
| 72 | |
|---|
| 73 | depends_build port:gawk port:perl5 |
|---|
| 74 | # ${prefix}/lib/erlang/erts-5.8.4/bin/beam.smp links with ncurses |
|---|
| 75 | depends_lib port:ncurses |
|---|
| 76 | |
|---|
| 77 | post-destroot { |
|---|
| 78 | system "tar -C ${destroot}${prefix}/lib/erlang -zxvf ${distpath}/otp_doc_html_${version}${extract.suffix}" |
|---|
| 79 | system "tar -C ${destroot}${prefix}/lib/erlang -zxvf ${distpath}/otp_doc_man_${version}${extract.suffix}" |
|---|
| 80 | |
|---|
| 81 | set erts_dir erts-5.8.4 |
|---|
| 82 | set erl_interface_dir erl_interface-3.7.4 |
|---|
| 83 | |
|---|
| 84 | reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/bin/erl |
|---|
| 85 | reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/bin/start |
|---|
| 86 | reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/${erts_dir}/bin/erl |
|---|
| 87 | reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/${erts_dir}/bin/start |
|---|
| 88 | |
|---|
| 89 | foreach x {dialyzer ear ecc elink epmd erl erlc escript run_erl start to_erl typer} { file delete -force ${destroot}${prefix}/bin/${x} } |
|---|
| 90 | foreach x {dialyzer erl erlc escript run_erl start to_erl typer} { system "ln -s ../lib/erlang/bin/${x} ${destroot}${prefix}/bin/${x}" } |
|---|
| 91 | |
|---|
| 92 | file delete -force ${destroot}${prefix}/lib/erlang/bin/epmd |
|---|
| 93 | system "ln -s ../${erts_dir}/bin/epmd ${destroot}${prefix}/lib/erlang/bin/epmd" |
|---|
| 94 | system "ln -s ../lib/erlang/lib/${erl_interface_dir}/bin/erl_call ${destroot}${prefix}/bin/erl_call" |
|---|
| 95 | } |
|---|
| 96 | |
|---|
| 97 | platform darwin 10 { |
|---|
| 98 | patchfiles-delete patch-lib_ssl_c_src_esock_openssl.c |
|---|
| 99 | |
|---|
| 100 | # 10.6 (and 10.6.1) has a bad bug related to using dlopen in a thread. |
|---|
| 101 | # rdar://7209349 - http://www.openradar.appspot.com/7209349 |
|---|
| 102 | # This is a workaround. |
|---|
| 103 | patchfiles-append patch-erts_emulator_sys_unix_ddll.c.diff |
|---|
| 104 | configure.ldflags-append -framework CoreFoundation |
|---|
| 105 | |
|---|
| 106 | if {${configure.compiler} == "llvm-gcc-4.2" || ${configure.compiler} == "clang" } { |
|---|
| 107 | ui_msg "Erlang doesn't build with ${configure.compiler} on OS X 10.6; using gcc-4.2 instead." |
|---|
| 108 | configure.compiler gcc-4.2 |
|---|
| 109 | } |
|---|
| 110 | } |
|---|
| 111 | |
|---|
| 112 | platform darwin 11 { |
|---|
| 113 | patchfiles-delete patch-lib_ssl_c_src_esock_openssl.c |
|---|
| 114 | |
|---|
| 115 | # 10.6 (and 10.6.1) has a bad bug related to using dlopen in a thread. |
|---|
| 116 | # rdar://7209349 - http://www.openradar.appspot.com/7209349 |
|---|
| 117 | # This is a workaround. |
|---|
| 118 | patchfiles-append patch-erts_emulator_sys_unix_ddll.c.diff |
|---|
| 119 | configure.ldflags-append -framework CoreFoundation |
|---|
| 120 | |
|---|
| 121 | # We must build Erlang on LLVM with -O0 (see http://llvm.org/bugs/show_bug.cgi?id=7883 |
|---|
| 122 | # for details). You can also build with gcc-4.2, but NOT the default Lion gcc-4.2, |
|---|
| 123 | # which is actually llvm-gcc-4.2; instead, you would need to install the gcc-4.2 |
|---|
| 124 | # port. |
|---|
| 125 | configure.cflags-delete -O2 |
|---|
| 126 | configure.cxxflags-delete -O2 |
|---|
| 127 | configure.cflags-append -O0 |
|---|
| 128 | configure.cxxflags-append -O0 |
|---|
| 129 | } |
|---|
| 130 | |
|---|
| 131 | platform macosx { |
|---|
| 132 | if {[variant_isset wxwidgets]} { |
|---|
| 133 | # wxMac is 32-bit only |
|---|
| 134 | supported_archs i386 ppc |
|---|
| 135 | } |
|---|
| 136 | } |
|---|
| 137 | platform darwin { |
|---|
| 138 | if {${configure.build_arch} == "x86_64" || ${configure.build_arch} == "ppc64"} { |
|---|
| 139 | configure.args-append --enable-darwin-64bit |
|---|
| 140 | } |
|---|
| 141 | } |
|---|
| 142 | |
|---|
| 143 | default_variants +ssl |
|---|
| 144 | |
|---|
| 145 | variant wxwidgets description {Build wxWidgets support} { |
|---|
| 146 | patchfiles-delete patch-disable_wx.diff |
|---|
| 147 | patchfiles-append patch-lib_wx_configure.in \ |
|---|
| 148 | patch-lib_wx_configure |
|---|
| 149 | depends_lib-append port:wxWidgets |
|---|
| 150 | depends_run-append port:tk |
|---|
| 151 | } |
|---|
| 152 | |
|---|
| 153 | variant ssl description {Build SSL support} { |
|---|
| 154 | configure.args-delete --without-ssl |
|---|
| 155 | configure.args-append --with-ssl=${prefix} |
|---|
| 156 | configure.ldflags-append -lz |
|---|
| 157 | depends_lib-append port:openssl |
|---|
| 158 | } |
|---|
| 159 | |
|---|
| 160 | variant nohipe description {Disable HiPE (native-code bytecode compiler)} { |
|---|
| 161 | configure.args-delete --enable-hipe |
|---|
| 162 | } |
|---|
| 163 | |
|---|
| 164 | variant odbc description {Build ODBC support} { |
|---|
| 165 | depends_lib-append port:unixODBC |
|---|
| 166 | configure.args-delete --without-odbc |
|---|
| 167 | configure.args-append --with-odbc=${prefix} |
|---|
| 168 | } |
|---|
| 169 | |
|---|
| 170 | # Livecheck |
|---|
| 171 | livecheck.type regex |
|---|
| 172 | livecheck.version ${version} |
|---|
| 173 | livecheck.url ${homepage}download/ |
|---|
| 174 | livecheck.regex "otp_src_(R\[0-9\]+\[AB\]\[0-9\]*(-\[0-9\])?)\\.tar\\.gz" |
|---|