dev-libs/libevent: Sync with Gentoo

It's from Gentoo commit 78213a89b4a602460bf81ba5fab8eed561091ade.
This commit is contained in:
Krzesimir Nowak 2023-11-10 14:58:49 +01:00
parent 9a329c0028
commit 09c89bd5c9
9 changed files with 420 additions and 165 deletions

View File

@ -1,2 +1,4 @@
DIST libevent-2.1.11.tar.gz 1082234 BLAKE2B c6721589834bff027a8149ee0076e1877fba000d1712a405e20030192d9c81b892d0930bc1a4774650bef4cb08c60ac81b5928dc17346492ae7e4ded2125579a SHA512 9d0517b117f128f4f196b19a810524814bab75fa967d533063aaa619d3cf2dca97b443edd5805b764da2993d8e37caa536dce39f68ffcc2a88d32a89204c2de3 DIST libevent-2.1.12-stable.tar.gz 1100847 BLAKE2B bc1ace15f639ecef2e6b3f95976b8830c1d86f1d06606dd949e2978611fdf9859ed4eb9292d13e6e90e3835063edb94aae64a15c518d5dabe680f37d5a7f5290 SHA512 88d8944cd75cbe78bc4e56a6741ca67c017a3686d5349100f1c74f8a68ac0b6410ce64dff160be4a4ba0696ee29540dfed59aaf3c9a02f0c164b00307fcfe84f
DIST libevent-2.1.12.tar.gz 1100847 BLAKE2B bc1ace15f639ecef2e6b3f95976b8830c1d86f1d06606dd949e2978611fdf9859ed4eb9292d13e6e90e3835063edb94aae64a15c518d5dabe680f37d5a7f5290 SHA512 88d8944cd75cbe78bc4e56a6741ca67c017a3686d5349100f1c74f8a68ac0b6410ce64dff160be4a4ba0696ee29540dfed59aaf3c9a02f0c164b00307fcfe84f DIST libevent-2.1.12-stable.tar.gz.asc 488 BLAKE2B 629109913fe57110d0d78f5a7f18f36a7556b6b438ca65d9ce7c8f1d46e04cb9af4df8d7504d31165b510869154ea3a546e55a83bd7b1247bcfdf7c7d9509312 SHA512 841b57a0f6ba645b1871f257b9929093b11b7d6fd03332e6339adceddda233e78f6190faa2339e2b67b26dc2a56ddd7ce622792820b582168b31a2d1d1854f1f
DIST libevent-2.2.1-alpha-dev.tar.gz 1166550 BLAKE2B 4ab460a521aab90852ade14c937c06a21f8e5649a1a1dc4114f978a99272deb77b4e05923861e979f4ee5f50e04149d7b8f8e38294279757f27779597f407d79 SHA512 3e0ef283979a30cce11065c3b9a1078f3f006dbab86e8b49f75dc3aac2384085cb74477d95e5bc4e88c0d81ee2359fcd1cf292107d4791de87191019f2fcdfa5
DIST libevent-2.2.1-alpha-dev.tar.gz.asc 488 BLAKE2B d3e2b2782edd3bcabe42183b5b6647b6e55cd52292813901015a96c6eeec40e1ce57e9be731b2bd027c787f22b8ac5a587b7bed1dff95993bedde8b88fc1e89c SHA512 af720bce0829e806fb8bbb043eaf973fa6765ee17f059367b72344ce111a68f878b7a2fe361e4a3db61c7b4724c7dff19f960636b98e4208e7e27a2a077b8848

View File

@ -0,0 +1,105 @@
https://bugs.gentoo.org/880381
https://github.com/libevent/libevent/commit/35375101e741d78bf49642c6929c1eb69a7c3d79
From 35375101e741d78bf49642c6929c1eb69a7c3d79 Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <azat@libevent.org>
Date: Fri, 27 Jan 2023 08:57:33 +0100
Subject: [PATCH] Fixes some new warnings under clang-15
- -Wdeprecated-non-prototype
/src/le/libevent/strlcpy.c:48:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
event_strlcpy_(dst, src, siz)
- -Wstrict-prototypes
/src/le/libevent/evthread.c:82:70: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
struct evthread_condition_callbacks *evthread_get_condition_callbacks()
- -Wunused-but-set-variable
/src/le/libevent/test/regress_buffer.c:130:6: warning: variable 'n' set but not used [-Wunused-but-set-variable]
int n = 0;
^
---
evthread.c | 4 ++--
strlcpy.c | 6 +-----
test/regress_buffer.c | 5 -----
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/evthread.c b/evthread.c
index 3eac594d64..c2da914da1 100644
--- a/evthread.c
+++ b/evthread.c
@@ -74,12 +74,12 @@ evthread_set_id_callback(unsigned long (*id_fn)(void))
evthread_id_fn_ = id_fn;
}
-struct evthread_lock_callbacks *evthread_get_lock_callbacks()
+struct evthread_lock_callbacks *evthread_get_lock_callbacks(void)
{
return evthread_lock_debugging_enabled_
? &original_lock_fns_ : &evthread_lock_fns_;
}
-struct evthread_condition_callbacks *evthread_get_condition_callbacks()
+struct evthread_condition_callbacks *evthread_get_condition_callbacks(void)
{
return evthread_lock_debugging_enabled_
? &original_cond_fns_ : &evthread_cond_fns_;
diff --git a/strlcpy.c b/strlcpy.c
index 3876475f5a..04c74298dc 100644
--- a/strlcpy.c
+++ b/strlcpy.c
@@ -44,11 +44,7 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
-size_t
-event_strlcpy_(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
+size_t event_strlcpy_(char *dst, const char *src, size_t siz)
{
register char *d = dst;
register const char *s = src;
diff --git a/test/regress_buffer.c b/test/regress_buffer.c
index 5683810e26..b0a9e0c162 100644
--- a/test/regress_buffer.c
+++ b/test/regress_buffer.c
@@ -127,19 +127,16 @@ evbuffer_get_waste(struct evbuffer *buf, size_t *allocatedp, size_t *wastedp, si
{
struct evbuffer_chain *chain;
size_t a, w, u;
- int n = 0;
u = a = w = 0;
chain = buf->first;
/* skip empty at start */
while (chain && chain->off==0) {
- ++n;
a += chain->buffer_len;
chain = chain->next;
}
/* first nonempty chain: stuff at the end only is wasted. */
if (chain) {
- ++n;
a += chain->buffer_len;
u += chain->off;
if (chain->next && chain->next->off)
@@ -148,7 +145,6 @@ evbuffer_get_waste(struct evbuffer *buf, size_t *allocatedp, size_t *wastedp, si
}
/* subsequent nonempty chains */
while (chain && chain->off) {
- ++n;
a += chain->buffer_len;
w += (size_t)chain->misalign;
u += chain->off;
@@ -158,7 +154,6 @@ evbuffer_get_waste(struct evbuffer *buf, size_t *allocatedp, size_t *wastedp, si
}
/* subsequent empty chains */
while (chain) {
- ++n;
a += chain->buffer_len;
}
*allocatedp = a;

View File

@ -0,0 +1,30 @@
https://bugs.gentoo.org/903001
https://github.com/libevent/libevent/issues/1277
https://github.com/libevent/libevent/pull/1227
https://github.com/libevent/libevent/commit/883630f76cbf512003b81de25cd96cb75c6cf0f9
From 883630f76cbf512003b81de25cd96cb75c6cf0f9 Mon Sep 17 00:00:00 2001
From: Theo Buehler <tb@openbsd.org>
Date: Sun, 21 Nov 2021 21:38:20 +0100
Subject: [PATCH] Don't define BIO_get_init() for LibreSSL 3.5+
BIO_get_init() is available in LibreSSL 3.5 and later. The BIO type
will become opaque, so the existing macro will break the build.
---
openssl-compat.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/openssl-compat.h b/openssl-compat.h
index a23e34251b..f5de25539f 100644
--- a/openssl-compat.h
+++ b/openssl-compat.h
@@ -40,7 +40,8 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
#endif /* (OPENSSL_VERSION_NUMBER < 0x10100000L) || \
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) */
-#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x20700000L
+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x20700000L && \
+ LIBRESSL_VERSION_NUMBER < 0x30500000L
#define BIO_get_init(b) (b)->init
#endif

View File

@ -0,0 +1,152 @@
From 594ab34f1dfc73db85e8f95ec51892cadecaa76c Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <azat@libevent.org>
Date: Mon, 10 Jul 2023 10:40:49 +0200
Subject: [PATCH] Disable signalfd by default
signalfd may behave differently to sigaction/signal, so to avoid
breaking libevent users (like [1], [2]) disable it by default.
[1]: https://github.com/tmux/tmux/pull/3621
[2]: https://github.com/tmux/tmux/pull/3626
Also signalfd is not that perfect:
- you need to SIG_BLOCK the signal before
- blocked signals are not reset on exec
- blocked signals are allowed to coalesce - so in case of multiple
signals sent you may get the signal only once (ok for most of the
signals, but may be a problem for SIGCHLD, though you may call
waitpid() in a loop or use pidfd)
- and also one implementation problem -
sigprocmask is unspecified in a multithreaded process
Refs:
- https://lwn.net/Articles/415684/
- https://ldpreload.com/blog/signalfd-is-useless
Refs: https://github.com/libevent/libevent/issues/1460
Refs: #1342 (cc @dmantipov)
---
CMakeLists.txt | 1 +
include/event2/event.h | 6 ++++--
signalfd.c | 4 ++--
test/include.am | 2 ++
test/test.sh | 11 +++++++++--
5 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd41d16e57..9c402ec0c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1509,6 +1509,7 @@ if (NOT EVENT__DISABLE_TESTS)
else()
add_backend_test(${BACKEND} "${BACKEND_ENV_VARS}")
endif()
+ add_backend_test(signalfd_${BACKEND} "${BACKEND_ENV_VARS};EVENT_USE_SIGNALFD=1")
endforeach()
#
diff --git a/include/event2/event.h b/include/event2/event.h
index 384a84178b..9b971edf1d 100644
--- a/include/event2/event.h
+++ b/include/event2/event.h
@@ -599,9 +599,11 @@ enum event_base_config_flag {
*/
EVENT_BASE_FLAG_EPOLL_DISALLOW_TIMERFD = 0x40,
- /** Do not use signalfd(2) to handle signals even if supported.
+ /** Use signalfd(2) to handle signals over sigaction/signal.
+ *
+ * But note, that in some edge cases signalfd() may works differently.
*/
- EVENT_BASE_FLAG_DISALLOW_SIGNALFD = 0x80,
+ EVENT_BASE_FLAG_USE_SIGNALFD = 0x80,
};
/**
diff --git a/signalfd.c b/signalfd.c
index 376a04d539..ed31014e5f 100644
--- a/signalfd.c
+++ b/signalfd.c
@@ -205,8 +205,8 @@ sigfd_del(struct event_base *base, int signo, short old, short events, void *p)
int sigfd_init_(struct event_base *base)
{
EVUTIL_ASSERT(base != NULL);
- if ((base->flags & EVENT_BASE_FLAG_DISALLOW_SIGNALFD) ||
- getenv("EVENT_DISALLOW_SIGNALFD"))
+ if (!(base->flags & EVENT_BASE_FLAG_USE_SIGNALFD) &&
+ !getenv("EVENT_USE_SIGNALFD"))
return -1;
base->evsigsel = &sigfdops;
return 0;
diff --git a/test/include.am b/test/include.am
index e061c937b7..9b50759da7 100644
--- a/test/include.am
+++ b/test/include.am
@@ -80,6 +80,8 @@ test_runner_changelist: $(top_srcdir)/test/test.sh
$(top_srcdir)/test/test.sh -b "" -c
test_runner_timerfd_changelist: $(top_srcdir)/test/test.sh
$(top_srcdir)/test/test.sh -b "" -T
+test_runner_timerfd_changelist: $(top_srcdir)/test/test.sh
+ $(top_srcdir)/test/test.sh -b "" -S
DISTCLEANFILES += test/regress.gen.c test/regress.gen.h
diff --git a/test/test.sh b/test/test.sh
index dfdd2bf098..79362888c5 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -50,6 +50,7 @@ setup () {
done
unset EVENT_EPOLL_USE_CHANGELIST
unset EVENT_PRECISE_TIMER
+ unset EVENT_USE_SIGNALFD
}
announce () {
@@ -138,10 +139,12 @@ do_test() {
EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST
elif test "$2" = "(timerfd)" ; then
EVENT_PRECISE_TIMER=1; export EVENT_PRECISE_TIMER
+ elif test "$2" = "(signalfd)" ; then
+ EVENT_USE_SIGNALFD=1; export EVENT_USE_SIGNALFD
elif test "$2" = "(timerfd+changelist)" ; then
EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST
EVENT_PRECISE_TIMER=1; export EVENT_PRECISE_TIMER
- fi
+ fi
run_tests
}
@@ -153,6 +156,7 @@ usage()
-t - run timerfd test
-c - run changelist test
-T - run timerfd+changelist test
+ -S - run signalfd test
EOL
}
main()
@@ -161,13 +165,15 @@ main()
timerfd=0
changelist=0
timerfd_changelist=0
+ signalfd=0
- while getopts "b:tcT" c; do
+ while getopts "b:tcTS" c; do
case "$c" in
b) backends="$OPTARG";;
t) timerfd=1;;
c) changelist=1;;
T) timerfd_changelist=1;;
+ S) signalfd=1;;
?*) usage && exit 1;;
esac
done
@@ -179,6 +185,7 @@ main()
[ $timerfd_changelist -eq 0 ] || do_test EPOLL "(timerfd+changelist)"
for i in $backends; do
do_test $i
+ [ $signalfd -eq 0 ] || do_test $i "(signalfd)"
done
if test "$FAILED" = "yes"; then

View File

@ -1,63 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit multilib-minimal
DESCRIPTION="Library to execute a function when a specific event occurs on a file descriptor"
HOMEPAGE="
https://libevent.org/
https://github.com/libevent/libevent/
"
SRC_URI="
https://github.com/${PN}/${PN}/releases/download/release-${PV/_/-}-stable/${P/_/-}-stable.tar.gz -> ${P}.tar.gz
"
LICENSE="BSD"
SLOT="0/2.1-7"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="debug +ssl static-libs test +threads"
RESTRICT="!test? ( test )"
DEPEND="
ssl? (
>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
)
"
RDEPEND="
${DEPEND}
!<=dev-libs/9libs-1.0
"
MULTILIB_WRAPPED_HEADERS=(
/usr/include/event2/event-config.h
)
S=${WORKDIR}/${P/_/-}-stable
multilib_src_configure() {
# fix out-of-source builds
mkdir -p test || die
ECONF_SOURCE="${S}" \
econf \
--disable-samples \
$(use_enable debug debug-mode) \
$(use_enable debug malloc-replacement) \
$(use_enable ssl openssl) \
$(use_enable static-libs static) \
$(use_enable test libevent-regress) \
$(use_enable threads thread-support)
}
src_test() {
# The test suite doesn't quite work (see bug #406801 for the latest
# installment in a riveting series of reports).
:
# emake -C test check | tee "${T}"/tests
}
DOCS=( ChangeLog{,-1.4,-2.0} )
multilib_src_install_all() {
einstalldocs
find "${ED}" -name '*.la' -delete || die
}

View File

@ -1,25 +1,31 @@
# Copyright 1999-2022 Gentoo Authors # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=7
inherit autotools multilib-minimal inherit libtool multilib-minimal verify-sig
MY_P="${P}-stable"
DESCRIPTION="Library to execute a function when a specific event occurs on a file descriptor" DESCRIPTION="Library to execute a function when a specific event occurs on a file descriptor"
HOMEPAGE=" HOMEPAGE="
https://libevent.org/ https://libevent.org/
https://github.com/libevent/libevent/ https://github.com/libevent/libevent/
" "
BASE_URI="https://github.com/libevent/libevent/releases/download/release-${MY_P#*-}"
SRC_URI=" SRC_URI="
https://github.com/${PN}/${PN}/releases/download/release-${PV/_/-}-stable/${P/_/-}-stable.tar.gz -> ${P}.tar.gz ${BASE_URI}/${MY_P}.tar.gz
verify-sig? (
${BASE_URI}/${MY_P}.tar.gz.asc
)
" "
LICENSE="BSD" S=${WORKDIR}/${MY_P}
LICENSE="BSD"
SLOT="0/2.1-7" SLOT="0/2.1-7"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
IUSE=" IUSE="
+clock-gettime debug malloc-replacement +ssl static-libs test +clock-gettime debug malloc-replacement +ssl static-libs test
+threads verbose-debug verbose-debug
" "
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"
@ -32,10 +38,20 @@ RDEPEND="
${DEPEND} ${DEPEND}
!<=dev-libs/9libs-1.0 !<=dev-libs/9libs-1.0
" "
BDEPEND="
verify-sig? (
sec-keys/openpgp-keys-libevent
)
"
MULTILIB_WRAPPED_HEADERS=( MULTILIB_WRAPPED_HEADERS=(
/usr/include/event2/event-config.h /usr/include/event2/event-config.h
) )
S=${WORKDIR}/${P/_/-}-stable PATCHES=(
"${FILESDIR}"/${P}-clang16.patch #880381
"${FILESDIR}"/${P}-libressl.patch #903001
)
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libevent.asc
src_prepare() { src_prepare() {
default default
@ -55,7 +71,6 @@ multilib_src_configure() {
$(use_enable ssl openssl) \ $(use_enable ssl openssl) \
$(use_enable static-libs static) \ $(use_enable static-libs static) \
$(use_enable test libevent-regress) \ $(use_enable test libevent-regress) \
$(use_enable threads thread-support) \
$(use_enable verbose-debug) \ $(use_enable verbose-debug) \
--disable-samples --disable-samples
} }

View File

@ -1,67 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools git-r3 multilib-minimal
DESCRIPTION="Library to execute a function when a specific event occurs on a file descriptor"
EGIT_BRANCH="patches-$(ver_cut 1-2)"
EGIT_REPO_URI="https://github.com/libevent/libevent"
HOMEPAGE="
https://libevent.org/
https://github.com/libevent/libevent
"
LICENSE="BSD"
# libevent-2.1.so.6
SLOT="0/2.1-7"
KEYWORDS=""
IUSE="
+clock-gettime debug malloc-replacement +ssl static-libs test
+threads verbose-debug
"
RESTRICT="test"
DEPEND="
ssl? (
>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
)
"
RDEPEND="
${DEPEND}
!<=dev-libs/9libs-1.0
"
MULTILIB_WRAPPED_HEADERS=(
/usr/include/event2/event-config.h
)
DOCS=(
ChangeLog{,-1.4,-2.0}
)
src_prepare() {
default
eautoreconf
}
multilib_src_configure() {
# fix out-of-source builds
mkdir -p test || die
ECONF_SOURCE="${S}" \
econf \
$(use_enable clock-gettime) \
$(use_enable debug debug-mode) \
$(use_enable malloc-replacement malloc-replacement) \
$(use_enable ssl openssl) \
$(use_enable static-libs static) \
$(use_enable test libevent-regress) \
$(use_enable threads thread-support) \
$(use_enable verbose-debug) \
--disable-samples
}
multilib_src_install_all() {
einstalldocs
find "${ED}" -name '*.la' -delete || die
}

View File

@ -0,0 +1,83 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit multilib-minimal verify-sig
MY_P="${P}-alpha-dev"
DESCRIPTION="Library to execute a function when a specific event occurs on a file descriptor"
HOMEPAGE="
https://libevent.org/
https://github.com/libevent/libevent/
"
BASE_URI="https://github.com/libevent/libevent/releases/download/release-${PV}-alpha"
SRC_URI="
${BASE_URI}/${MY_P}.tar.gz
verify-sig? (
${BASE_URI}/${MY_P}.tar.gz.asc
)
"
S=${WORKDIR}/${MY_P}
LICENSE="BSD"
SLOT="0/2.2.1-r2"
KEYWORDS=""
IUSE="
+clock-gettime debug malloc-replacement mbedtls +ssl static-libs
test verbose-debug
"
# TODO: hangs
RESTRICT="test"
DEPEND="
mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
ssl? ( >=dev-libs/openssl-1.0.1h-r2:=[${MULTILIB_USEDEP}] )
"
RDEPEND="
${DEPEND}
"
BDEPEND="
verify-sig? (
sec-keys/openpgp-keys-libevent
)
"
DOCS=( README.md ChangeLog{,-1.4,-2.0} whatsnew-2.{0,1}.txt )
MULTILIB_WRAPPED_HEADERS=(
/usr/include/event2/event-config.h
)
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libevent.asc
PATCHES=(
# signalfd-by-default breaks at least app-misc/tmux
# https://github.com/libevent/libevent/pull/1486
"${FILESDIR}/${P}-disable-signalfd.patch"
)
multilib_src_configure() {
# fix out-of-source builds
mkdir -p test || die
local ECONF_SOURCE="${S}"
local myconf=(
$(use_enable clock-gettime)
$(use_enable debug debug-mode)
$(use_enable malloc-replacement malloc-replacement)
$(use_enable mbedtls)
$(use_enable ssl openssl)
$(use_enable static-libs static)
$(use_enable test libevent-regress)
$(use_enable verbose-debug)
--disable-samples
)
econf "${myconf[@]}"
# workaround https://github.com/libevent/libevent/issues/1459
sed -i -e 's:@CMAKE_DEBUG_POSTFIX@::' *.pc || die
}
multilib_src_install_all() {
einstalldocs
find "${ED}" -name '*.la' -delete || die
}

View File

@ -1,42 +1,39 @@
# Copyright 1999-2021 Gentoo Authors # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=8
inherit autotools git-r3 multilib-minimal inherit autotools git-r3 multilib-minimal
DESCRIPTION="Library to execute a function when a specific event occurs on a file descriptor" DESCRIPTION="Library to execute a function when a specific event occurs on a file descriptor"
EGIT_REPO_URI="https://github.com/libevent/libevent"
HOMEPAGE=" HOMEPAGE="
https://libevent.org/ https://libevent.org/
https://github.com/libevent/libevent https://github.com/libevent/libevent/
" "
EGIT_REPO_URI="https://github.com/libevent/libevent.git"
LICENSE="BSD" LICENSE="BSD"
SLOT="0" SLOT="0/2.2"
KEYWORDS="" KEYWORDS=""
IUSE=" IUSE="
+clock-gettime debug malloc-replacement mbedtls +ssl static-libs +clock-gettime debug malloc-replacement mbedtls +ssl static-libs
test +threads verbose-debug test verbose-debug
" "
# TODO: hangs
RESTRICT="test" RESTRICT="test"
DEPEND=" DEPEND="
mbedtls? ( net-libs/mbedtls ) mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
ssl? ( ssl? ( >=dev-libs/openssl-1.0.1h-r2:=[${MULTILIB_USEDEP}] )
>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
)
" "
RDEPEND=" RDEPEND="
${DEPEND} ${DEPEND}
!<=dev-libs/9libs-1.0
" "
DOCS=( README.md ChangeLog{,-1.4,-2.0} whatsnew-2.{0,1}.txt )
MULTILIB_WRAPPED_HEADERS=( MULTILIB_WRAPPED_HEADERS=(
/usr/include/event2/event-config.h /usr/include/event2/event-config.h
) )
DOCS=(
ChangeLog{,-1.4,-2.0}
)
src_prepare() { src_prepare() {
default default
@ -47,18 +44,19 @@ multilib_src_configure() {
# fix out-of-source builds # fix out-of-source builds
mkdir -p test || die mkdir -p test || die
ECONF_SOURCE="${S}" \ local ECONF_SOURCE="${S}"
econf \ local myconf=(
$(use_enable clock-gettime) \ $(use_enable clock-gettime)
$(use_enable debug debug-mode) \ $(use_enable debug debug-mode)
$(use_enable malloc-replacement malloc-replacement) \ $(use_enable malloc-replacement malloc-replacement)
$(use_enable mbedtls) \ $(use_enable mbedtls)
$(use_enable ssl openssl) \ $(use_enable ssl openssl)
$(use_enable static-libs static) \ $(use_enable static-libs static)
$(use_enable test libevent-regress) \ $(use_enable test libevent-regress)
$(use_enable threads thread-support) \ $(use_enable verbose-debug)
$(use_enable verbose-debug) \
--disable-samples --disable-samples
)
econf "${myconf[@]}"
} }
multilib_src_install_all() { multilib_src_install_all() {