logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git
commit: 9f86f8bd2798d69b70e0cbf7c49b272004d4e881
parent 09b6e63f690560b51f5ff9f3f855cf4bf43d4082
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  4 Apr 2023 10:14:21 +0200

dev-lang/erlang: new package, add 26.0_rc2

Diffstat:

Adev-lang/erlang/Manifest3+++
Adev-lang/erlang/erlang-26.0_rc2.ebuild174+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adev-lang/erlang/files/50erlang-gentoo.el5+++++
Adev-lang/erlang/files/epmd.confd-r22++
Adev-lang/erlang/files/epmd.init-r223+++++++++++++++++++++++
Adev-lang/erlang/files/epmd.init-r323+++++++++++++++++++++++
Adev-lang/erlang/files/epmd.service9+++++++++
Adev-lang/erlang/files/epmd.service-r111+++++++++++
Adev-lang/erlang/files/erlang-22.0-dont-ignore-LDFLAGS.patch27+++++++++++++++++++++++++++
Adev-lang/erlang/files/erlang-24.0.2-serial-configure.patch12++++++++++++
Adev-lang/erlang/files/erlang-25.1.2-c99.patch101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11 files changed, 390 insertions(+), 0 deletions(-)

diff --git a/dev-lang/erlang/Manifest b/dev-lang/erlang/Manifest @@ -0,0 +1,3 @@ +DIST erlang-26.0-rc2.tar.gz 61227508 BLAKE2B e6f66a54c73a4d441d1daaf5e169e700e73924cee516e325ada7d2d8a957b3768cf829037d8c4a530868a689ceb94e05f29157aff32c3b6059a096099a04579c SHA512 eb7a735dd3c65a17981e077f1120cd4b4a6c9f8f8d92087856c3c92a085ee0e5b5b4d4b525f91b3192f2175b4b78494dd8676e61f817cbbc0dc1ba4dba9bb8d1 +DIST erlang_doc_html_26.0-rc2.tar.gz 37345555 BLAKE2B 350320c4e590e5241b6edd6487b4846eed1b4c0c0deec891f7ce681d283827f06ab9cbcab8612ce5ae5cfff33455e5ea88ea479ec5b8c0342587be45d6651882 SHA512 7dc3b0792b0854db92834aa95941adde63f48b1638ea166cf9aaf95395d36692c37b1c19f468002f16f1aef99f21c7c4db0fe2f60f86d2b723da417595398fa1 +DIST erlang_doc_man_26.0-rc2.tar.gz 1732843 BLAKE2B 78e15af566e0f5daaa56337590328f2b4fbe3431ede567feaa456654037de1a1c13a46d062be9adc5489e59c705753a50b9f7476d53e544e8b022bcaae1b4d77 SHA512 029428fd105cf6693086b94ae54fb9b9498bad3712d3a2e54c3be41becf457f6a90f08cece790d4162025954aa9c0a9f2064891ff28cf21c168c8a81c839ecc4 diff --git a/dev-lang/erlang/erlang-26.0_rc2.ebuild b/dev-lang/erlang/erlang-26.0_rc2.ebuild @@ -0,0 +1,174 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +WX_GTK_VER="3.0-gtk3" + +inherit elisp-common flag-o-matic java-pkg-opt-2 systemd toolchain-funcs wxwidgets + +# NOTE: If you need symlinks for binaries please tell maintainers or +# open up a bug to let it be created. + +UPSTREAM_V="$(ver_rs 2 -)" + +DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)" +HOMEPAGE="https://www.erlang.org/" +SRC_URI="https://github.com/erlang/otp/archive/OTP-${UPSTREAM_V}.tar.gz -> ${PN}-${UPSTREAM_V}.tar.gz + https://github.com/erlang/otp/releases/download/OTP-${UPSTREAM_V}/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz + doc? ( https://github.com/erlang/otp/releases/download/OTP-${UPSTREAM_V}/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )" + +LICENSE="Apache-2.0" +# We use this subslot because Compiled HiPE Code can be loaded on the exact +# same build of ERTS that was used when compiling the code. See +# http://erlang.org/doc/system_principles/misc.html for more information. +SLOT="0/${PV}" +#KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="doc emacs java +kpoll odbc sctp ssl systemd tk wxwidgets" + +RDEPEND=" + acct-group/epmd + acct-user/epmd + sys-libs/ncurses:0 + sys-libs/zlib + emacs? ( >=app-editors/emacs-23.1:* ) + java? ( >=virtual/jdk-1.8:* ) + odbc? ( dev-db/unixODBC ) + sctp? ( net-misc/lksctp-tools ) + ssl? ( >=dev-libs/openssl-0.9.7d:0= ) + systemd? ( sys-apps/systemd ) + wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] ) +" +DEPEND="${RDEPEND} + dev-lang/perl +" + +S="${WORKDIR}/otp-OTP-${UPSTREAM_V}" + +PATCHES=( + "${FILESDIR}"/${PN}-22.0-dont-ignore-LDFLAGS.patch + "${FILESDIR}"/${PN}-24.0.2-serial-configure.patch + "${FILESDIR}"/${PN}-25.1.2-c99.patch # Bug #882887 +) + +SITEFILE=50"${PN}"-gentoo.el + +src_prepare() { + default + + tc-export AR CPP CXX LD + + # bug #797886: erlang's VM does unsafe casts for ints + # to pointers and back. This breaks on gcc-11 -flto. + append-flags -fno-strict-aliasing +} + +src_configure() { + use wxwidgets && setup-wxwidgets + + local myconf=( + --disable-builtin-zlib + + # don't search for static zlib + --with-ssl-zlib=no + + $(use_enable kpoll kernel-poll) + $(use_with java javac) + $(use_enable sctp) + $(use_with ssl ssl) + $(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 doc ; then + emake docs DOC_TARGETS=chunks + fi + + 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 + emake INSTALL_PREFIX="${D}" install-docs DOC_TARGETS=chunks + + # Note: we explicitly install docs into: + # /usr/share/doc/${PF}/{doc,lib,erts-*} + # To maintain that layout we gather everything in 'html-docs'. + # See bug #684376. + mkdir html-docs || die + mv "${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-* html-docs/ || die + local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" html-docs/. ) + 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-r3 epmd + use systemd && systemd_newunit "${FILESDIR}"/epmd.service-r1 epmd.service +} + +src_test() { + # Only run a subset of tests to test that everything was built + # successfully, otherwise we will be here for a long time. + emake kernel_test ARGS="-suite os_SUITE" +} + +pkg_postinst() { + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +} diff --git a/dev-lang/erlang/files/50erlang-gentoo.el b/dev-lang/erlang/files/50erlang-gentoo.el @@ -0,0 +1,5 @@ +;;; erlang site-lisp configuration + +(add-to-list 'load-path "@SITELISP@") +(require 'erlang-start) +(setq erlang-root-dir "/usr/share") diff --git a/dev-lang/erlang/files/epmd.confd-r2 b/dev-lang/erlang/files/epmd.confd-r2 @@ -0,0 +1,2 @@ +#arguments for run erlang +command_args="-address 127.0.0.1" diff --git a/dev-lang/erlang/files/epmd.init-r2 b/dev-lang/erlang/files/epmd.init-r2 @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the Erlang Public License 1.1 + +name="Erlang Port Mapper Daemon" + +command="/usr/bin/epmd" +command_user="epmd" +command_group="epmd" + +command_background=yes +pidfile="/var/run/epmd.pid" + +depend() { + need loopback + before sshd +} + +stop() { + ebegin "Stopping ${name}" + ${command} -kill >/dev/null + eend $? +} diff --git a/dev-lang/erlang/files/epmd.init-r3 b/dev-lang/erlang/files/epmd.init-r3 @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the Erlang Public License 1.1 + +name="Erlang Port Mapper Daemon" + +command="/usr/bin/epmd" +command_user="epmd" +command_group="epmd" + +command_background=yes +pidfile="/var/run/epmd.pid" + +depend() { + use net + before sshd +} + +stop() { + ebegin "Stopping ${name}" + ${command} -kill >/dev/null + eend $? +} diff --git a/dev-lang/erlang/files/epmd.service b/dev-lang/erlang/files/epmd.service @@ -0,0 +1,9 @@ +[Unit] +Description=Erlang Portmapper Daemon +Wants=network.target + +[Service] +ExecStart=/usr/bin/epmd + +[Install] +WantedBy=multi-user.target diff --git a/dev-lang/erlang/files/epmd.service-r1 b/dev-lang/erlang/files/epmd.service-r1 @@ -0,0 +1,11 @@ +[Unit] +Description=Erlang Portmapper Daemon +Wants=network.target + +[Service] +ExecStart=/usr/bin/epmd +User=epmd +Group=epmd + +[Install] +WantedBy=multi-user.target diff --git a/dev-lang/erlang/files/erlang-22.0-dont-ignore-LDFLAGS.patch b/dev-lang/erlang/files/erlang-22.0-dont-ignore-LDFLAGS.patch @@ -0,0 +1,27 @@ +This is a forward port of erlang-20.3.2-dont-ignore-LDFLAGS.patch +Anthony G. Basile <blueness@gentoo.org> + +diff -Naur otp-OTP-22.0.orig/lib/megaco/src/flex/Makefile.in otp-OTP-22.0/lib/megaco/src/flex/Makefile.in +--- otp-OTP-22.0.orig/lib/megaco/src/flex/Makefile.in 2019-05-10 12:42:49.000000000 +0000 ++++ otp-OTP-22.0/lib/megaco/src/flex/Makefile.in 2019-06-04 15:53:37.899372564 +0000 +@@ -47,7 +47,7 @@ + CC = @DED_CC@ + CFLAGS_MT = $(CFLAGS) @DED_THR_DEFS@ + LD = @DED_LD@ +-LDFLAGS = @DED_LDFLAGS@ ++LDFLAGS += @DED_LDFLAGS@ + LEX = @LEX@ + LEXLIB = @LEXLIB@ + PERL = @PERL@ +diff -Naur otp-OTP-22.0.orig/lib/odbc/c_src/Makefile.in otp-OTP-22.0/lib/odbc/c_src/Makefile.in +--- otp-OTP-22.0.orig/lib/odbc/c_src/Makefile.in 2019-05-10 12:42:49.000000000 +0000 ++++ otp-OTP-22.0/lib/odbc/c_src/Makefile.in 2019-06-04 15:53:37.900372572 +0000 +@@ -82,7 +82,7 @@ + CFLAGS = $(TYPEFLAGS) @CFLAGS@ @THR_DEFS@ @DEFS@ + EI_LDFLAGS = -L$(EI_ROOT)/obj$(TYPEMARKER)/$(TARGET) + LD = @LD@ +-LDFLAGS = $(ODBC_LIB) $(EI_LDFLAGS) ++LDFLAGS += $(ODBC_LIB) $(EI_LDFLAGS) + LIBS = @LIBS@ @THR_LIBS@ $(EI_LIB) + INCLUDES = -I. $(ODBC_INCLUDE) $(EI_INCLUDE) + TARGET_FLAGS = @TARGET_FLAGS@ diff --git a/dev-lang/erlang/files/erlang-24.0.2-serial-configure.patch b/dev-lang/erlang/files/erlang-24.0.2-serial-configure.patch @@ -0,0 +1,12 @@ +https://bugs.gentoo.org/790563 +--- a/configure ++++ b/configure +@@ -355,7 +355,7 @@ for app_dir in $app_dirs; do + echo "" + elif test $app_dir != erts; then + echo $cmd_str >./configure.result.command +- eval $cmd_str 1>./configure.result.stdout 2>./configure.result.stderr || echo "fatal" > "./configure.result.failed" & ++ eval $cmd_str 1>./configure.result.stdout 2>./configure.result.stderr || echo "fatal" > "./configure.result.failed" + else + # ERTS configure gets to use stdout/stderr; the others are printed when done... + echo "=== Running configure in $ERL_TOP/erts ===" diff --git a/dev-lang/erlang/files/erlang-25.1.2-c99.patch b/dev-lang/erlang/files/erlang-25.1.2-c99.patch @@ -0,0 +1,101 @@ +Bug: https://bugs.gentoo.org/882887 +From: https://github.com/erlang/otp/pull/6504 +From: Florian Weimer <fweimer@redhat.com> +Date: Thu, 24 Nov 2022 11:57:49 +0100 +Subject: [PATCH 1/2] configure.ac: C99 fix for + ERTS___AFTER_MORECORE_HOOK_CAN_TRACK_MALLOC + +#include <unistd.h> for the sbrk function if the header is available. +--- a/erts/configure ++++ b/erts/configure +@@ -20752,6 +20752,9 @@ else $as_nop + #ifdef HAVE_MALLOC_H + # include <malloc.h> + #endif ++#ifdef HAVE_UNISTD_H ++# include <unistd.h> ++#endif + #if defined(HAVE_END_SYMBOL) + extern char end; + #elif defined(HAVE__END_SYMBOL) +--- a/erts/configure.ac ++++ b/erts/configure.ac +@@ -2436,6 +2436,9 @@ AC_CACHE_CHECK([if __after_morecore_hook can track malloc()s core memory use], + #ifdef HAVE_MALLOC_H + # include <malloc.h> + #endif ++#ifdef HAVE_UNISTD_H ++# include <unistd.h> ++#endif + #if defined(HAVE_END_SYMBOL) + extern char end; + #elif defined(HAVE__END_SYMBOL) + +From 7b720d2bb9e742110ff90ec2495747b2c477e2c7 Mon Sep 17 00:00:00 2001 +From: Florian Weimer <fweimer@redhat.com> +Date: Thu, 24 Nov 2022 11:59:22 +0100 +Subject: [PATCH 2/2] configure.ac: C99 fixes for poll_works check + +Include <fcntl.h> if it is available for the open prototype. +Return from main instead of calling exit, so that no function +declaration is needed. +--- a/erts/configure ++++ b/erts/configure +@@ -24663,10 +24663,13 @@ else $as_nop + /* end confdefs.h. */ + + #include <poll.h> +-main() ++#ifdef HAVE_FCNTL_H ++#include <fcntl.h> ++#endif ++int main() + { + #ifdef _POLL_EMUL_H_ +- exit(1); /* Implemented using select() -- fail */ ++ return 1; /* Implemented using select() -- fail */ + #else + struct pollfd fds[1]; + int fd; +@@ -24675,9 +24678,9 @@ main() + fds[0].events = POLLIN; + fds[0].revents = 0; + if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) { +- exit(1); /* Does not work for devices -- fail */ ++ return 1; /* Does not work for devices -- fail */ + } +- exit(0); ++ return 0; + #endif + } + +--- a/erts/configure.ac ++++ b/erts/configure.ac +@@ -3036,10 +3036,13 @@ poll_works=no + + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include <poll.h> +-main() ++#ifdef HAVE_FCNTL_H ++#include <fcntl.h> ++#endif ++int main() + { + #ifdef _POLL_EMUL_H_ +- exit(1); /* Implemented using select() -- fail */ ++ return 1; /* Implemented using select() -- fail */ + #else + struct pollfd fds[1]; + int fd; +@@ -3048,9 +3051,9 @@ main() + fds[0].events = POLLIN; + fds[0].revents = 0; + if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) { +- exit(1); /* Does not work for devices -- fail */ ++ return 1; /* Does not work for devices -- fail */ + } +- exit(0); ++ return 0; + #endif + } + ]])],[poll_works=yes],[poll_works=no],[