Our version is a bit outdated, latest upstream stable release also dates back to last year.
https://raw.githubusercontent.com/libevent/libevent/release-2.1.11-stable/ChangeLog All patches except one are upstreamed, regress looks good on amd64 and quick tests with a few clients such as net/tor and sysutils/tmate show no regression on amd64. /usr/src/lib/check_sym shows removed symbols for all shared libraries except event_pthreads which did not change at all. `show-reverse-deps devel/libevent2' is huge, so I suppose this update is better tested in a bulk. Feedback? Index: Makefile =================================================================== RCS file: /cvs/ports/devel/libevent2/Makefile,v retrieving revision 1.17 diff -u -p -r1.17 Makefile --- Makefile 29 Mar 2020 17:26:23 -0000 1.17 +++ Makefile 29 Mar 2020 19:28:32 -0000 @@ -2,17 +2,16 @@ COMMENT= event notification library -V= 2.0.22 +V= 2.1.11 DISTNAME= libevent-$V-stable PKGNAME= libevent-$V -REVISION= 1 CATEGORIES= devel HOMEPAGE= https://libevent.org/ -SHARED_LIBS+= event_core 1.1 # 6.9 -SHARED_LIBS+= event_extra 0.1 # 6.9 -SHARED_LIBS+= event_openssl 0.0 # 6.9 -SHARED_LIBS+= event_pthreads 0.0 # 6.9 +SHARED_LIBS+= event_core 2.0 # 7.0 +SHARED_LIBS+= event_extra 1.0 # 7.0 +SHARED_LIBS+= event_openssl 1.0 # 7.0 +SHARED_LIBS+= event_pthreads 0.0 # 7.0 # BSD PERMIT_PACKAGE= Yes @@ -26,6 +25,8 @@ CONFIGURE_STYLE=gnu DEBUG_PACKAGES= ${BUILD_PACKAGES} MAKE_FLAGS= RELEASE="" + +SEPARATE_BUILD =Yes # Skip compatibility bits that conflict with libevent1 FAKE_FLAGS= LIBEVENT_LIBS_LA="libevent_core.la libevent_extra.la \ Index: distinfo =================================================================== RCS file: /cvs/ports/devel/libevent2/distinfo,v retrieving revision 1.7 diff -u -p -r1.7 distinfo --- distinfo 6 Jan 2015 21:28:05 -0000 1.7 +++ distinfo 29 Mar 2020 17:33:18 -0000 @@ -1,2 +1,2 @@ -SHA256 (libevent-2.0.22-stable.tar.gz) = ccLEnwra2s/b5jMqNyw4z5yLeJW7c9q+qlPNzB1OH6M= -SIZE (libevent-2.0.22-stable.tar.gz) = 854987 +SHA256 (libevent-2.1.11-stable.tar.gz) = plusYgLqjFYJ/Vx+SA5tJd5GfqGRfAgpDFIXUvFHKD0= +SIZE (libevent-2.1.11-stable.tar.gz) = 1082234 Index: patches/patch-evutil_rand_c =================================================================== RCS file: patches/patch-evutil_rand_c diff -N patches/patch-evutil_rand_c --- patches/patch-evutil_rand_c 6 Jan 2015 21:28:05 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -$OpenBSD: patch-evutil_rand_c,v 1.3 2015/01/06 21:28:05 sthen Exp $ -OpenBSD does not need nor provide arc4random_addrandom anymore. -And evutil_secure_rng_add_bytes is a bad API anyway. ---- evutil_rand.c.orig Mon Jan 5 15:17:40 2015 -+++ evutil_rand.c Mon Jan 5 23:01:59 2015 -@@ -171,10 +171,3 @@ evutil_secure_rng_get_bytes(void *buf, size_t n) - ev_arc4random_buf(buf, n); - } - --void --evutil_secure_rng_add_bytes(const char *buf, size_t n) --{ -- arc4random_addrandom((unsigned char*)buf, -- n>(size_t)INT_MAX ? INT_MAX : (int)n); --} -- Index: patches/patch-include_event2_util_h =================================================================== RCS file: patches/patch-include_event2_util_h diff -N patches/patch-include_event2_util_h --- patches/patch-include_event2_util_h 6 Jan 2015 21:28:05 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,26 +0,0 @@ -$OpenBSD: patch-include_event2_util_h,v 1.2 2015/01/06 21:28:05 sthen Exp $ ---- include/event2/util.h.orig Mon Jan 5 15:17:40 2015 -+++ include/event2/util.h Mon Jan 5 23:01:59 2015 -@@ -690,22 +690,6 @@ int evutil_secure_rng_init(void); - */ - int evutil_secure_rng_set_urandom_device_file(char *fname); - --/** Seed the random number generator with extra random bytes. -- -- You should almost never need to call this function; it should be -- sufficient to invoke evutil_secure_rng_init(), or let Libevent take -- care of calling evutil_secure_rng_init() on its own. -- -- If you call this function as a _replacement_ for the regular -- entropy sources, then you need to be sure that your input -- contains a fairly large amount of strong entropy. Doing so is -- notoriously hard: most people who try get it wrong. Watch out! -- -- @param dat a buffer full of a strong source of random numbers -- @param datlen the number of bytes to read from datlen -- */ --void evutil_secure_rng_add_bytes(const char *dat, size_t datlen); -- - #ifdef __cplusplus - } - #endif Index: patches/patch-libevent_pc_in =================================================================== RCS file: /cvs/ports/devel/libevent2/patches/patch-libevent_pc_in,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-libevent_pc_in --- patches/patch-libevent_pc_in 23 Sep 2011 08:50:12 -0000 1.1.1.1 +++ patches/patch-libevent_pc_in 29 Mar 2020 17:35:45 -0000 @@ -1,4 +1,7 @@ $OpenBSD: patch-libevent_pc_in,v 1.1.1.1 2011/09/23 08:50:12 naddy Exp $ + +Link against event_extra and event_core not event. + --- libevent.pc.in.orig Mon Sep 19 01:02:59 2011 +++ libevent.pc.in Mon Sep 19 01:03:15 2011 @@ -10,7 +10,7 @@ Description: libevent is an asynchronous notification Index: patches/patch-test_Makefile_in =================================================================== RCS file: patches/patch-test_Makefile_in diff -N patches/patch-test_Makefile_in --- patches/patch-test_Makefile_in 6 Jan 2015 21:28:05 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -$OpenBSD: patch-test_Makefile_in,v 1.1 2015/01/06 21:28:05 sthen Exp $ - -gmake-ism - ---- test/Makefile.in.orig Tue Jan 6 00:01:53 2015 -+++ test/Makefile.in Tue Jan 6 00:02:01 2015 -@@ -1068,7 +1068,7 @@ uninstall-am: - - - test-script.sh: test.sh -- cp $< $@ -+ cp test.sh $@ - - regress.gen.c regress.gen.h: rpcgen-attempted - Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/devel/libevent2/pkg/PLIST,v retrieving revision 1.2 diff -u -p -r1.2 PLIST --- pkg/PLIST 6 Jan 2015 21:28:05 -0000 1.2 +++ pkg/PLIST 29 Mar 2020 17:37:33 -0000 @@ -26,18 +26,21 @@ include/event2/tag.h include/event2/tag_compat.h include/event2/thread.h include/event2/util.h -lib/libevent_core.a +include/event2/visibility.h +@static-lib lib/libevent_core.a lib/libevent_core.la @lib lib/libevent_core.so.${LIBevent_core_VERSION} -lib/libevent_extra.a +@static-lib lib/libevent_extra.a lib/libevent_extra.la @lib lib/libevent_extra.so.${LIBevent_extra_VERSION} -lib/libevent_openssl.a +@static-lib lib/libevent_openssl.a lib/libevent_openssl.la @lib lib/libevent_openssl.so.${LIBevent_openssl_VERSION} -lib/libevent_pthreads.a +@static-lib lib/libevent_pthreads.a lib/libevent_pthreads.la @lib lib/libevent_pthreads.so.${LIBevent_pthreads_VERSION} lib/pkgconfig/libevent.pc +lib/pkgconfig/libevent_core.pc +lib/pkgconfig/libevent_extra.pc lib/pkgconfig/libevent_openssl.pc lib/pkgconfig/libevent_pthreads.pc