annotate dev-lang/erlang/erlang-12.2.2.ebuild @ 12:a9058d20d58e

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