dev-lang/erlang: add 22.0.7 and fix systemd support
authorHans de Graaff <graaff@gentoo.org>
Wed, 18 Sep 2019 15:57:26 +0000 (17:57 +0200)
committerHans de Graaff <graaff@gentoo.org>
Wed, 18 Sep 2019 15:57:44 +0000 (17:57 +0200)
Fixes: https://bugs.gentoo.org/692026
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
dev-lang/erlang/Manifest
dev-lang/erlang/erlang-22.0.7.ebuild [new file with mode: 0644]

index e3b8e577a5c6fc4de31c5e3bd52af43bf33177cc..6ad8b3fcc55a8290628af348d02bb98b429e5fb4 100644 (file)
@@ -1,5 +1,6 @@
 DIST erlang-21.1.1.tar.gz 53854332 BLAKE2B 32ab508b5a305eb92eac9f49bd513374c573966e7565d98aa6ba986ce42eb955a46130b9f33dbb415f48de5c179b308a8b06b345a844afcb2700f7e3f257f27e SHA512 dc11aace126aad5411b0d583579fe95a7263be328612fdc9f9c02d917aef7ea7a128b1e54ddcf7a52232980d2c81fc8e90ae5a8806ee5ae6ea97f00a9cf3faab
 DIST erlang-22.0.2.tar.gz 54805264 BLAKE2B d30fd8a7a4ada892f4b8e14c82ab7e20f77caa78573774d0b591a1abcc26c63ae5e0a65ae5c30f0f5cc8a6e4c5e13d167929eb049cbb172fcf2899d61f5ec8dc SHA512 6dbc3705a8b9ba5c8b6694e256c226c882521d87c3af4deb9212c33fff83b510191ea547888d15ced17dd66857fb1d7ba72d9fbd54a5c63091aa86680b960436
+DIST erlang-22.0.7.tar.gz 54814307 BLAKE2B 0f44c225bd4d762a529b5c154a086636a3677d0ff44df619ce4cc17eb168b5fdc0d33e1a82c85e9f3daafa1313fede22d702021323252380c76dacde91a3f204 SHA512 cf84cc20b97ed46f9ab3c7f1d77bcf6254ac3ebbb5c1e4e5202f4d5ba3d9c3bf5542567b047edaa68c204bc67ca667b1d96eb8153ac660e628c78fe271b6a8d9
 DIST erlang_doc_html_21.1.tar.gz 32692731 BLAKE2B a7fa8ebe1c876ab7eecd2dd46ffd4d288db6d308e0f131d53c26ee4b67a92cb6fcb89b6c880ef34df395c7ad61fcdc81eac32e0fcf7336be7d517263218146bc SHA512 0d659f55bfb01eecf140a310154724489ef56b6ccbe9ac30f6b053f598276721b80de7b5b3200707cf8a6e77b8854eae5453f655225f431fcc982550539f767f
 DIST erlang_doc_html_22.0.tar.gz 33737075 BLAKE2B f49aba36e9b84e5bc4422052e33aab5cb407dfcf2086ddb8a2370003dc63842acc79a67d9d453ee9e59d7b69416b23527e2d9f564b2d8a58d4c46bc3a93881c4 SHA512 89229a97fb5c78246ce9fa6a2d23446c6c3c2de15617911739e133b7e58714a91b1360af64bf61659d96808a816d84e4c410f8c8efe1e544930f88d73242b6e7
 DIST erlang_doc_man_21.1.tar.gz 1317726 BLAKE2B 5e5c2b77a41da6ab9ae1264ba5824a9f3bda6d3b7a824b372e01356888db437ed9e45bf987d678aca3fd8d0f0e6dce25080c7a2aaa4e061936f1e6ac4717e843 SHA512 94c6191ba9f42bffeb398e865026fbc79f3b233389c7d471f0c680799aa3669e97ab5305cd53f26d6525aed33d738ebfc4eb79a8f1a0b29dc4b79a2a37a29a4f
diff --git a/dev-lang/erlang/erlang-22.0.7.ebuild b/dev-lang/erlang/erlang-22.0.7.ebuild
new file mode 100644 (file)
index 0000000..9b2c901
--- /dev/null
@@ -0,0 +1,149 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+WX_GTK_VER="3.0"
+
+inherit eapi7-ver elisp-common java-pkg-opt-2 systemd wxwidgets
+
+# NOTE: If you need symlinks for binaries please tell maintainers or
+# open up a bug to let it be created.
+
+UPSTREAM_V="$(ver_cut 1-2)"
+
+DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)"
+HOMEPAGE="https://www.erlang.org/"
+SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz
+       http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz
+       doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+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"
+IUSE="doc emacs +hipe java +kpoll libressl odbc sctp ssl systemd tk wxwidgets"
+
+RDEPEND="
+       sys-libs/ncurses:0
+       sys-libs/zlib
+       emacs? ( virtual/emacs )
+       java? ( >=virtual/jdk-1.8:* )
+       odbc? ( dev-db/unixODBC )
+       sctp? ( net-misc/lksctp-tools )
+       ssl? (
+               !libressl? ( >=dev-libs/openssl-0.9.7d:0= )
+               libressl? ( dev-libs/libressl:0= )
+       )
+       systemd? ( sys-apps/systemd )
+       tk? ( dev-lang/tk:0 )
+       wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
+"
+DEPEND="${RDEPEND}
+       dev-lang/perl
+"
+
+S="${WORKDIR}/otp-OTP-${PV}"
+
+PATCHES=(
+       "${FILESDIR}/18.2.1-wx3.0.patch"
+       "${FILESDIR}/${PN}-22.0-dont-ignore-LDFLAGS.patch"
+       "${FILESDIR}/${PN}-add-epmd-pid-file-creation-for-openrc.patch"
+)
+
+SITEFILE=50"${PN}"-gentoo.el
+
+src_prepare() {
+       default
+
+       ./otp_build autoconf
+}
+
+src_configure() {
+       use wxwidgets && setup-wxwidgets
+
+       local myconf=(
+               --disable-builtin-zlib
+               $(use_enable hipe)
+               $(use_enable kpoll kernel-poll)
+               $(use_with java javac)
+               $(use_enable sctp)
+               $(use_with ssl ssl "${EPREFIX}"/usr)
+               $(use_enable ssl dynamic-ssl-lib)
+               $(use_enable systemd)
+               $(usex wxwidgets "--with-wx-config=${WX_CONFIG}" "--with-wxdir=/dev/null")
+       )
+       econf "${myconf[@]}"
+}
+
+src_compile() {
+       emake
+
+       if use emacs ; then
+               pushd lib/tools/emacs &>/dev/null || die
+               elisp-compile *.el
+               popd &>/dev/null || die
+       fi
+}
+
+extract_version() {
+       local path="$1"
+       local var_name="$2"
+       sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || die "extract_version() failed"
+}
+
+src_install() {
+       local erl_libdir_rel="$(get_libdir)/erlang"
+       local erl_libdir="/usr/${erl_libdir_rel}"
+       local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)"
+       local erl_erts_ver="$(extract_version erts VSN)"
+       local my_manpath="/usr/share/${PN}/man"
+
+       [[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version"
+       [[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface version"
+
+       emake INSTALL_PREFIX="${D}" install
+
+       if use doc ; then
+               local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" "${WORKDIR}"/doc/. "${WORKDIR}"/lib/. "${WORKDIR}"/erts-* )
+               docompress -x /usr/share/doc/${PF}
+       else
+               local DOCS=("README.md")
+       fi
+
+       einstalldocs
+
+       dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl
+       dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc
+       dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript
+       dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call
+       dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp
+
+       ## Clean up the no longer needed files
+       rm "${ED}/${erl_libdir}/Install" || die
+
+       insinto "${my_manpath}"
+       doins -r "${WORKDIR}"/man/*
+       # extend MANPATH, so the normal man command can find it
+       # see bug 189639
+       newenvd - "90erlang" <<-_EOF_
+               MANPATH="${my_manpath}"
+       _EOF_
+
+       if use emacs ; then
+               elisp-install erlang lib/tools/emacs/*.{el,elc}
+               sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
+                       "${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die
+               elisp-site-file-install "${T}/${SITEFILE}"
+       fi
+
+       newinitd "${FILESDIR}"/epmd.init-r1 epmd
+       newconfd "${FILESDIR}"/epmd.confd epmd
+       use systemd && systemd_dounit "${FILESDIR}"/epmd.service
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}