Fredrik Fornwall
8 years ago
9 changed files with 225 additions and 38 deletions
@ -0,0 +1,21 @@ |
|||
See https://github.com/libevent/libevent/pull/442 |
|||
|
|||
diff -u -r ../libevent-release-2.1.8-stable/include/event2/bufferevent_compat.h ./include/event2/bufferevent_compat.h
|
|||
--- ../libevent-release-2.1.8-stable/include/event2/bufferevent_compat.h 2017-01-26 00:37:15.000000000 +0100
|
|||
+++ ./include/event2/bufferevent_compat.h 2017-01-28 00:45:04.068858074 +0100
|
|||
@@ -72,6 +72,7 @@
|
|||
error occurred |
|||
@see bufferevent_base_set(), bufferevent_free() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
struct bufferevent *bufferevent_new(evutil_socket_t fd, |
|||
evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg); |
|||
|
|||
@@ -83,6 +84,7 @@
|
|||
@param timeout_read the read timeout |
|||
@param timeout_write the write timeout |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
void bufferevent_settimeout(struct bufferevent *bufev, |
|||
int timeout_read, int timeout_write); |
|||
|
@ -1,7 +1,29 @@ |
|||
TERMUX_PKG_HOMEPAGE=http://libevent.org/ |
|||
TERMUX_PKG_DESCRIPTION="Library that provides asynchronous event notification" |
|||
TERMUX_PKG_VERSION=2.0.22 |
|||
TERMUX_PKG_REVISION=2 |
|||
TERMUX_PKG_SRCURL=https://github.com/libevent/libevent/releases/download/release-${TERMUX_PKG_VERSION}-stable/libevent-${TERMUX_PKG_VERSION}-stable.tar.gz |
|||
TERMUX_PKG_VERSION=2.1.8 |
|||
TERMUX_PKG_SRCURL=https://github.com/libevent/libevent/archive/release-${TERMUX_PKG_VERSION}-stable.tar.gz |
|||
TERMUX_PKG_SHA256=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d |
|||
# Strip away libevent core, extra and openssl libraries until someone uses them |
|||
TERMUX_PKG_RM_AFTER_INSTALL="bin/event_rpcgen.py lib/libevent_*" |
|||
TERMUX_PKG_FOLDERNAME=libevent-release-${TERMUX_PKG_VERSION}-stable |
|||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="\ |
|||
-DEVENT__BUILD_SHARED_LIBRARIES=ON |
|||
-DEVENT__DISABLE_BENCHMARK=ON |
|||
-DEVENT__DISABLE_OPENSSL=ON |
|||
-DEVENT__DISABLE_REGRESS=ON |
|||
-DEVENT__DISABLE_SAMPLES=ON |
|||
-DEVENT__DISABLE_TESTS=ON |
|||
-DEVENT__DISABLE_TESTS=ON |
|||
-DEVENT__HAVE_WAITPID_WITH_WNOWAIT=ON |
|||
-DEVENT__SIZEOF_PTHREAD_T=$((TERMUX_ARCH_BITS/8)) |
|||
" |
|||
termux_step_post_make_install() { |
|||
# Building with cmake does not install .pc files, see |
|||
# https://github.com/libevent/libevent/issues/443 |
|||
cat > "$PKG_CONFIG_LIBDIR/libevent.pc" <<-HERE |
|||
Name: libevent |
|||
Description: libevent is an asynchronous notification event loop library |
|||
Version: ${TERMUX_PKG_VERSION}-stable |
|||
Libs: -levent |
|||
HERE |
|||
} |
|||
|
@ -0,0 +1,153 @@ |
|||
See https://github.com/libevent/libevent/pull/442 |
|||
|
|||
diff -u -r ../libevent-release-2.1.8-stable/include/event2/dns_compat.h ./include/event2/dns_compat.h
|
|||
--- ../libevent-release-2.1.8-stable/include/event2/dns_compat.h 2017-01-26 00:37:15.000000000 +0100
|
|||
+++ ./include/event2/dns_compat.h 2017-01-28 01:02:54.391639424 +0100
|
|||
@@ -66,6 +66,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_shutdown() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_init(void); |
|||
|
|||
struct evdns_base; |
|||
@@ -76,6 +77,7 @@
|
|||
@deprecated This function is deprecated because use of the global |
|||
evdns_base is error-prone. |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
struct evdns_base *evdns_get_global_base(void); |
|||
|
|||
/** |
|||
@@ -93,6 +95,7 @@
|
|||
active requests will return DNS_ERR_SHUTDOWN. |
|||
@see evdns_init() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
void evdns_shutdown(int fail_requests); |
|||
|
|||
/** |
|||
@@ -109,6 +112,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_nameserver_ip_add() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_nameserver_add(unsigned long int address); |
|||
|
|||
/** |
|||
@@ -126,6 +130,7 @@
|
|||
@return the number of configured nameservers |
|||
@see evdns_nameserver_add() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_count_nameservers(void); |
|||
|
|||
/** |
|||
@@ -140,6 +145,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_resume() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_clear_nameservers_and_suspend(void); |
|||
|
|||
/** |
|||
@@ -155,6 +161,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_clear_nameservers_and_suspend() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_resume(void); |
|||
|
|||
/** |
|||
@@ -170,6 +177,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_nameserver_add() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_nameserver_ip_add(const char *ip_as_string); |
|||
|
|||
/** |
|||
@@ -186,6 +194,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_resolve_ipv6(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_resolve_ipv4(const char *name, int flags, evdns_callback_type callback, void *ptr); |
|||
|
|||
/** |
|||
@@ -198,6 +207,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_resolve_ipv4(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_resolve_ipv6(const char *name, int flags, evdns_callback_type callback, void *ptr); |
|||
|
|||
struct in_addr; |
|||
@@ -217,6 +227,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_resolve_reverse_ipv6() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_resolve_reverse(const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr); |
|||
|
|||
/** |
|||
@@ -233,6 +244,7 @@
|
|||
@return 0 if successful, or -1 if an error occurred |
|||
@see evdns_resolve_reverse_ipv6() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr); |
|||
|
|||
/** |
|||
@@ -251,6 +263,7 @@
|
|||
@param flags Ignored. |
|||
@return 0 if successful, or -1 if an error occurred |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_set_option(const char *option, const char *val, int flags); |
|||
|
|||
/** |
|||
@@ -278,6 +291,7 @@
|
|||
occurred (see above) |
|||
@see resolv.conf(3), evdns_config_windows_nameservers() |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_resolv_conf_parse(int flags, const char *const filename); |
|||
|
|||
/** |
|||
@@ -287,6 +301,7 @@
|
|||
caller to specify which evdns_base it applies to. The recommended |
|||
function is evdns_base_search_clear(). |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
void evdns_search_clear(void); |
|||
|
|||
/** |
|||
@@ -298,6 +313,7 @@
|
|||
|
|||
@param domain the domain to be added to the search list |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
void evdns_search_add(const char *domain); |
|||
|
|||
/** |
|||
@@ -312,6 +328,7 @@
|
|||
|
|||
@param ndots the new ndots parameter |
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
void evdns_search_ndots_set(const int ndots); |
|||
|
|||
/** |
|||
@@ -322,9 +339,11 @@
|
|||
function is evdns_add_server_port_with_base(). |
|||
|
|||
*/ |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
struct evdns_server_port *evdns_add_server_port(evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data); |
|||
|
|||
#ifdef _WIN32 |
|||
+EVENT2_EXPORT_SYMBOL
|
|||
int evdns_config_windows_nameservers(void); |
|||
#define EVDNS_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED |
|||
#endif |
@ -0,0 +1,14 @@ |
|||
diff -u -r ../libevent-release-2.1.8-stable/evutil_rand.c ./evutil_rand.c
|
|||
--- ../libevent-release-2.1.8-stable/evutil_rand.c 2017-01-26 00:37:15.000000000 +0100
|
|||
+++ ./evutil_rand.c 2017-01-27 23:51:13.124764486 +0100
|
|||
@@ -195,8 +195,10 @@
|
|||
void |
|||
evutil_secure_rng_add_bytes(const char *buf, size_t n) |
|||
{ |
|||
+#ifndef __ANDROID__
|
|||
arc4random_addrandom((unsigned char*)buf, |
|||
n>(size_t)INT_MAX ? INT_MAX : (int)n); |
|||
+#endif
|
|||
} |
|||
|
|||
void |
@ -1,26 +0,0 @@ |
|||
Patch taken from https://gitweb.torproject.org/orbot.git/tree/external/libevent-patch-1 |
|||
For some reason arc4random_addrandom isn't present in 64-bit android archs. ! |
|||
|
|||
--- ./configure.ac 2015-01-05 20:00:02.000000000 +0530
|
|||
+++ ../configure.ac 2016-12-06 10:15:44.617028345 +0530
|
|||
@@ -290,7 +290,7 @@
|
|||
|
|||
dnl Checks for library functions. |
|||
AC_CHECK_FUNCS([gettimeofday vasprintf fcntl clock_gettime strtok_r strsep]) |
|||
-AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl])
|
|||
+AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf arc4random_addrandom issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl])
|
|||
AC_CHECK_FUNCS([umask]) |
|||
|
|||
AC_CACHE_CHECK( |
|||
--- ./evutil_rand.c 2013-11-01 23:48:57.000000000 +0530
|
|||
+++ ../evutil_rand.c 2016-12-06 10:38:19.748912002 +0530
|
|||
@@ -174,7 +176,9 @@
|
|||
void |
|||
evutil_secure_rng_add_bytes(const char *buf, size_t n) |
|||
{ |
|||
+#ifdef _EVENT_HAVE_ARC4RANDOM_ADDRANDOM
|
|||
arc4random_addrandom((unsigned char*)buf, |
|||
n>(size_t)INT_MAX ? INT_MAX : (int)n); |
|||
+#endif
|
|||
} |
|||
|
Loading…
Reference in new issue