Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/erlang/, dev-lang/erlang/files/
Date: Fri, 28 Jun 2019 07:37:59
Message-Id: 1561707465.80361f8e4bac09ee90d24c9a8f271baf593cf1aa.mgorny@gentoo
1 commit: 80361f8e4bac09ee90d24c9a8f271baf593cf1aa
2 Author: iamdenchik <bazukajo <AT> gmail <DOT> com>
3 AuthorDate: Fri Apr 26 10:47:25 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 28 07:37:45 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80361f8e
7
8 dev-lang/erlang: Move command_args to conf.d
9
10 Signed-off-by: Denis Pershin <bazukajo <AT> gmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/11830
12 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
13
14 dev-lang/erlang/erlang-22.0.2-r1.ebuild | 148 ++++++++++++++++++++++++++++++++
15 dev-lang/erlang/files/epmd.confd | 2 +
16 dev-lang/erlang/files/epmd.init-r1 | 24 ++++++
17 3 files changed, 174 insertions(+)
18
19 diff --git a/dev-lang/erlang/erlang-22.0.2-r1.ebuild b/dev-lang/erlang/erlang-22.0.2-r1.ebuild
20 new file mode 100644
21 index 00000000000..2c99593513a
22 --- /dev/null
23 +++ b/dev-lang/erlang/erlang-22.0.2-r1.ebuild
24 @@ -0,0 +1,148 @@
25 +# Copyright 1999-2019 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=6
29 +WX_GTK_VER="3.0"
30 +
31 +inherit eapi7-ver elisp-common java-pkg-opt-2 systemd wxwidgets
32 +
33 +# NOTE: If you need symlinks for binaries please tell maintainers or
34 +# open up a bug to let it be created.
35 +
36 +UPSTREAM_V="$(ver_cut 1-2)"
37 +
38 +DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)"
39 +HOMEPAGE="https://www.erlang.org/"
40 +SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz
41 + http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz
42 + doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )"
43 +
44 +LICENSE="Apache-2.0"
45 +SLOT="0"
46 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
47 +IUSE="doc emacs +hipe java +kpoll libressl odbc sctp ssl systemd tk wxwidgets"
48 +
49 +RDEPEND="
50 + sys-libs/ncurses:0
51 + sys-libs/zlib
52 + emacs? ( virtual/emacs )
53 + java? ( >=virtual/jdk-1.8:* )
54 + odbc? ( dev-db/unixODBC )
55 + sctp? ( net-misc/lksctp-tools )
56 + ssl? (
57 + !libressl? ( >=dev-libs/openssl-0.9.7d:0= )
58 + libressl? ( dev-libs/libressl:0= )
59 + )
60 + systemd? ( sys-apps/systemd )
61 + tk? ( dev-lang/tk:0 )
62 + wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
63 +"
64 +DEPEND="${RDEPEND}
65 + dev-lang/perl
66 +"
67 +
68 +S="${WORKDIR}/otp-OTP-${PV}"
69 +
70 +PATCHES=(
71 + "${FILESDIR}/18.2.1-wx3.0.patch"
72 + "${FILESDIR}/${PN}-22.0-dont-ignore-LDFLAGS.patch"
73 + "${FILESDIR}/${PN}-add-epmd-pid-file-creation-for-openrc.patch"
74 +)
75 +
76 +SITEFILE=50"${PN}"-gentoo.el
77 +
78 +src_prepare() {
79 + default
80 +
81 + ./otp_build autoconf
82 +}
83 +
84 +src_configure() {
85 + use wxwidgets && setup-wxwidgets
86 +
87 + local myconf=(
88 + --disable-builtin-zlib
89 + $(use_enable hipe)
90 + $(use_enable kpoll kernel-poll)
91 + $(use_with java javac)
92 + $(use_enable sctp)
93 + $(use_with ssl ssl "${EPREFIX}"/usr)
94 + $(use_enable ssl dynamic-ssl-lib)
95 + $(usex wxwidgets "--with-wx-config=${WX_CONFIG}" "--with-wxdir=/dev/null")
96 + )
97 + econf "${myconf[@]}"
98 +}
99 +
100 +src_compile() {
101 + emake
102 +
103 + if use emacs ; then
104 + pushd lib/tools/emacs &>/dev/null || die
105 + elisp-compile *.el
106 + popd &>/dev/null || die
107 + fi
108 +}
109 +
110 +extract_version() {
111 + local path="$1"
112 + local var_name="$2"
113 + sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || die "extract_version() failed"
114 +}
115 +
116 +src_install() {
117 + local erl_libdir_rel="$(get_libdir)/erlang"
118 + local erl_libdir="/usr/${erl_libdir_rel}"
119 + local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)"
120 + local erl_erts_ver="$(extract_version erts VSN)"
121 + local my_manpath="/usr/share/${PN}/man"
122 +
123 + [[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version"
124 + [[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface version"
125 +
126 + emake INSTALL_PREFIX="${D}" install
127 +
128 + if use doc ; then
129 + local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" "${WORKDIR}"/doc/. "${WORKDIR}"/lib/. "${WORKDIR}"/erts-* )
130 + docompress -x /usr/share/doc/${PF}
131 + else
132 + local DOCS=("README.md")
133 + fi
134 +
135 + einstalldocs
136 +
137 + dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl
138 + dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc
139 + dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript
140 + dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call
141 + dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp
142 +
143 + ## Clean up the no longer needed files
144 + rm "${ED}/${erl_libdir}/Install" || die
145 +
146 + insinto "${my_manpath}"
147 + doins -r "${WORKDIR}"/man/*
148 + # extend MANPATH, so the normal man command can find it
149 + # see bug 189639
150 + newenvd - "90erlang" <<-_EOF_
151 + MANPATH="${my_manpath}"
152 + _EOF_
153 +
154 + if use emacs ; then
155 + elisp-install erlang lib/tools/emacs/*.{el,elc}
156 + sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
157 + "${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die
158 + elisp-site-file-install "${T}/${SITEFILE}"
159 + fi
160 +
161 + newinitd "${FILESDIR}"/epmd.init-r1 epmd
162 + newconfd "${FILESDIR}"/epmd.confd epmd
163 + use systemd && systemd_dounit "${FILESDIR}"/epmd.service
164 +}
165 +
166 +pkg_postinst() {
167 + use emacs && elisp-site-regen
168 +}
169 +
170 +pkg_postrm() {
171 + use emacs && elisp-site-regen
172 +}
173
174 diff --git a/dev-lang/erlang/files/epmd.confd b/dev-lang/erlang/files/epmd.confd
175 new file mode 100644
176 index 00000000000..aa4dc3eb5ae
177 --- /dev/null
178 +++ b/dev-lang/erlang/files/epmd.confd
179 @@ -0,0 +1,2 @@
180 +#arguments for run erlang
181 +command_args="--daemon -relaxed_command_check -address 127.0.0.1"
182
183 diff --git a/dev-lang/erlang/files/epmd.init-r1 b/dev-lang/erlang/files/epmd.init-r1
184 new file mode 100644
185 index 00000000000..bdd441b997a
186 --- /dev/null
187 +++ b/dev-lang/erlang/files/epmd.init-r1
188 @@ -0,0 +1,24 @@
189 +#!/sbin/openrc-run
190 +# Copyright 1999-2019 Gentoo Foundation
191 +# Distributed under the terms of the Erlang Public License 1.1
192 +
193 +pidfile="/var/run/epmd.pid"
194 +
195 +depend() {
196 + need loopback
197 + before sshd
198 +}
199 +
200 +start() {
201 + ebegin "Starting Erlang Port Mapper Daemon"
202 + start-stop-daemon --start --quiet \
203 + --pidfile "${pidfile}" \
204 + --exec /usr/bin/epmd -- $command_args
205 + eend $?
206 +}
207 +
208 +stop() {
209 + ebegin "Stopping Erlang Port Mapper Daemon"
210 + /usr/bin/epmd -kill >/dev/null
211 + eend $?
212 +}