Ticket #23348: Portfile

File Portfile, 6.0 KB (added by cerieljacobs@…, 15 years ago)
Line 
1# $Id: Portfile 62456 2010-01-08 16:36:17Z macsforever2000@macports.org $
2
3PortSystem 1.0
4name            erlang
5version         R13B03
6categories      lang erlang
7maintainers     bfulgham
8platforms       darwin
9description     The Erlang Programming Language
10long_description                                                        \
11                Erlang is a programming language designed at the        \
12                Ericsson Computer Science Laboratory. Open-source       \
13                Erlang is being released to help encourage the spread   \
14                of Erlang outside Ericsson.                             \
15                                                                        \
16                We are releasing free of charge:                        \
17                    The entire source code of the current Erlang        \
18                    system.                                             \
19                    Extensive libraries of code for building robust     \
20                    fault-tolerant distributed applications.            \
21                    All with documentation.                             \
22                                                                        \
23                All the above software has been battle tested in a      \
24                number of Ericsson products, for example the new        \
25                Ericsson ATM switch.
26
27homepage        http://www.erlang.org/
28master_sites    http://www.erlang.org/download/ \
29                http://www.erlang.org/download/patches/:patches
30
31# Parallel build doesn't work as per R13B01
32use_parallel_build  no
33
34distfiles       otp_src_${version}${extract.suffix}                    \
35                otp_doc_man_${version}${extract.suffix}                \
36                otp_doc_html_${version}${extract.suffix}
37
38checksums       otp_src_${version}.tar.gz \
39                md5     411fcb29f0819973f71e28f6b56d9948 \
40                sha1    161f22d498da244d4b32181a78b04d97523857d1 \
41                rmd160  7cf3d1cf6cdf73ff19f5a416396c4024e641ec29 \
42                otp_doc_man_${version}.tar.gz \
43                md5     1fe80b110061ef73614824fb06d4d6eb \
44                sha1    2241651db8c4bce02fc5d34d63c983a3d55d1011 \
45                rmd160  8d6af7ea55fe6d8696fd28c563f9c4e5d9aee779 \
46                otp_doc_html_${version}.tar.gz \
47                md5     ade1a4d5dcfe3732dc953f7cf9664b37 \
48                sha1    3a578b3d83fe7bb7abd74823d65548e17cd228e6 \
49                rmd160  b2971024e56e3b05ba537c722fca694daade2ffb
50
51pre-patch       { file rename ${workpath}/otp_src_${version} ${workpath}/${name}-${version} }
52
53# http://www.erlang.org/pipermail/erlang-bugs/2009-January/001171.html
54patchfiles      patch-toolbar.erl \
55                patch-erts_emulator_Makefile.in \
56                patch-erts_emulator_hipe_hipe_amd64_asm.m4.diff \
57                patch-erts_emulator_hipe_hipe_amd64_bifs.m4.diff \
58                patch-erts_emulator_hipe_hipe_amd64_glue.S.diff \
59                patch-erts_emulator_hipe_hipe_amd64.c.diff \
60                patch-erts_emulator_sys_unix_sys_float.c.diff \
61                patch-erts_configure.diff \
62                patch-lib_ssl_c_src_esock_openssl.c \
63                patch-lib_wx_configure.in \
64                patch-lib_wx_configure
65
66configure.args  --prefix=${destroot}${prefix}   \
67                --enable-kernel-poll            \
68                --enable-threads                \
69                --enable-dynamic-ssl-lib        \
70                --enable-smp-support            \
71                --enable-hipe                   \
72                --disable-ssl
73
74depends_build   port:gawk
75
76post-destroot   {
77        system "tar -C ${destroot}${prefix}/lib/erlang -zxvf ${distpath}/otp_doc_html_${version}${extract.suffix}"
78        system "tar -C ${destroot}${prefix}/lib/erlang -zxvf ${distpath}/otp_doc_man_${version}${extract.suffix}"
79 
80        set erts_dir   erts-5.7.4
81
82        reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/bin/erl
83        reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/bin/start
84        reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/${erts_dir}/bin/erl
85        reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/${erts_dir}/bin/start
86
87        foreach x {dialyzer ear ecc elink epmd erl erlc escript run_erl start to_erl typer} { file delete -force ${destroot}${prefix}/bin/${x} }
88        foreach x {dialyzer erl erlc escript run_erl start to_erl typer} { system "ln -s ../lib/erlang/bin/${x} ${destroot}${prefix}/bin/${x}" }
89
90        file delete -force ${destroot}${prefix}/lib/erlang/bin/epmd
91        system "ln -s ../${erts_dir}/bin/epmd ${destroot}${prefix}/lib/erlang/bin/epmd"
92}
93
94platform darwin 10 {
95    # 10.6 comes with wxWidgets and since it requires libsdl, which
96    # current doesn't compile (bug #20235), we can avoid it here.
97    depends_build-delete    port:wxWidgets
98
99    patchfiles-delete   patch-lib_ssl_c_src_esock_openssl.c
100   
101    # 10.6 (and 10.6.1) has a bad bug related to using dlopen in a thread.
102    # rdar://7209349 - http://www.openradar.appspot.com/7209349
103    # This is a workaround.
104    patchfiles-append   patch-erts_emulator_sys_unix_ddll.c.diff
105    configure.ldflags-append -framework CoreFoundation
106   
107    # R13B03 has a bug declaring some variable as int without being prefixed with extern
108    # see ticket #22848 - http://trac.macports.org/ticket/22848
109    patchfiles-append           patch-int-to-extern-int.diff
110}
111
112variant wxwidgets description {Build wxWidgets support} {
113        depends_build-append     port:wxWidgets
114        depends_run-append       port:tk
115}
116
117variant ssl description {Build SSL support}     {
118    configure.args-delete    --disable-ssl
119        configure.args-append    --with-ssl=${prefix}
120        configure.ldflags-append -lz
121        depends_build-append     port:openssl
122        depends_run-append       port:openssl
123}
124
125variant nohipe description {Disable HiPE (native-code bytecode compiler)}   {
126        configure.args-delete   --enable-hipe
127}
128
129# Livecheck
130livecheck.type     regex
131livecheck.version  ${version}
132livecheck.url      ${homepage}download/
133livecheck.regex    "otp_src_(R\[0-9\]+\[AB\]\[0-9\]*(-\[0-9\])?)\\.tar\\.gz"