12
|
1 # Copyright 1999-2008 Gentoo Foundation
|
|
2 # Distributed under the terms of the GNU General Public License v2
|
|
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/erlang/erlang-12.2.1.ebuild,v 1.9 2008/04/01 18:16:44 opfer Exp $
|
|
4
|
|
5 inherit elisp-common eutils flag-o-matic multilib versionator
|
|
6
|
|
7 # NOTE: You need to adjust the version number in the last comment. If you need symlinks for
|
|
8 # binaries please tell maintainers or open up a bug to let it be created.
|
|
9
|
|
10 # erlang uses a really weird versioning scheme which caused quite a few problems
|
|
11 # already. Thus we do a slight modification converting all letters to digits to
|
|
12 # make it more sane (see e.g. #26420)
|
|
13
|
|
14 # the next line selects the right source.
|
|
15 MY_PV="R$(get_major_version)B-$(get_version_component_range 3)"
|
|
16
|
|
17 # ATTN!! Take care when processing the C, etc version!
|
|
18 MY_P=otp_src_${MY_PV}
|
|
19
|
|
20 DESCRIPTION="Erlang programming language, runtime environment, and large collection of libraries"
|
|
21 HOMEPAGE="http://www.erlang.org/"
|
|
22 SRC_URI="http://www.erlang.org/download/${MY_P}.tar.gz
|
|
23 doc? ( http://erlang.org/download/otp_doc_man_${MY_PV}.tar.gz
|
|
24 http://erlang.org/download/otp_doc_html_${MY_PV}.tar.gz )"
|
|
25
|
|
26 LICENSE="EPL"
|
|
27 SLOT="0"
|
|
28 KEYWORDS="alpha amd64 ppc ppc64 sparc x86 ~x86-fbsd"
|
|
29 IUSE="doc emacs hipe java kpoll odbc smp ssl tk"
|
|
30
|
|
31 RDEPEND=">=dev-lang/perl-5.6.1
|
|
32 ssl? ( >=dev-libs/openssl-0.9.7d )
|
|
33 emacs? ( virtual/emacs )
|
|
34 java? ( >=virtual/jdk-1.2 )
|
|
35 odbc? ( dev-db/unixODBC )"
|
|
36 DEPEND="${RDEPEND}
|
|
37 tk? ( dev-lang/tk )"
|
|
38
|
|
39 S="${WORKDIR}/${MY_P}"
|
|
40
|
|
41 SITEFILE=50erlang-gentoo.el
|
|
42
|
|
43 pkg_setup() {
|
|
44 if use ssl; then
|
|
45 if is-ldflag --as-needed || is-flag --as-needed; then
|
|
46 eerror "Don't use --as-needed in your LDFLAGS or CFLAGS for SSL support, this will fail."
|
|
47 die
|
|
48 fi
|
|
49 fi
|
|
50 }
|
|
51
|
|
52 src_unpack() {
|
|
53
|
|
54 unpack ${A}
|
|
55 cd "${S}"
|
|
56
|
|
57 use odbc || sed -i 's: odbc : :' lib/Makefile
|
|
58
|
|
59 # make sure we only link ssl dynamically
|
|
60 # will not be integrated by upstream for various reasons
|
|
61 sed -i '/SSL_DYNAMIC_ONLY=/s:no:yes:' erts/configure #184419
|
|
62
|
|
63 if use hipe; then
|
|
64 ewarn
|
|
65 ewarn "You enabled High performance Erlang. Be aware that this extension"
|
|
66 ewarn "can break the compilation in many ways, especially on hardened systems."
|
|
67 ewarn "Don't cry, don't file bugs, just disable it! If you have fix, tell us."
|
|
68 ewarn
|
|
69 fi
|
|
70 }
|
|
71
|
|
72 src_compile() {
|
|
73 use java || export JAVAC=false
|
|
74
|
|
75 econf \
|
|
76 --enable-threads \
|
|
77 $(use_enable hipe) \
|
|
78 $(use_with ssl) \
|
|
79 $(use_enable kpoll kernel-poll) \
|
|
80 $(use_enable smp smp-support) \
|
|
81 || die "econf failed"
|
|
82 emake -j1 || die "emake failed"
|
|
83
|
|
84 if use emacs ; then
|
|
85 pushd lib/tools/emacs
|
|
86 elisp-compile *.el
|
|
87 popd
|
|
88 fi
|
|
89 }
|
|
90
|
|
91 extract_version() {
|
|
92 sed -n -e "/^$2 = \(.*\)$/s::\1:p" "${S}/$1/vsn.mk"
|
|
93 }
|
|
94
|
|
95 src_install() {
|
|
96 local ERL_LIBDIR=/usr/$(get_libdir)/erlang
|
|
97 local ERL_INTERFACE_VER=$(extract_version lib/erl_interface EI_VSN)
|
|
98 local ERL_ERTS_VER=$(extract_version erts VSN)
|
|
99
|
|
100 emake -j1 INSTALL_PREFIX="${D}" install || die "install failed"
|
|
101 dodoc AUTHORS README
|
|
102
|
|
103 dosym "${ERL_LIBDIR}/bin/erl" /usr/bin/erl
|
|
104 dosym "${ERL_LIBDIR}/bin/erlc" /usr/bin/erlc
|
|
105 dosym "${ERL_LIBDIR}/bin/ear" /usr/bin/ear
|
|
106 dosym "${ERL_LIBDIR}/bin/escript" /usr/bin/escript
|
|
107 dosym \
|
|
108 "${ERL_LIBDIR}/lib/erl_interface-${ERL_INTERFACE_VER}/bin/erl_call" \
|
|
109 /usr/bin/erl_call
|
|
110 dosym "${ERL_LIBDIR}/erts-${ERL_ERTS_VER}/bin/beam" /usr/bin/beam
|
|
111
|
|
112 ## Remove ${D} from the following files
|
|
113 dosed "${ERL_LIBDIR}/bin/erl"
|
|
114 dosed "${ERL_LIBDIR}/bin/start"
|
|
115 grep -rle "${D}" "${D}/${ERL_LIBDIR}/erts-${ERL_ERTS_VER}" | xargs sed -i -e "s:${D}::g"
|
|
116
|
|
117 ## Clean up the no longer needed files
|
|
118 rm "${D}/${ERL_LIBDIR}/Install"
|
|
119
|
|
120 if use doc ; then
|
|
121 for i in "${WORKDIR}"/man/man* ; do
|
|
122 dodir "${ERL_LIBDIR}/${i##${WORKDIR}}"
|
|
123 done
|
|
124 for file in "${WORKDIR}"/man/man*/*.[1-9]; do
|
|
125 # Man page processing tools expect a capitalized "SEE ALSO" section
|
|
126 # header, has been reported upstream, should be fixed in R12
|
|
127 sed -i -e 's,\.SH See Also,\.SH SEE ALSO,g' ${file}
|
|
128 # doman sucks so we can't use it
|
|
129 cp ${file} "${D}/${ERL_LIBDIR}"/man/man${file##*.}/
|
|
130 done
|
|
131 # extend MANPATH, so the normal man command can find it
|
|
132 # see bug 189639
|
|
133 dodir /etc/env.d/
|
|
134 echo "MANPATH=\"${ERL_LIBDIR}/man\"" > "${D}/etc/env.d/90erlang"
|
|
135 dohtml -A README,erl,hrl,c,h,kwc,info -r \
|
|
136 "${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-*
|
|
137 fi
|
|
138
|
|
139 if use emacs ; then
|
|
140 pushd "${S}"
|
|
141 elisp-install erlang lib/tools/emacs/*.{el,elc}
|
|
142 elisp-site-file-install "${FILESDIR}"/${SITEFILE}
|
|
143 popd
|
|
144 fi
|
|
145
|
|
146 # prepare erl for SMP, fixes bug #188112
|
|
147 use smp && sed -i -e 's:\(exec.*erlexec\):\1 -smp:' \
|
|
148 "${D}/${ERL_LIBDIR}/bin/erl"
|
|
149 }
|
|
150
|
|
151 pkg_postinst() {
|
|
152 use emacs && elisp-site-regen
|
|
153 elog
|
|
154 elog "If you need a symlink to one of Erlang's binaries,"
|
|
155 elog "please open a bug on http://bugs.gentoo.org/"
|
|
156 elog
|
|
157 elog "Gentoo's versioning scheme differs from the author's, so please refer to this version as R12B-1"
|
|
158 elog
|
|
159 }
|
|
160
|
|
161 pkg_postrm() {
|
|
162 use emacs && elisp-site-regen
|
|
163 }
|